Reviewed issue #844 and related comments.
UnderstandExamined all related code files in full.
UnderstandTraced code paths for model selection and session handling.
UnderstandProposed a fix approach based on root cause analysis.
PlanAnalyze GitHub issue(s): https://github.com/badlogic/pi-mono/issues/844
For each issue:
Read the issue in full, including all comments and linked issues/PRs.
For bugs:
For feature requests:
Do NOT implement unless explicitly asked. Analyze and propose only.
Issue 844 analysis
Type: bug
Linked issues or PRs: none.
What happens in code
parsed.models ?? settingsManager.getEnabledModels() to build scopedModels via resolveModelScope.scopedModels, and AgentSession stores them in _scopedModels.session.scopedModels to build the candidate list in:
--models scope, so /model only shows the scoped set and shows the “Showing models from --models scope” hint.Actual root cause
The same scopedModels list is used for two different purposes:
scopedModels on startup, so /model is unintentionally filtered.Proposed fix Separate “cycling scope” from “model selector scope”.
Concise implementation approach
modelScopeSource: "cli" | "settings" | "session" | "none"isModelSelectionScoped.scopedModels:
parsed.models set to clisettings/scoped-models session-only updates set to session.cli.Affected files and changes
isModelSelectionScoped.This keeps /scoped-models as a Ctrl+P preference while preserving --models as a hard scope for /model when explicitly requested.