feat: pin backend/model defaults with --default and default-aware pickers#21
Open
nelopuchades wants to merge 3 commits into
Open
feat: pin backend/model defaults with --default and default-aware pickers#21nelopuchades wants to merge 3 commits into
nelopuchades wants to merge 3 commits into
Conversation
Add /model --default and /backend --default to surgically update backend and modelOverride in agent.config.json without re-running setup. Session switches still apply if the file cannot be written.
Distinguish the live session choice from the value persisted in agent.config.json. The `/model` and `/backend` pickers now tag each entry `(selected)` when it matches the active session model/backend and `(default)` when it matches what would load on next launch (read via the new config::persisted_defaults helper). Both tags show when they coincide. Add tests for persisted_defaults and parse_picker_selection; document the markers and inline `--default` pinning in the README and CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Motivation
Small Harness reads
backend/modelOverridefromagent.config.jsonatlaunch, but the only way to change those project defaults was to re-run
/setupor hand-edit the file. Switching model or backend mid-session (
/model,/backend) applied for that session only and silently reverted on the nextlaunch, with no indication in the picker of what was actually persisted.
This change lets you pin the active — or newly selected — backend/model straight
into
agent.config.json, and makes the interactive pickers show what is liveversus what is saved on disk.
Summary of changes
Persisting defaults
/model --defaultand/backend --defaultto surgically mergebackendand
modelOverrideintoagent.config.jsonwithout re-running/setup/model … --defaultwritesbackend+modelOverride;/backend … --defaultwrites
backendand clearsmodelOverrideso the next launch uses thatbackend's built-in default model
JSON is never overwritten
Default-aware pickers
/modeland/backendentry(selected)when it is the live sessionchoice and
(default)when it matches what would load on next launch (read viathe new
config::persisted_defaultshelper); both show when they coincide--defaultto a picker selection (e.g.3 --default) to pin it as youchoose; otherwise a
y/Nprompt offers to save the choice as the project defaultDocs
--defaultpinning, and the markers in the READMEand Unreleased CHANGELOG
Verified by
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test(565 passed)Screenshots