Read GitHub issue and related content.
UnderstandAdded changelog entry.
EditRan tests to confirm changes.
VerifyAnalyze GitHub issue(s): https://github.com/badlogic/pi-mono/issues/844
For each issue:
Do NOT implement unless explicitly asked. Analyze and propose only.
Issue 844 analysis
Summary of issue
Saving a scoped model selection persists enabledModels in settings. On the next run, /model only shows those scoped models and displays the --models scope hint. There is no way to view the full model list unless scoped models are cleared.
Root cause
The /scoped-models selector writes enabledModels to settings. On startup, main.ts uses parsed.models ?? settingsManager.getEnabledModels() to resolve scopedModels. That list is passed into the session and used by /model and autocomplete. The model selector and /model candidates always use session.scopedModels when the list is non empty, even if the scope came from settings rather than the CLI flag. This makes /model behave as if --models was provided.
Code path
ScopedModelsSelectorComponent persists to SettingsManager.setEnabledModels()main.ts uses settingsManager.getEnabledModels() to populate scopedModelsInteractiveMode.setupAutocomplete and InteractiveMode.getModelCandidates use session.scopedModelsModelSelectorComponent uses its scopedModels input to filter the model list and show the scoped hintProposed fix
Track the source of scoped models and only restrict /model when scope comes from the CLI --models flag. Scoped models from settings should still be used for Ctrl+P cycling but should not constrain the /model list or /model autocomplete.
Suggested approach
restrictModelSelectionToScopedModels: boolean.main.ts to true only when parsed.models is provided.AgentSession and expose a getter.InteractiveMode to use the flag for /model candidates and for ModelSelectorComponent input.ModelSelectorComponent to show the scoped hint only when the flag is enabled.Affected files
packages/coding-agent/src/main.tspackages/coding-agent/src/core/sdk.tspackages/coding-agent/src/core/agent-session.tspackages/coding-agent/src/modes/interactive/interactive-mode.tspackages/coding-agent/src/modes/interactive/components/model-selector.tsi think we should implement the suggestion by the user. model selector listens for tab key press and that switches between all models or scoped models. but only when scoped models are given.
the tui should show a hint that TAB switches between all and scoped models, and it should show the current model "scope" selection.
Summary:
Updated packages/coding-agent/src/modes/interactive/components/model-selector.ts to add Tab-based scope toggling between scoped and all models when scoped models exist, with a scope line that shows current selection and the Tab hint.
Tests not run.
ok, i have a different impl in ../pi-mono-codex/. i want that one, it has better ui in /model. can you investigate and copy this to this impl?
Which file(s) in ../pi-mono-codex should I compare and copy from? Give the paths for the model selector UI implementation.
it's the same file you modified in this clone. the other folder is an alternative clone
Summary:
Replaced packages/coding-agent/src/modes/interactive/components/model-selector.ts with the implementation from /Users/badlogic/workspaces/pi-mono-codex to match the improved /model UI.
Tests not run.
looking good, commit and push, and close the issue with a comment in my tone explaining what we implemented
Summary:
packages/coding-agent/src/modes/interactive/components/model-selector.ts.Tests:
add a changelog entry
Summary:
## [Unreleased] in packages/coding-agent/CHANGELOG.md.Tests: