fix(ui): keep chat model selected after session switch#88380
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 1:19 PM ET / 17:19 UTC. Summary PR surface: Source +13, Tests +159. Total +172 across 4 files. Reproducibility: yes. The linked report gives a concrete A-to-B-to-A session-switch path, and the PR adds focused component and Chromium E2E tests that encode the failure mode; I did not run tests because this review is read-only. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge this focused UI binding fix after the latest head checks settle, then let the linked bug report at #86597 close through the PR. Do we have a high-confidence way to reproduce the issue? Yes. The linked report gives a concrete A-to-B-to-A session-switch path, and the PR adds focused component and Chromium E2E tests that encode the failure mode; I did not run tests because this review is read-only. Is this the best way to solve the issue? Yes. Binding the select property to the resolved override with Lit's AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3fffb34ba0c0. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +13, Tests +159. Total +172 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
16cb7c1 to
3dada17
Compare
3dada17 to
4ea53f0
Compare
4ea53f0 to
b134fd5
Compare
b134fd5 to
38b52d5
Compare
38b52d5 to
01821c4
Compare
|
Verification for rebased head
Proof gap: no manual browser pass; the changed behavior is covered by the focused unit and UI e2e regression tests above. |
steipete
left a comment
There was a problem hiding this comment.
Approved after focused regression proof, clean autoreview, and green CI on rebased head.
Summary
<select>value to the resolved session override so the DOM cannot keep showing the default option while state still points at the persisted override.@openclaw/net-policy/*from source during local Vite E2E runs.Closes #86597
Real behavior proof
Behavior or issue addressed: WebChat model picker display-only regression from #86597. After selecting
bedrock/claude-opus-4.5in session A, switching to session B, then switching back to session A, the picker should visibly show the selected override instead ofDefault (GPT-5.5).Real environment tested: Local Windows checkout of this PR branch (
b134fd5533) running the real Control UI source in Chromium through the repo's Vite Control UI E2E harness. This exercises the browser-rendered chat header, session picker, model picker, WebSocket request path, and actual DOM selected value. No live provider credentials are required because this bug is Control UI display state only.Exact steps or command run after this patch:
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/ui/e2e/chat-flow.e2e.test.ts -t "keeps a session model override selected after switching away and back" --reporter=dot --pool=forks --no-file-parallelismEvidence after fix: Rerun after rebasing onto current
main:The browser E2E asserts the visible
select[data-chat-model-select="true"]value through the user flow:Observed result after fix: The picker remains visibly selected as
bedrock/claude-opus-4.5after switching away from session A and back. Before the fix, the resolved UI state still hadcurrentOverride="bedrock/claude-opus-4.5", but the actual DOM select value stayed""and displayed the default option.What was not tested: A live provider call or real Gateway persistence roundtrip was not used, because the issue is limited to Control UI display binding and the browser proof exercises the rendered UI with deterministic Gateway responses. Provider routing, model execution, and Gateway session persistence are intentionally unchanged.
Validation
Latest focused validation after rebasing onto current
main:node scripts/run-vitest.mjs run ui/src/ui/views/chat.test.ts -t "keeps the selected model visible after switching away and back to a session" --reporter=dot --pool=forks --no-file-parallelism-> passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/ui/e2e/chat-flow.e2e.test.ts -t "keeps a session model override selected after switching away and back" --reporter=dot --pool=forks --no-file-parallelism-> passed.git diff --check origin/main...HEAD-> passed.Broader validation run before the latest upstream-main churn:
node scripts/run-vitest.mjs run ui/src/ui/views/chat.test.ts ui/src/ui/chat-model-select-state.test.ts --reporter=dot --pool=forks --no-file-parallelism-> 2 files passed, 72 tests passed.node scripts/run-vitest.mjs run ui/src/ui/app-chat.test.ts --reporter=dot --pool=forks --no-file-parallelism-> 1 file passed, 58 tests passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/ui/e2e/chat-flow.e2e.test.ts --reporter=dot --pool=forks --no-file-parallelism-> 1 file passed, 6 tests passed.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/test-helpers/control-ui-e2e.ts ui/src/ui/chat/session-controls.ts ui/src/ui/e2e/chat-flow.e2e.test.ts ui/src/ui/views/chat.test.ts --type-aware --report-unused-disable-directives-severity error --threads=1-> passed.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo-> passed.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo-> passed.codex review --uncommitted-> no actionable regressions found.Current CI note: the branch was rebased onto current
main. The previously red upstream-main type/build failures pass locally on this branch (test/tsconfig/tsconfig.extensions.test.jsonandtsconfig.plugin-sdk.dts.json). Current main still has an unrelated runtime-config failure insrc/config/sessions.cache.test.ts(falls back to full projection when untouched entries need prompt blob repair), which reproduces locally and is outside this PR's four-file WebChat/UI diff. GitHub CI is rerunning on the refreshed head.Risk
Low. The runtime change is limited to binding the existing resolved model override into the DOM select value. The E2E harness alias only affects local Control UI browser tests and resolves private workspace packages from source for Vite.