Repository navigation
fix(ui): preserve first startup errors across session navigation - #130593
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Exact-head CI is verified green for Correction to the earlier preparation note: the missing Clownfish check was not a demonstrated blocker for the authenticated account, which was exempt from that ruleset. Normal native merge verification succeeded. The repository owner separately requested removal of the Clownfish exact-merge ruleset; Root cause: the restart-safe setup/dispatch terminalizer saved the failed state but omitted its diagnostic and suppressed the later lifecycle write. A newly mounted chat could miss the transient live event; history previously restored only active runs. The fix reuses the canonical bounded lifecycle snapshot and existing run reducer, with no new error store, UI cache, schema, clone policy, or retry policy. Best-fix judgment: repair the authoritative terminal producer and restore its existing session-row diagnostic on the reader. Rejected alternatives: delaying navigation, client-only error caches, and extra retry/timeout paths would preserve the ownership failure or lose errors on reload. Live proof was run in real Chrome against a real isolated loopback Gateway with an actual failing GitHub clone. Before: no stored Focused regression proof: 65 Gateway tests and 222 UI tests passed. Tests failed on main for missing Production +97/-51 (net +46), tests +158/-2, docs +2. The growth supplies the previously absent error handoff and history recovery with existing run-identity fencing; duplicate lifecycle assignments and the separate error setter were removed. Provenance: the terminalizer without diagnostic recording dates to #106151 ( |
|
Merged via squash.
|
Closes #130589. Follow-up to #130192 (session-first remote project startup).
What Problem This Solves
Fixes an issue where users starting a remote-project session could lose the first clone error while navigating into the new chat. Reloading a failed chat also removed its diagnostic, leaving only the submitted message; users had to retry to see why setup failed.
Why This Change Was Made
Early setup/dispatch failures now pass their diagnostic through the existing canonical session lifecycle snapshot, saving the bounded
lastRunErroratomically with terminalization. Chat startup, full history, and cursor catch-up restore missed terminal failures through the existing run reducer and shared error display.This removes duplicate lifecycle assignments rather than introducing another error store or UI cache. Retry admission clears the old diagnostic, newer live runs win over stale history, and a complete live diagnostic is preserved instead of being replaced by the 160-character stored summary. Clone policy, authentication, cancellation ownership, retry policy, schemas, and protocol contracts are unchanged.
User Impact
The first startup error stays visible after opening the session, reloading the browser, or restarting the Gateway—without sending another message. Normal retries remain usable and do not display stale errors from the previous run.
Evidence
Real Chrome and a real loopback-only Gateway, built from main
42112dd86ec3010cb14011d7514c82063b12974aand then the repaired source, with isolated state and a real failing GitHub clone. No mocked Gateway, forged events, or operator service changes were used.status=failedandlastRunId, but nolastRunError; browser reload left no diagnostic.Red-green regressions:
lastRunErrorwas absent.chatRunErrorwas absent.Exact local commands:
node scripts/run-vitest.mjs src/gateway/server.chat.gateway-server-chat-b.test.ts -t 'durably admits a restart-safe|releases an unadopted durable claim|releases a durable claim|leaves a post-admission routing rejection'pnpm build, the full changed-file check plan,git diff --check, and independent autoreview passed. Relevant error/lifecycle owners remained unchanged on later main8e1c34e21dd08f813cefc982079384fdd83fc084.Production LOC: +97/-51 (net +46) | Tests: +158/-2 (net +156) | Docs: +2/-0. The necessary growth restores a missing durable diagnostic and its history presentation using existing ownership and run-identity fences; there is no new persistence surface or fallback path.
AI-assisted; source, red-green tests, and real browser behavior were independently inspected.