Skip to content

fix: recover stuck Control UI chat runs - #90618

Closed
clawsweeper[bot] wants to merge 5 commits into
mainfrom
clawsweeper/gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo
Closed

clawsweeper[bot] wants to merge 5 commits into
mainfrom
clawsweeper/gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Credit

This continues the contributor work from @siewcapital in #42258. ClawSweeper should preserve that source attribution when updating the branch.

Verification

  • pnpm test ui/src/ui/controllers/chat.test.ts ui/src/ui/app-gateway.node.test.ts ui/src/ui/app-lifecycle.node.test.ts
  • pnpm check:changed
  • Real behavior proof should cover a Control UI chat run that misses its terminal event, recovers idle state via the watchdog/session proof path, reloads history, and flushes a queued follow-up without showing a transient probe error banner.

ClawSweeper 🐠 replacement reef notes:

  • Cluster: gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo
  • Source PRs: fix: recover stuck Control UI chat runs #42258
  • Credit: Repair contributor branch for source PR fix: recover stuck Control UI chat runs #42258 by @siewcapital; preserve source PR attribution in the repaired PR history/body.; Do not edit CHANGELOG.md for normal OpenClaw repair work; keep release-note context in the PR body and eventual squash message.; Agent RPC abort support is already credited/landed via fix(gateway): allow chat.abort to stop agent RPC runs #71214 and should not be reopened in this repair.
  • Validation: pnpm test ui/src/ui/controllers/chat.test.ts ui/src/ui/app-gateway.node.test.ts ui/src/ui/app-lifecycle.node.test.ts; pnpm check:changed
  • Replacement reason: ClawSweeper could not update the source PR branch directly, so it opened a writable replacement PR instead.
  • Repair fallback: GitHub rejected the repair branch push because it updates workflow files and the ClawSweeper app token does not have workflows permission

Inherited issue-closing references from the source PR:
Closes #42213

Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against ae868b7.

@clawsweeper clawsweeper Bot added app: web-ui App: web-ui stale Marked as stale due to inactivity size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper Tracked by ClawSweeper automation labels Jun 5, 2026
@clawsweeper clawsweeper Bot mentioned this pull request Jun 5, 2026
5 of 20 tasks
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 5, 2026
@clawsweeper

clawsweeper Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 10:50 AM ET / 14:50 UTC.

Summary
The PR adds a Control UI chat-run watchdog that probes agent.wait after inactivity, clears stale local run state, reloads chat history, and flushes queued messages with regression coverage.

PR surface: Source +199, Tests +338. Total +537 across 9 files.

Reproducibility: yes. at source level: current main still treats non-null chatRunId as busy and blocks flushChatQueue, and no main text-chat watchdog was found; no live browser/gateway reproduction was run in this read-only pass.

