Skip to content

fix(ui): queued messages stay blocked after a conversation finishes - #152299

Merged
steipete merged 1 commit into
mainfrom
codex/fix-stuck-chat-queue
Sep 19, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-stuck-chat-queue

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes completed Control UI conversations staying marked as working and leaving follow-up messages queued.

User Impact

Completed conversations return to idle, and queued input resumes when the Gateway confirms the same run has finished. Newer runs, changed sessions, and replacement delivery attempts keep their existing ownership checks.

Why This Change Was Made

Input consumption can remove an attachment-backed outbox row while terminal handling is still reading its saved payload. That disappearance was treated as stale delivery and discarded the completion event. Distinguish a retired row from a replacement attempt so completion still applies.

Queue recovery also reconciles an exact completed-run history result through the existing lifecycle owner and clears pending command entries for that run. The attachment regression group moves into a sibling test file to preserve the existing file-size limit.

Evidence

  • 410 focused chat-send and run-lifecycle tests pass on this head. New regressions fail on the original behavior, cover consumption before and after the attachment read, and preserve newer-run/session cases.
  • Core test and UI typechecks, changed-file lint, formatting, repository guards, and unused-export scans pass. Independent review has no actionable P0–P2 findings.
  • Real Control UI with a mocked Gateway: the original recovery path sends zero messages and remains busy; the fixed path sends the queued input exactly once and returns to idle. No browser errors. The captures use synthetic data and prove recovery; the attachment race is covered separately through the event and IndexedDB tests.

Before

Completed conversation remains busy with queued input

After

Queued input delivered once and conversation idle

@clawsweeper

clawsweeper Bot commented Sep 19, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 19, 2026
@steipete
steipete marked this pull request as ready for review September 19, 2026 00:27
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 8:33 PM ET / September 19, 2026, 00:33 UTC.

ClawSweeper review

What this changes

The PR preserves chat completion during attachment cleanup and resumes queued messages when Gateway history confirms that the same conversation run has finished.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main retains both failure paths, and no introduced correctness defect was found. The inspected before/after captures support the visible recovery behavior.

Priority: P1
Reviewed head: 502f478303d4c00a75fbc4100c76944a996a5308

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level fix with relevant visual proof and regression coverage; no blocking finding was identified.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
Evidence reviewed 7 items Pinned patch ownership: Reviewed the merge-base-to-head changes, including the complete test extraction. The host-verified test merge changes the same seven files; unrelated base-branch changes are excluded from this verdict.
Completion survives consumed attachment retirement: The retirement owner retains its connection and credential checks, treats a removed row as retired, and still rejects a replacement row. The event dispatcher applies completion only after this owner settles and its connection scope remains current.
Scoped recovery through the existing lifecycle owner: Recovery requires unchanged run identity, lifecycle generation, physical session identity, and visible conversation scope, plus inactive Gateway state. It then invokes the existing lifecycle reconciler and clears only pending entries associated with that run.
Findings None None.
Security None None.

How this fits together

The Control UI holds queued messages in a browser outbox and reconciles them with Gateway history and completion events. Its run-lifecycle owner controls the busy indicator and whether queued input can proceed.

flowchart TD
  A[Queued messages] --> B[Browser outbox]
  C[Gateway history] --> D[Check session and run]
  E[Completion event] --> F[Attachment retirement]
  F --> G[Run lifecycle]
  D --> G
  G --> H[Idle conversation and resumed queue]
  B --> D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +175, Docs +4. Total +204 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 30 5 +25
Tests 4 446 271 +175
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 480 276 +204

Review metrics

Metric Value Why it matters
Production versus test growth production +25 net lines; tests and test support +175 net lines Production growth adds bounded recovery checks; most added test surface preserves moved cases and exercises the two timing failures.

Technical review

Best possible solution:

Keep completion and queue recovery under the existing lifecycle owner while preserving delivery identity, credential scope, and newer-session guards.

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

Yes, source establishes both triggers: consumption removes an attachment row during terminal hydration, or recovery reads completed history while the local run remains busy. Focused regression scenarios cover both; this review did not execute them.

Is this the best way to solve the issue?

Yes. The patch repairs the existing retirement decision and reuses the lifecycle reconciler without adding another state owner, configuration option, or persisted format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e354fd65a508.

