You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(model): switch between provider/model mid-session (/model, /models, picker)
Switching models used to require restarting with CODEBASE_PROVIDER /
CODEBASE_MODEL env vars. Ship a real switching path now that the proxy
exposes a live model list:
- /model with no args opens an inline picker over the input row. ↑↓ to
navigate, Enter to commit, r to reset to Codebase Auto, Esc to cancel.
- /model <id> or /model <provider>:<id> switches directly (great for
muscle memory once you know the id).
- Aliases for common picks: sonnet, opus, haiku, gpt-5, gpt-4o, llama.
- /model auto resets to the default.
- /models lists everything your account can access, grouped by provider,
with the active model marked.
Mechanically: the agent bundle is now state (not a memo) inside ChatApp,
so /model can abort the current run, snapshot state.messages, rebuild
the bundle with the new model + existing transcript via a new
modelOverride + initialMessages on createAgent, and swap it in via
setBundle. The reducer gets a "model-switched" action that updates
state.model and clears per-agent execution state (tools, streaming,
error) without nuking the conversation.
The choice persists to ~/.codebase/config.json (new `model` field on
Config), so next launch defaults to your last pick. ConfigStore grows
preferredModel() + setPreferredModel() to read/write that field while
preserving every other field in the user config file.
BYOK users get a graceful fallback message — there's no central model
list to fetch for arbitrary upstreams, so /model and /models tell them
to set env vars at launch instead of opening an empty overlay.
0 commit comments