Issue 844 (bug)
Summary of code path and root cause
- /scoped-models persists selections via SettingsManager.setEnabledModels in packages/coding-agent/src/modes/interactive/interactive-mode.ts.
- On startup, packages/coding-agent/src/main.ts sets modelPatterns = parsed.models ?? settingsManager.getEnabledModels() and resolves them into scopedModels, which are passed into createAgentSession.
- AgentSession exposes these scoped models via session.scopedModels.
- /model uses session.scopedModels as the candidate list in:
- InteractiveMode.getModelCandidates and showModelSelector
- ModelSelectorComponent.loadModels
- Autocomplete for /model in setupAutocomplete
- As soon as settings enabledModels exist, session.scopedModels is non-empty, so /model only shows the scoped list and the UI hints “Showing models from --models scope.” There is no path to show all models.
Proposed fix
- Decouple “model cycling scope” from /model selection. /model should always list all available models, regardless of scoped models saved via /scoped-models.
- Keep scoped models only for Ctrl+P cycling and for the startup “Model scope” message.
- Update the model selector hint to reflect this, for example “Only showing models with configured API keys. Model cycling is scoped to N models.”
Most concise implementation approach
- In packages/coding-agent/src/modes/interactive/interactive-mode.ts:
- setupAutocomplete: always use session.modelRegistry.getAvailable() for /model completions.
- getModelCandidates: always return modelRegistry.getAvailable(), not session.scopedModels.
- showModelSelector: pass only the model registry and current model. Do not pass scoped models as a filter.
- In packages/coding-agent/src/modes/interactive/components/model-selector.ts:
- Remove scopedModels filtering from loadModels.
- Update hint text to reflect availability and optional cycling scope.
- No changes needed in settings or session logic unless you want to add a dedicated “scope source” flag later.
Affected files
- packages/coding-agent/src/modes/interactive/interactive-mode.ts
- packages/coding-agent/src/modes/interactive/components/model-selector.ts
No linked issues or PRs were referenced in the issue.