Scope session config changes to their session; mjconfig owns defaults - #936
Open
foundev wants to merge 1 commit into
Open
Scope session config changes to their session; mjconfig owns defaults#936foundev wants to merge 1 commit into
foundev wants to merge 1 commit into
Conversation
Session settings now follow one rule: a change made anywhere in mj applies only to the session it was made in, and only /mjconfig also changes the defaults new sessions start from. - Live /model, /effort, and session-option changes are session-local: delete persist_accepted_session_config and the session_config[].models routes layer, so accepted values are never written back to config.toml and can no longer leak into new sessions or subagents. Leftover [session_config.*.models] tables in old configs parse and are ignored. - save_user_config_preserving_session_routes becomes a plain locked save_user_config: with no live write-back there is nothing to merge. - The web /mjconfig save carries the invoking session id; the server reloads that one session's auxiliary routes instead of broadcasting ReloadAuxiliaryAgents to every running session. - A save that replaces the primary still updates the invoking session's reviewer and subagent lanes: both runtime handlers re-pair auto seats against the still-running primary (new rebind_auto_subagents_for_primary) instead of bailing, and the TUI always sends the aux reload while the primary-route check gates only the switch-primary prompt. - Server clear/new re-reads saved defaults from disk via the new SavedSessionConfigReload source, so an mjconfig save made after launch reaches fresh sessions on the same runtime. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Session settings now follow one rule: a change made anywhere in mj applies only to the session it was made in, and only
/mjconfigalso changes the defaults new sessions start from./model,/effort, and session-option changes are no longer written back to config.toml:persist_accepted_session_configand thesession_config[].modelsroutes layer are deleted, so live tweaks can't leak into new sessions or subagents. Leftover[session_config.*.models]tables in old configs still parse and are ignored.save_user_config_preserving_session_routesbecomes a plain lockedsave_user_config— with no live write-back there is nothing to merge.session_id; the server reloads that one session's auxiliary routes instead of broadcastingReloadAuxiliaryAgentsto every running session.autoseats against the still-running primary via the newrebind_auto_subagents_for_primaryinstead of bailing, and the TUI always sends the aux reload while the primary-route check gates only the switch-primary prompt.SavedSessionConfigReloadsource, so an/mjconfigsave made after launch reaches fresh sessions on the same runtime.Docs (
configuration.md) updated to state the contract.Test plan
cargo test --workspace— green (~2,000+ tests), including new coverage:accepted_live_config_update_is_never_persistedstale_model_route_tables_are_ignoredfresh_session_reloads_saved_defaults_from_diskrebind_auto_subagents_for_primaryrebind + explicit-pin-kept casescargo clippy --all-targets— clean🤖 Generated with Claude Code