Review metrics: 1 noteworthy metric.

  • Watchdog state surface: 3 added host state fields. The timestamp, timer handle, and in-flight flag now control when local chat recovery clears state and flushes queued messages.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Port the watchdog to current ui/src/pages/chat/* modules and refresh until GitHub reports a clean merge result.
  • Attach redacted browser/gateway proof or a linked artifact showing stale-run recovery, history reload, and queued follow-up flush.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No redacted after-fix Control UI browser/gateway proof is attached for the missed-terminal recovery, history reload, and queued follow-up flush path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A supported web UI chat proof run would materially show the stale-run recovery and queued-message flush that unit tests cannot fully demonstrate. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify the Control UI web chat missed-terminal recovery path on PR 90618 and return redacted proof showing the stale run clears, chat history reloads, and a queued follow-up message flushes without a transient error banner.

Risk before merge

  • [P1] No redacted after-fix Control UI browser/gateway proof is attached for missed-terminal recovery, history reload, and queued follow-up flush; tests and CI remain supplemental only.
  • [P1] The branch is dirty and targets the retired ui/src/ui/* chat modules, so maintainers likely need a current-main reimplementation in ui/src/pages/chat/* before merge.
  • [P1] The watchdog clears local run state and flushes queued messages based on agent.wait; an incorrect terminal/active decision could either send queued messages too early or leave them blocked.

Maintainer options:

  1. Refresh, reimplement, and prove the watchdog (recommended)
    Port the watchdog to the current chat modules and capture redacted browser/gateway proof before considering merge.
  2. Accept the recovery risk
    Maintainers can explicitly waive proof and own the timer-driven session/message-delivery behavior if they are comfortable with the source and test coverage.
  3. Pause the replacement branch
    If the stale branch and proof effort are not worth pursuing, pause or close this PR and leave the canonical issue for a cleaner current-main fix.

Next step before merge

  • [P2] Human handling is needed because the remaining blockers are current-main reimplementation, dirty merge state, and real behavior proof or explicit proof override rather than a narrow code finding.

Maintainer decision needed

  • Question: Should maintainers reimplement and prove this watchdog on the current split Control UI chat path, waive proof, or pause the replacement PR while keeping issue [Bug]: Control UI chat can stay stuck busy and stop flushing queued messages after a long run #42213 open?
  • Rationale: Automation cannot safely settle the remaining choice because the current branch is stale/dirty and the proof gate needs either real browser/gateway evidence or an explicit maintainer waiver.
  • Likely owner: Huang Wanjia — They introduced the current split chat modules where this old-path watchdog now needs to be reimplemented or reviewed.
  • Options:
    • Reimplement and prove current-main watchdog (recommended): Port the recovery to ui/src/pages/chat/*, refresh the PR to a clean merge result, and attach redacted proof showing stale-run recovery, history reload, and queued-message flush.
    • Waive proof explicitly: A maintainer may accept the timer-driven session/message-delivery risk by applying an explicit proof override after reviewing the source and tests.
    • Pause this replacement: Close or pause this stale branch if maintainers prefer a different fix path while keeping the canonical issue open.

Security
Cleared: The diff is limited to Control UI runtime/tests and does not change dependencies, workflows, package metadata, secrets handling, install scripts, or other supply-chain surfaces.

Review details

Best possible solution:

Reimplement the same recovery in the current split chat modules, refresh the branch until GitHub has a clean merge result, and attach redacted Control UI browser/gateway proof or record an explicit proof override.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main still treats non-null chatRunId as busy and blocks flushChatQueue, and no main text-chat watchdog was found; no live browser/gateway reproduction was run in this read-only pass.

Is this the best way to solve the issue?

The agent.wait watchdog is a reasonable bounded direction, but this stale old-path branch is no longer the best merge vehicle until it is ported to current main and proven with real Control UI behavior evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5733fb0e193e.

Label changes

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No redacted after-fix Control UI browser/gateway proof is attached for the missed-terminal recovery, history reload, and queued follow-up flush path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove status: 🛠️ actively grinding: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a bounded Control UI reliability fix for queued chat messages blocked behind stale local run state, not a core runtime outage or first-run blocker.
  • merge-risk: 🚨 session-state: The PR changes timer-driven clearing and reconciliation of local chat run state after missed terminal events.
  • merge-risk: 🚨 message-delivery: The watchdog can flush queued chat after a recovery probe, so incorrect recovery affects message delivery timing.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No redacted after-fix Control UI browser/gateway proof is attached for the missed-terminal recovery, history reload, and queued follow-up flush path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +199, Tests +338. Total +537 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 203 4 +199
Tests 5 338 0 +338
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 541 4 +537

Acceptance criteria:

  • [P1] Redacted Control UI browser/gateway proof showing a missed terminal event leaves a stale run, the watchdog recovers it, history reloads, and a queued follow-up flushes.
  • [P1] Exact-head PR review after the branch is ported to ui/src/pages/chat/* and GitHub reports a clean merge result.
  • [P1] Focused tests for stale-run recovery, still-active wait results, transient wait failures, and queued-message flush in the current split chat modules.

What I checked:

Likely related people:

  • Huang Wanjia: Authored 8f2986290d0043194769493b1d5f46e2acf10c78, which created the current ui/src/pages/chat/* split modules and owns the lines that still gate queue flushing on chatRunId. (role: current split-module introducer; confidence: high; commits: 8f2986290d00; files: ui/src/pages/chat/chat-send.ts, ui/src/pages/chat/chat-state.ts, ui/src/pages/chat/run-lifecycle.ts)
  • siewcapital: Opened the original closed source PR and authored the carried watchdog recovery approach preserved in this ClawSweeper replacement branch. (role: source fix contributor; confidence: high; commits: 868cefd411f1; files: ui/src/ui/app-chat.ts, ui/src/ui/app-gateway.ts, ui/src/ui/app-lifecycle.ts)
  • Vincent Koc: Recently touched the split chat modules in 6418e196b123d94fccb35a1a4d21001e3a084524 and tagged the checked v2026.6.11 release used for shipped-behavior comparison. (role: recent area contributor; confidence: medium; commits: 6418e196b123, e085fa1a3ffd; files: ui/src/pages/chat/chat-send.ts, ui/src/pages/chat/run-lifecycle.ts)
  • Peter Steinberger: Authored recent adjacent chat UI work and prior gateway agent.wait dedupe work that is relevant to the watchdog's dependency on wait semantics. (role: adjacent contributor; confidence: medium; commits: e66b470ea531, c8898034f975; files: ui/src/pages/chat/chat-state.ts, src/gateway/server-methods/agent-wait-dedupe.ts)
  • Val Alexander: Authored earlier dashboard-v2 chat infrastructure and view refactors that shaped the Control UI chat surface touched by the old-path PR. (role: UI feature-history contributor; confidence: medium; commits: c5ea6134d041, f76a3c5225bb; files: ui/src/ui/app-chat.ts, ui/src/ui/app-gateway.ts, ui/src/ui/app-lifecycle.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-06-28T13:10:31.216Z sha 3717269 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. stale Marked as stale due to inactivity labels Jun 6, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof.

Reviewed head: ae868b7b18dfbd5e6a2422c8005501b57c52e15a
Proof status: missing
Updated: 2026-06-19T11:39:43.393Z

Maintainer decision needed:

  • capture real behavior proof for this head
  • apply proof: override if the proof requirement should be waived
  • pause or close the replacement if proof should not be pursued

Possible manual Mantis/desktop proof suggestion:

@openclaw-mantis visual task: verify Control UI recovers a chat run that misses its terminal event, reloads history, and flushes a queued follow-up without a transient error banner.

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 14, 2026
@clawsweeper
clawsweeper Bot force-pushed the clawsweeper/gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo branch from 813c952 to 3717269 Compare June 20, 2026 15:23
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 20, 2026
@blacksmith-sh

blacksmith-sh Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Blacksmith runners detected OOM events on the following jobs:

Job Details
checks-node-agentic-control-plane-auth-node View Job

@clawsweeper clawsweeper Bot added status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 21, 2026
@clawsweeper

clawsweeper Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof.

Reviewed head: 3717269c4e00b1ad8b900521e8c6e691b066ebbc
Proof status: missing
Updated: 2026-07-01T11:06:11.360Z

Maintainer decision needed:

  • capture real behavior proof for this head
  • apply proof: override if the proof requirement should be waived
  • pause or close the replacement if proof should not be pursued

Possible manual Mantis/desktop proof suggestion:

@openclaw-mantis visual task: verify Control UI recovers a chat run that misses its terminal event, reloads history, and flushes a queued follow-up without a transient error banner.

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 21, 2026
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 25, 2026
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jul 6, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 21, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

@shakkernerd
shakkernerd deleted the clawsweeper/gitcrawl-1599-fix-register-abortcontroller-for-agent-rpc-runs-so-chat-abort-wo branch October 19, 2026 23:33
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 clawsweeper Tracked by ClawSweeper automation merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI chat can stay stuck busy and stop flushing queued messages after a long run

1 participant