Skip to content

fix(ui): show agent warm-up instead of restart error - #164041

Merged
RomneyDa merged 1 commit into
mainfrom
fix/ui-agent-database-warmup
Oct 3, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/ui-agent-database-warmup

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 3, 2026

Copy link
Copy Markdown
Member

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.startup already reports that state as typed, retryable UNAVAILABLE, 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-pending to 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

  • Negative control: the focused formatter test failed before the fix by returning the full agent-database diagnostic.
  • Negative control: the production-bundle browser test then exposed the deeper owner bug by receiving the generic history timeout at the 60-second deadline.
  • 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:verify and git diff --check — passed.
  • AutoReview (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

Control UI showing a generic chat history timeout during agent database warm-up

After

Control UI showing that the agent is still starting with Retry available

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 3, 2026 04:44
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 12:50 AM ET / 04:50 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 5077b939d2c72b264f3d354e462ce3952f388499

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant visual proof, meaningful regression coverage, and no identified blocking defect.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
Evidence reviewed 8 items Pinned introduction: The merge-base-to-head diff limits the introduced behavior to history-error preservation, English copy, and focused regression coverage.
Narrow error classification: Warm-up copy requires a GatewayRequestError with UNAVAILABLE, retryable=true, and the exact pending-inspection detail code. Other errors retain the existing formatter.
Current main still needs this repair: Fetched main retains the generic timeout formatter and lacks the pending-inspection presentation branch; comparison of the two production modules shows this PR's repair remains distinct.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +22, Tests +81. Total +103 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 29 7 +22
Tests 2 81 0 +81
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 110 7 +103

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This repairs misleading startup error presentation with a limited Control UI blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.

Label justifications:

  • P2: This repairs misleading startup error presentation with a limited Control UI blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly demonstrate the changed warm-up text and visible Retry control. The supplied production-bundle browser scenario exercises the shared history reader through chat.startup with the exact typed refusal and deadline; it does not claim live database-restart coverage. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@RomneyDa
RomneyDa merged commit 6a56539 into main Oct 3, 2026
144 checks passed
@RomneyDa
RomneyDa deleted the fix/ui-agent-database-warmup branch October 3, 2026 05:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant