fix(ui): keep dashboard mounted during reconnect#94703
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 7:33 PM ET / 23:33 UTC. Summary PR surface: Source +89, Tests +147. Total +236 across 10 files. Reproducibility: yes. Current main is source-reproducible for the linked bug, and the PR regression is source-reproducible by following a post-hello 4001 auth/device revocation close with no structured connect error into the new render gate. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Preserve the shell during transient reconnects, but reset the prior-success gate for structured auth failures and known 4001 auth/device revocation close reasons, with regression coverage and inspectable browser proof. Do we have a high-confidence way to reproduce the issue? Yes. Current main is source-reproducible for the linked bug, and the PR regression is source-reproducible by following a post-hello 4001 auth/device revocation close with no structured connect error into the new render gate. Is this the best way to solve the issue? No, not as-is. The sticky prior-success approach is the right shape for transient reconnects, but it must also handle current Gateway auth-revocation close frames and provide inspectable UI proof before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 55323103b912. Label changesLabel justifications:
Evidence reviewedPR surface: Source +89, Tests +147. Total +236 across 10 files. View PR surface stats
Security concerns:
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
|


Summary
Fixes the Control UI reconnect gate so a transient Gateway disconnect after a successful connection keeps the dashboard/chat shell mounted instead of replacing it with the login gate.
The fix tracks whether the current Gateway identity has connected successfully, resets that state when the Gateway URL/token/password changes, and preserves the mounted dashboard during the bounded cached-device-token retry path for
AUTH_TOKEN_MISMATCH.Verification
node node_modules/vitest/vitest.mjs run --config test/vitest/vitest.ui.config.ts --reporter=verbose ui/src/ui/app-render.assistant-avatar.test.tsnode node_modules/vitest/vitest.mjs run --config test/vitest/vitest.ui.config.ts --reporter=dot ui/src/ui/app-gateway.node.test.tsnode node_modules/vitest/vitest.mjs run --config test/vitest/vitest.ui.config.ts --reporter=dot ui/src/ui/navigation.browser.test.tsnode node_modules/vitest/vitest.mjs run --config test/vitest/vitest.ui.config.ts --reporter=dot ui/src/ui/gateway.node.test.tsnode_modules/oxfmt/bin/oxfmt --check --threads=1 ui/src/ui/app-render.ts ui/src/ui/app-gateway.ts ui/src/ui/app.ts ui/src/ui/app-view-state.ts ui/src/ui/app-render.assistant-avatar.test.ts ui/src/ui/app-gateway.node.test.ts ui/src/ui/gateway.ts ui/src/ui/gateway.node.test.ts ui/src/ui/navigation.browser.test.ts ui/src/ui/views/login-gate.tsgit diff --checknode node_modules/@typescript/native-preview/bin/tsgo.js -p test/tsconfig/tsconfig.test.ui.json --pretty false --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.local-fix.tsbuildinfo.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainReal behavior proof
Behavior addressed: Control UI no longer replaces an already-mounted dashboard/chat view with the login gate during transient reconnects after a successful Gateway connection.
Real environment tested: Local Control UI E2E server with mocked Gateway WebSocket in Chrome on macOS, plus focused Vitest/jsdom coverage for reconnect, auth failure, device-token retry, and Gateway identity edit paths.
Exact steps or command run after this patch:
node --import tsx .artifacts/control-ui-e2e/reconnect-gate/capture.mjsagainst the patched branch; focused Vitest, oxfmt, diff check, tsgo, and autoreview commands listed above.Evidence after fix: Screenshot artifacts were generated locally under
.artifacts/control-ui-e2e/reconnect-gate/and intentionally not committed per repository policy.transient-reconnect-dashboard.pngshows the dashboard/chat shell still mounted with a disconnect warning;auth-scope-login-gate.pngshows explicit auth-scope failure still routes to the login gate.transient-reconnect-before-login-gate.pngwas captured fromorigin/mainand shows the previous behavior returning to the login gate for the same transient disconnect.Observed result after fix: A generic
disconnected (1006): no reasonafter a prior successful connection keeps.shellvisible and keeps.login-gatedetached. Explicit auth/config failures still render the login gate, and cached device-token retry windows do not flash the credential screen.What was not tested: Full packaged app flow, live remote Gateway, and cross-OS browser proof were not run; coverage is scoped to the Control UI reconnect behavior and mocked Gateway protocol paths.
AI-assisted: yes.
Agent Transcript
Redacted agent session transcript