Repository navigation
fix(ui): show agent warm-up instead of restart error - #164041
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 October 3, 2026, 12:50 AM ET / 04:50 UTC. ClawSweeper reviewWhat this changesThe Control UI preserves retryable agent-startup errors through the chat-history deadline and displays a warm-up message while retaining settled failure diagnostics. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still loses the startup-inspection cause at the history deadline. No actionable correctness or security findings were identified, and the inspected visual evidence supports the narrow UI repair. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI loads conversations through Gateway history requests. Its shared reader retries transient failures, then presents either the conversation or an error with Retry. flowchart TD
A[Open conversation] --> B[Shared history reader]
B --> C[Gateway startup response]
C --> D{Inspection pending?}
D -->|Yes| E[Bounded retries]
E --> F[Warm-up notice and Retry]
D -->|Settled failure| G[Operator diagnostic]
D -->|Ready| H[Conversation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +22, Tests +81. Total +103 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep startup presentation in the existing history reader, using the Gateway's typed pending state while preserving terminal diagnostics and manual recovery. Do we have a high-confidence way to reproduce the issue? Yes, from source: repeated typed pending-inspection responses reach the current reader's 60-second deadline and become a generic timeout. The supplied browser negative control supports this path; this review did not execute it. Is this the best way to solve the issue? Yes. Preserving the cause per active reader and formatting only the exact pending state repairs the existing owner without changing admission, retry budgets, or persisted state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against be8190f2f8c4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Related: #163690
Related: #163839
What Problem This Solves
Fixes: Control UI presents a retryable agent-database startup inspection as a raw diagnostic or generic chat-history failure after a normal Gateway restart.
User Impact
User impact: while an agent database is still being inspected, Chat now says the agent is still starting and keeps Retry available; settled inspection failures still show the operator diagnostic.
Why This Change Was Made
The Gateway intentionally begins serving before long-running agent database inspection completes.
chat.startupalready reports that state as typed, retryableUNAVAILABLE, but the shared Control UI history reader discarded the typed cause at its local 60-second deadline.This preserves the last retryable cause per active history consumer and maps only
agent-database-inspection-pendingto bounded warm-up copy. It does not change Gateway startup, database admission, persistence, protocol, or terminal failure behavior.Production delta: +22 lines. Test delta: +81 lines. No configuration, schema, dependency, or migration changes.
Evidence
node scripts/run-vitest.mjs ui/src/pages/chat/chat-history-retry.test.ts --maxWorkers=1 --reporter=dot— 14 passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-loading-deadlines.e2e.test.ts— 5 passed against the production Control UI bundle.node scripts/check-changed.mjs -- <five changed paths>— passed formatting, UI/core test type graphs, UI typecheck, lint, coercion, line-cap, and dead-export guards.pnpm ui:i18n:verifyandgit diff --check— passed.codex, P2) — scoped clean, no accepted/actionable findings.Reproducing the original multi-gigabyte inspection delay on the active Team server would require a disruptive restart and state manipulation, so the UX repair uses the existing production-bundle mock-Gateway boundary with the exact typed refusal contract.
Before
After