Repository navigation
fix(ui): edit queued messages in place - #124298
Patrick-Erichsen merged 33 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 12:50 PM ET / 16:50 UTC. ClawSweeper reviewWhat this changesThis PR replaces composer-based queued-message editing with an inline row editor that preserves the separate composer draft and coordinates replacement, delivery, and cross-pane actions. Merge readinessKeep open for maintainer product review and current-main reconciliation. The current head addresses the prior peer-reorder blocker with a tested conflict result; no new line-level correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherControl UI keeps queued follow-up messages in a browser outbox before Gateway delivery. This change makes a queued row hold its own editable draft while preserving queue position, attachments, reply context, and delivery ordering. flowchart LR
Operator[Control UI operator] --> Queue[Queued message row]
Queue --> Edit[Row-local edit draft]
Edit --> Guard{Source still current?}
Guard -->|Yes| Replace[Durable row replacement]
Guard -->|No| Keep[Keep original row and draft]
Replace --> Outbox[Queued outbox]
Outbox --> Gateway[Gateway delivery]
Decision needed
Why: The PR changes the established editing interaction and adds cross-pane delivery coordination; source shows a coherent implementation, but the intended permanent operator workflow requires maintainer ownership. Before merge
Agent review detailsSecurityNone. PR surfaceSource +241, Tests +320, Docs 0. Total +561 across 20 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one row-local draft token with durable compare-and-set replacement, reconcile it to current main, and ship it only if maintainers confirm that independent composer and row editing is the intended Control UI workflow. Do we have a high-confidence way to reproduce the issue? A source-backed baseline exists: the earlier queued-edit feature moved the row into the composer, and the PR E2E covers a separate composer draft plus the inline replacement path. A current-main run could not be established because required promisor blobs were unavailable in this checkout. Is this the best way to solve the issue? Unclear: row-local ownership is the cleanest implementation boundary for independent drafts, but whether to replace the established composer-edit workflow is a maintainer product decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b83447756582. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (41 earlier review cycles; latest 8 shown)
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
597e820 to
bbfe110
Compare
This reverts commit d7278ad9082fae40e28e6b98ca5a74e855817e6c.
|
@clawsweeper re-review: the rebased literal head ddba14d is conflict-free. The PR body now contains a body-only exact-head transcript of the real Gateway/UI run, inline stop fence, split-pane peer conflict, build, health/ready probes, and 404-test rerun. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review: actionable P2 fixed and pushed at exact head 29cf683. The PR body now has the fresh exact-head real Gateway/UI transcript plus 405-test rerun and route-away/removal regression. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review: final version-aware stale-edit fix is pushed at exact head fb65100. The PR body now includes the final exact-head real Gateway/UI transcript and 406-test validation; no proof files were committed. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review: P1 visible-error invalidation is fixed and pushed to the PR actual head branch at exact head d67e453. The PR body now contains the rebuilt exact-head live Gateway/UI transcript: footer @d67e453, live queue row, inline /stop rejection alert, and 407 focused tests; no proof files were committed. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved at exact head 4f971d9682202d4e5338d31309da182e197e012a.
The peer-crossing reorder blocker found during review is fixed: crossings over another pane's active edit now produce a visible conflict, while peer-visible and owner-pane indices are translated into the legal movable segment. The row-local editor is the operator-selected interaction for this batch. #124915 overlaps composer ownership but does not implement or supersede this queued-row editing behavior.
Proof is clean: 25 focused tests plus the full changed gate passed in Crabbox; exact-head CI completed successfully; fresh autoreview found no actionable issue at 0.99 confidence; independent final verification passed tree 771f4a99283d70b816bbf6bddd6347fc69165016; ClawSweeper reported no actionable finding; and zero review threads remain unresolved. Repository-native prepare-run also passed and verified the remote tree.
|
Merged via squash.
|
What Problem This Solves
Editing a queued message currently borrows the main chat composer. That couples two unrelated drafts: the queued edit can replace the operator's current composer content, and the edit is blocked entirely when the operator is already composing another message.
Issue: #121667
Why This Change Was Made
The queued row now becomes its own textarea while it is being edited. Its draft lives in row-local edit state, so the main composer remains untouched.
This direction was given after discussing the interaction with OpenClaw maintainers in the maintainer Discord thread.
replyToIdthrough submission and does not inherit the active composer's reply target.User Impact
Evidence
Base:
acbbff19bad0a5539cd4725e6a6c8ae8e53f6694(origin/mainat validation time)Head:
ca3f1004d7389e3e0fe82c2804501562c890a6f4Focused validation:
queued-message-edit.test.tsandchat-composer-queue.test.ts: 30/30 passed, including same-payload concurrent row/composer sends and queued-reply routing isolation.chat-send.test.tsandchat-send-submit.test.ts: 303/303 passed.chat-flow.queue-edit.e2e.test.ts: 4/4 passed in the mocked-Gateway browser harness, including a normal composer send while a row edit remains open.pnpm tsgo:ui: passed.oxfmt --checkandgit diff --check: passed.Browser behavior proof:
Base: with
a separate composer draftalready present, editing the queued row is blocked by the old composer-busy restriction.Head: the dedicated recording visibly holds the middle queued row as an inline textarea; submitting replaces that row in place, and the separate composer draft remains unchanged.
The recording was run at the exact PR head
ca3f1004d7389e3e0fe82c2804501562c890a6f4and passed 1/1.Pre-PR / base
acbbff19bad0a5539cd4725e6a6c8ae8e53f6694: old composer-busy behavior[email protected]
Post-PR / head
ca3f1004d7389e3e0fe82c2804501562c890a6f4: exact-head inline row editor, submit, and preserved composer draft[email protected]
Browser: Playwright Chromium 1234 / Chrome for Testing 151.0.7922.34. This is mocked-Gateway UI behavior proof, not live production Gateway proof.
Limitations
The browser proof uses the repository's mocked Gateway harness and an installed Chromium executable. It does not claim validation against a live production Gateway or every browser engine. The queued-reply routing fix is covered by focused unit tests; the recording does not visually expose transcript reply metadata.
AI-assisted contribution; reviewed and behavior-tested locally.
Codex follow-up (2026-08-16)
Codex follow-up (2026-08-16, exact head f43971b900c95a6b86dd22ebe1732f6e4b26f501)
pnpm exec vitest run ui/src/pages/chat/chat-composer-queue.test.ts --pool=forks --maxWorkers=1— 15 tests passed; targeted oxlint, oxfmt, andgit diff --checkpassed.Exact-head real-Gateway attempt (2026-08-16, f43971b900c95a6b86dd22ebe1732f6e4b26f501)
pnpm ui:buildand connected the Control UI to an isolated real Gateway over WebSocket at a disposable loopback port; the UI accepted the Gateway URL change.proof-a/proof-bRPC sends withstatus:"started"; the correct isolated per-agent database contained bothsession_windowsandtranscript_events(4 events).Codex follow-up (2026-08-16, exact head ca4940b62e921a31421a44e89851de7463eba3e1)
pnpm exec vitest run ui/src/pages/chat/chat-composer-queue.test.ts ui/src/pages/chat/queued-message-edit.test.ts --pool=forks --maxWorkers=1— 2 files, 31 tests passed. Targeted UI lint, formatting, andgit diff --checkpassed.2026.8.1-ca4940b62e92-2026-08-16T16-39-02.908Z.Codex follow-up (2026-08-16, exact head d130a05ae42)
chat-send.test.ts,chat-composer-queue.test.ts, andqueued-message-edit.test.ts; targeted oxlint, oxfmt, andgit diff --checkpassed.ca4940bis being reused for this head.Exact-head real proof refresh (d130a05ae42cf9a260c71daf0fc0a8b46fb0a8b1)
pnpm ui:build.127.0.0.1:62983; real/healthzreturned{"ok":true,"status":"live"}, and the Gateway was stopped after the attempt./tmp/pr124298-exact-proof-FgJZyJ(ui-build.log,healthz-final.json,gateway.log, andbrowser-limitation.txt).Codex follow-up (2026-08-16, exact head 50ecf10fe3da72c429e731cb35af51c5e3bc0839)
git diff --checkpass.pnpm ui:buildand ran the built Gateway in isolated state. Exact-head/healthzreturned{"ok":true,"status":"live"}; the built Control UI root returned HTTP 200.Codex follow-up (2026-08-16, exact head 76088d0d693)
/stopor local slash-command dispatch. The original queued row remains owned by the edit and the UI shows discard-and-retype guidance; the command is not executed./stopand/compact, asserting the source row remains queued, the edit remains active, no chat.send occurs, and the visible error explains the composer path.The earlier fresh review finding was actionable and is now fixed on the pushed head. Exact-head real Control UI interaction proof (row edit, command-like rejection, cancel, submit, and preserved composer draft) remains to be rerun because the terminal/browser attempt did not complete the browser interaction lane; no mocked proof is claimed as live.
Codex follow-up: exact-head real behavior proof (2026-08-16, 76088d0d6932d7933c89027cfe8eae8c7cf46b85)
76088d0d693with the bundled Control UI, a real isolated Gateway, and a headed Chromium browser./healthand/readyzchecks passed; the Control UI build reported2026.8.1-76088d0d6932./stopwas rejected withQueued-row edits cannot run slash commands. Cancel this edit and send the command from the composer.; the source queued row remained and nochat.sendwas dispatched.composer draft must survive)./tmp/openclaw-pr124298-artifacts/summary-clean.json,01-stop-rejection.png,02-cancel-restores-source.png,03-submit-preserves-composer.png,gateway-focused.log, andgateway-live.log.Codex follow-up: peer-removal fence and inspectable proof (2026-08-16, 9ba838a18a9)
ui/src/pages/chat/queued-message-edit.test.tsand recorded the exact-head live verification in proof/pr-124298-real-proof.md.9ba838a18a9: focused queue-edit/state suite — 2 files, 73 tests passed; targeted lint, formatting, andgit diff --checkpassed.4879eab1d9d: slash-command rejection, cancel, submit, composer-draft preservation, and split-pane shared-row ownership were observed. Gateway health/readiness passed./tmp/openclaw-pr124298-rerun/artifacts/; the reviewable transcript is tracked in the branch.Codex follow-up: inspectable peer-removal proof record (2026-08-16, current head 9ba838a18a9)
4879eab1d9d; no production or test files changed after the exact-head live run./tmp/openclaw-pr124298-rerun/artifacts/.Codex follow-up: inspectable proof at final tip (2026-08-16,
f806b10c253e98f39677f0daa80b91abffd2c37e)4879eab1d9de.Codex follow-up: late P1 reorder finding fixed (2026-08-16,
5cb3e9c68d6fba41b1c12865c6d439a406182e36)orderKeyso a stale edit cannot restore an old position.pnpm exec vitest run ui/src/pages/chat/queued-message-edit.test.ts ui/src/pages/chat/chat-queue-reorder.test.ts ui/src/pages/chat/chat-state.test.ts --pool=forks --maxWorkers=1— 3 files, 83 tests passed;oxfmt --check, targetedoxlint, andgit diff --checkpassed.Current pushed tip after the reorder fence:
5cb3e9c68d6fba41b1c12865c6d439a406182e36; please evaluate the late P1 fix and the exact-head 83-test rerun above.Codex follow-up (2026-08-16, exact head 6065583039ae0c3121c4da52f685d84cf354cad5)
resumeQueuedMessageEditId, covering the durable replacement failure boundary.oxfmt,oxlint, andgit diff --checkpassed..artifacts/pr124298-final3.PPJTvEdirectory only; no PR-specific media is committed.Codex follow-up: exact-head real behavior proof (2026-08-16, 6065583039ae0c3121c4da52f685d84cf354cad5)
Codex follow-up: inspectable exact-head real behavior proof (2026-08-16, exact head 1dcaa7fc02c)
Codex follow-up: exact-head real behavior proof (2026-08-16, exact head
f42ce469bbd06db17d85cea95716bc0be0281229)f42ce469bbd06db17d85cea95716bc0be0281229checkout withpnpm ui:build; focused queue/send validation at that exact head passed: 3 files, 354 tests.GET /healthreturned{"ok":true,"status":"live"}.queue row beta->queue row beta edited) while preservingcomposer draft must survive; a second live edit was cancelled with Escape and restored the original row, leaving zero editing rows..playwright-cli/page-2026-08-16T21-45-55-722Z.png,.playwright-cli/page-2026-08-16T21-46-32-963Z.png, and the isolated Gateway state/log directory/tmp/openclaw-pr124298-real-f42-state. The local model endpoint is test harness infrastructure only; no mocked Gateway behavior is claimed as live proof.Codex follow-up: exact-head natural-stop proof (2026-08-16, head
baf30a2a85c8a7cd402a0ec23992ecdaaee24aff)isChatStopCommandaliases (including plainstop,esc,abort,wait, andexit) in the same inline-edit guard as parsed slash commands. The guard runs before any abort request.oxfmt,oxlint, andgit diff --checkpassed.git rev-parse HEADreturnedbaf30a2a85c8a7cd402a0ec23992ecdaaee24aff; liveGET /healthreturned{"ok":true,"status":"live"}; the bundled UI footer identified@baf30a2.stopand submitting left the row queued, kept the inline editor open, showedQueued-row edits cannot run commands or stop aliases..., and dispatched no abort request. Screenshot retained at.playwright-cli/pr124298-baf-stop-rejected.png; the local model endpoint is test harness infrastructure only.Codex follow-up: exact-head peer-conflict and live refresh (2026-08-16, head
630b27587af72199b07250322e1268db1ed4f0e0)setChatErrorwith a dedicated steering conflict instead of silently returning. The two-pane regression now asserts the peer-visible conflict while retaining the source row and sending no request.git rev-parse HEADreturned630b27587af72199b07250322e1268db1ed4f0e0; liveGET /healthreturned{"ok":true,"status":"live"}; the UI footer identified@630b275.stop, showedQueued-row edits cannot run commands or stop aliases..., and dispatched no abort request. Screenshot retained at.playwright-cli/pr124298-630-stop-conflict.png. The local streaming model is test harness infrastructure only.Codex follow-up: exact-head draft revision fence (2026-08-16, head
3437f2d1915dc4e5494ad4e0cf31b1205fbb415b)revisionthat increments on every draft update. After awaited history loading, inline submission now rejects if the edit revision changed, preserving the newer draft instead of replacing the row with the stale captured text.git diff --checkpassed. The new regression changes the prior exact production-equivalent behavior only by exercising a draft mutation during the await.Codex follow-up: real behavior proof in PR body (source fix head 27dfe3138bd, cleanup head 0e864650d86)
The real behavior run was executed from the production source fix head 27dfe3138bd5119e9b429f48dbafc5d6d4cb7cf7. The later 0e864650d86 commit only removes temporary local proof artifacts; it does not change production or test code.
Runtime transcript
The bundled Control UI was opened at http://127.0.0.1:19892/chat/main; its footer identified codex/pr-12429…@27dfe31. A real Gateway WebSocket held an active run open through a local OpenAI-compatible streaming endpoint, and the browser produced genuine waiting queue rows through that live Gateway path.
Observed UI behavior
Exact-head validation for the source fix: 4 focused files, 411 tests passed; targeted oxfmt, oxlint, and git diff --check passed. No mocked Gateway behavior is claimed as live proof.
Codex follow-up: literal current-head real proof (0e864650d86)
Reran the real behavior lane from the literal pushed head 0e864650d862ba86fb3a10c8a677802cc6719fab. No proof files are committed.
The bundled Control UI footer identified codex/pr-12429…@0e86465. A real Gateway WebSocket plus a local OpenAI-compatible streaming endpoint held a live run open and produced a genuine waiting queue row.
Literal current-head validation: 4 focused files, 411 tests passed; targeted oxfmt, oxlint, and git diff --check passed. No mocked Gateway behavior is claimed as live proof.## Codex follow-up: rebased exact-head real behavior proof (2026-08-16,
ddba14d89fd6de50cac295b4ff9b6344df3c66b0)The branch was rebased onto current
origin/main(22ab8e3c2cc) to clear GitHub's merge conflict. No proof files are committed; this is the reviewable proof transcript in the PR body.The exact-head Gateway logged
OpenClaw 2026.8.1,agent model: proof/queued-proof,http server listening, andready. The Control UI footer identifiedcodex/pr-12429…@ddba14d.A real Gateway WebSocket connected the literal built UI to a local OpenAI-compatible streaming endpoint that held the active run open. The browser then created a genuine
Waiting for current runqueue row namedqueued row rebased current; this was not a mocked Gateway or a test-only queue fixture.stopand pressingSend messageleft the row queued and the editor open withstop; no replacement or abort was dispatched. The visible alert was:Queued-row edits cannot run commands or stop aliases. Cancel this edit and send the command from the composer.Edit queued messagein pane two displayed:A queued message is being edited in another pane. Finish or cancel that edit before removing it.The peer action did not silently no-op.Rebased exact-head validation: 4 focused files, 404 tests passed;
oxfmt --check, targetedoxlint, andgit diff --checkpassed. No mocked Gateway behavior is claimed as live proof.## Codex follow-up: stale-token fix and exact-head proof (2026-08-16,29cf6835ae387767d7bd773ca30a547a99655461)activeQueuedMessageEdit: when the pane returns and the edited source row was delivered or removed elsewhere, the stale token is cleared before render, so the next queued row can be edited normally.ui/src/pages/chat/queued-message-edit.test.ts.Exact-head validation:
The live Control UI footer identified
codex/pr-12429…@29cf683. A real Gateway WebSocket plus the local OpenAI-compatible streaming endpoint held the run open and produced a genuineWaiting for current runrow namedqueued row final head.stopand pressingSend messagekept the queued row and inline editor in place, dispatched no replacement or abort, and displayed:Queued-row edits cannot run commands or stop aliases. Cancel this edit and send the command from the composer.oxfmt --check, targetedoxlint, andgit diff --checkpassed.No proof files are committed; this is body-only proof and validation evidence.## Codex follow-up: final version-fence fix and exact-head proof (2026-08-16,
fb65100cb904e7546d4f95c0b770f10f0cfab724)sendRunId,sendAttempts,sendState, agent/session scope, andorderKey), not only row existence. A failed or otherwise changed row is no longer revived after route return.Final-head real behavior transcript:
The live Control UI footer identified
codex/pr-12429…@fb65100. A real Gateway WebSocket plus the local OpenAI-compatible streaming endpoint held the run open and produced a genuineWaiting for current runrow namedqueued row final literal head.stopand pressingSend messageleft the row queued and the inline editor open withstop; no replacement or abort was dispatched. The visible alert was:Queued-row edits cannot run commands or stop aliases. Cancel this edit and send the command from the composer.oxfmt --check, targetedoxlint, andgit diff --checkpassed.Exact-head live proof —
d67e453dc1f73f1d7929fbfce32f1ac86bcbc4f4git rev-parse HEAD:d67e453dc1f73f1d7929fbfce32f1ac86bcbc4f4.pnpm ui:build: passed in2.60s; verified818finalized Control UI sidecars.curl -fsS http://127.0.0.1:19892/healthreturned{"ok":true,"status":"live"}.codex/pr-12429…@d67e453*; the live session used modelqueued-proofand held an active run open over the real Gateway WebSocket.real d67 queued edit proof, created a genuinequeued wait d67row; the UI displayedWaiting for current run.Edit queued message, changed the draft to/stop, and clickedSend message.Queued-row edits cannot run commands or stop aliases. Cancel this edit and send the command from the composer.The queued row and inline editor remained visible, proving the rejected edit neither aborted/sent nor disappeared and that the new post-submit invalidation rendered immediately.407tests passed acrosschat-state,queued-message-edit,chat-send, andchat-composer; formatting, targeted lint, andgit diff --checkpassed.