Skip to content

fix(workspace, cli): Fix config loss on resume#459

Merged
JeanMertz merged 1 commit intomainfrom
prr29
Mar 19, 2026
Merged

fix(workspace, cli): Fix config loss on resume#459
JeanMertz merged 1 commit intomainfrom
prr29

Conversation

@JeanMertz
Copy link
Collaborator

Continuing a conversation without passing --cfg flags caused the conversation's model and tools to be silently reset to defaults on each invocation.

The root cause was a sequencing issue: apply_conversation_config runs inside load_partial_config and needs to access the active conversation's stream config from disk. Previously, load_conversations_from_disk was called after load_partial_config, so events weren't loaded yet. The merge fell back to an empty partial and overwrote whatever the conversation had stored.

The fix splits the old load_conversations_from_disk into two methods. load_conversation_index loads conversation IDs, metadata, and TombMap entries — everything needed for lazy event access — and is now called before load_partial_config.
ensure_active_conversation_stream handles the one remaining config-dependent step (creating a default stream for fresh workspaces) and runs after the final AppConfig is built.

Continuing a conversation without passing `--cfg` flags caused the
conversation's model and tools to be silently reset to defaults on each
invocation.

The root cause was a sequencing issue: `apply_conversation_config` runs
inside `load_partial_config` and needs to access the active
conversation's stream config from disk. Previously,
`load_conversations_from_disk` was called _after_ `load_partial_config`,
so events weren't loaded yet. The merge fell back to an empty partial
and overwrote whatever the conversation had stored.

The fix splits the old `load_conversations_from_disk` into two methods.
`load_conversation_index` loads conversation IDs, metadata, and
`TombMap` entries — everything needed for lazy event access — and is now
called _before_ `load_partial_config`.
`ensure_active_conversation_stream` handles the one remaining
config-dependent step (creating a default stream for fresh workspaces)
and runs _after_ the final `AppConfig` is built.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit ef98ee5 into main Mar 19, 2026
12 checks passed
@JeanMertz JeanMertz deleted the prr29 branch March 19, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant