Repository navigation
fix(ui): show active session model in composer - #138076
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
cde38df to
b894896
Compare
|
Codex review: blocked before merge. Reviewed September 4, 2026, 5:10 AM ET / 09:10 UTC. ClawSweeper reviewWhat this changesThe PR projects an active fallback model into Gateway session rows and uses it for the Control UI composer label while retaining the selected model inside the picker. Merge readiness⛔ Blocked before merge - 1 item remains Keep this MEMBER-authored PR open for normal merge review. The patch cleanly separates the selected preference from the verified active fallback state, so the composer can report the serving model without changing picker selection semantics; no blocking correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherAgent-run accounting records the selected and active model when fallback occurs, and the Gateway projects that state into session rows. The Control UI consumes the rows to show the active serving model in the composer while its picker remains a preference editor. flowchart LR
A[Fallback transition] --> B[Persisted session state]
B --> C[Gateway session row]
C --> D[Control UI session state]
D --> E[Composer active-model label]
D --> F[Picker selected preference]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +32, Tests +153, Other +8. Total +193 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the additive selected-versus-active session-row contract and merge once the exact-head required checks complete; no migration or compatibility fallback is needed because the new fields are optional. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main emits only the selected model while the established fallback owner records a distinct active model; the added browser test exercises the selected-versus-active session-row scenario. Is this the best way to solve the issue? Yes. Reusing the validated persisted fallback transition at the Gateway boundary and projecting a separate optional pair is the narrowest maintainable fix; changing the picker selection would conflate two distinct facts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b8cdd65bdf61. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The composer model trigger stayed on the configured model even when the session was actively running a fallback model. That made the control disagree with the model actually producing responses.
Closes #93346.
Why This Is the Right Approach
model/modelProvideras the selected preference so existing callers and picker selection semantics do not change.This is additive (+32 production LOC) because selected and active models are distinct facts. No legacy path was removed or silently redefined.
User Impact
When a session falls back, the composer now names the model actually serving the session. Opening the picker still shows the user's configured model as selected. When the fallback clears, the trigger returns to the configured model.
Evidence
Before: the trigger remains on the configured GPT-5.5 model while the session is actively using Qwen.
After: the trigger shows Qwen 3.5 9B, while the picker retains GPT-5.5 as the configured preference.
Validation
pnpm checkpnpm buildpnpm protocol:checkpnpm test packages/gateway-protocol/src/schema/sessions-row.test.ts(6 passed)pnpm test src/gateway/session-utils.test.ts(235 passed)pnpm test ui/src/pages/chat/chat-view.test.ts(358 passed)pnpm test ui/src/e2e/chat-composer-catalog.e2e.test.ts -t "shows the active fallback model"(1 passed, 10 skipped)The broad local repository run reached unrelated environmental failures and was stopped after the focused projects completed: two long-temp-path failures passed when rerun under
/tmp; an untouched sandbox browser config-hash test still reproduces independently. Required CI remains the merge gate.