Repository navigation
fix(tui): preserve published model availability - #142160
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 9:38 AM ET / 13:38 UTC. ClawSweeper reviewWhat this changesThe terminal model picker preserves published availability, explains unavailable choices without changing the session, and uses the shared catalog projection in local mode. Merge readiness✅ Ready for maintainer review This remains a useful fix absent from current main. No blocking defects were found, and the updated runtime evidence addresses the previous configured-only and wildcard startup concern. Priority: P2 Review scores
Verification
How this fits togetherThe terminal UI obtains model choices from a connected Gateway or its embedded local runtime. The selected agent’s catalog feeds the picker, whose accepted choices update the session’s model. flowchart TD
A[Selected agent] --> B[Gateway catalog]
A --> C[Local published catalog]
B --> D[Terminal model picker]
C --> D
D --> E{Known unavailable?}
E -->|Yes| F[Show recovery guidance]
E -->|No| G[Update session model]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +263, Docs 0. Total +283 across 11 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one published catalog projection for terminal browsing, retain raw execution operands, and preserve capability-negotiated compatibility with released Gateways. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main forwards a known-unavailable picker choice to the session patch without checking its availability. This review did not execute that path. Is this the best way to solve the issue? Yes. Reusing the existing catalog projection removes competing discovery logic, while the explicit-false guard and capability negotiation preserve unknown and legacy choices. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd8f393b2366. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Proof: Four compiled local-terminal scenarios cover configured replacement, provider wildcards, a different agent with restrictive policy, and empty replacement. Separate public session commands confirm saved selections and refusal outcomes. All terminal processes exited normally and their enclosing groups stopped.
|
Use canonical published model facts in the terminal picker and refuse known unavailable choices before session mutation. Preserve unknown and legacy choices, raw execution catalogs, selected-agent scope and prepared-owner lifetime. Remove the embedded discovery/filter path and static publication override. Verified with the baseline regression, 45 focused cases, four compiled terminal scenarios, retained owner/history evidence and exact-head CI. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #139880.
What Problem This Solves
The terminal picker lost published availability and submitted known unavailable choices as session changes. Embedded mode also maintained separate discovery and filtering.
Why This Change Was Made
Both terminal backends use the selected agent's published model facts. Display projection retains its prepared owner, while embedded history, patch, and creation use raw prepared entries. Unavailable selection returns before session mutation.
User Impact
Unavailable choices remain visible with a reason and recovery guidance. Available and unknown choices can still be selected. Older Gateways retain their supported request and selection behavior.
Consumers: terminal model display and selection, plus embedded session operations, now share published catalog facts.
Evidence
The original selector failed the unavailable-selection regression; all 45 focused cases passed after repair. Four compiled local-terminal scenarios covered replacement, wildcards, another agent's restrictive policy, and empty inventory. Separate session-list commands confirmed saved selections and unchanged state after refusals. Continuous integration passed after one infrastructure retry. Public checks did not cover populated-history refusal or in-flight replacement; those retain owner-level coverage. Live inference, native accounts, and standalone installation were not tested.