Labels

Label changes:

  • add P1: A completed Control UI conversation can remain busy and prevent subsequent queued messages from being delivered.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
  • 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 captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.

Label justifications:

  • P1: A completed Control UI conversation can remain busy and prevent subsequent queued messages from being delivered.
  • 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 captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after captures from the real Control UI with a mocked Gateway show the history-recovery path moving from a busy conversation with queued input to a visible follow-up and idle composer. Attachment-consumption timing is covered separately by event/storage regression tests; no live-provider claim is made.

Evidence

What I checked:

  • Pinned patch ownership: Reviewed the merge-base-to-head changes, including the complete test extraction. The host-verified test merge changes the same seven files; unrelated base-branch changes are excluded from this verdict. (502f478303d4)
  • Completion survives consumed attachment retirement: The retirement owner retains its connection and credential checks, treats a removed row as retired, and still rejects a replacement row. The event dispatcher applies completion only after this owner settles and its connection scope remains current. (ui/src/pages/chat/chat-send-support.ts:183, 502f478303d4)
  • Scoped recovery through the existing lifecycle owner: Recovery requires unchanged run identity, lifecycle generation, physical session identity, and visible conversation scope, plus inactive Gateway state. It then invokes the existing lifecycle reconciler and clears only pending entries associated with that run. (ui/src/pages/chat/chat-outbox-receipts.ts:276, 502f478303d4)
  • Current-main necessity: Fetched main still returns stale when consumption removes an attachment row without retained display data, and its queue-history reader lacks the added lifecycle reconciliation. No merged replacement was established. Inspection of the supplied release's historical source failed because the required blob could not be retrieved, so no release-fix claim is made. (ui/src/pages/chat/chat-send-support.ts:186, e354fd65a508)
  • Regression coverage: Read the five history-recovery scenarios and seven attachment-retirement scenarios, including consumption before and after payload reading, changed credentials, replacement attempts, and newer runs. Existing attachment cases were moved rather than discarded. The PR reports 410 passing focused tests; this read-only review did not execute them. (ui/src/pages/chat/chat-send-attachment-retirement.test.ts:79, 502f478303d4)
  • Inspected visual proof: Both prepared PR-body images rendered locally. Before shows a completed answer with a busy indicator and queued follow-up; after shows that follow-up and its response with an idle composer. The captured body identifies a real Control UI with a mocked Gateway and reports exactly one send. The images establish visible recovery, not the attachment timing race or independent network-count verification. (502f478303d4)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

@steipete
steipete merged commit 2100b35 into main Sep 19, 2026
214 checks passed
@steipete
steipete deleted the codex/fix-stuck-chat-queue branch September 19, 2026 01:02
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 19, 2026
* commit '912b21b98581c0be3baad87fe3686b64d69fffeb': (191 commits)
  perf(process): reduce allocation while processing command output (#152261)
  fix(ui): collapse duplicate previews when a page opens in multiple tabs (#152281)
  fix(test): run local Gateway tests behind protected exec egress (#152318)
  fix(node-host): avoid blocking configuration reads (#151411)
  fix(qa-lab): prevent Evidence Archive filters from overflowing (#152123)
  test: stabilize Docker scheduler signal fixtures on macOS (#152301)
  fix(ui): close stuck submenus when moving between menu rows (#152317)
  fix(ui): preserve question drafts and pending submissions (#152096)
  fix(release): recognize 7.34 fs-safe contract (#152326)
  chore: retire CLAUDE.md files
  fix(ui): release queued input after completed chat runs (#152299)
  improve(tooling): reduce commit formatting resource use (#152297)
  feat: show mentioned sessions in Involving me (#152083)
  perf(tasks): reuse prepared audit summaries (#152294)
  fix(daemon): preserve LaunchAgent rollback bytes and modes (#152195)
  fix: stop chat layout changes from loading extra history (#151726)
  perf(gateway): streamline config reload comparison (#152279)
  fix(xai): reject invalid UTF-8 OAuth responses (#111737)
  fix(release): accept waived advisory performance evidence for stable publication (#152290)
  fix: deliver watcher results while other sessions are busy (#152287)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. 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: L 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