Repository navigation
feat(chat): edit queued messages and get rejected sends back in the composer - #197908
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. |
|
Simulator before/after (iOS 27, isolated local Gateway, message queued while the Gateway is stopped). Before = main with #197846; after = this PR head |
|
Codex review: needs maintainer review before merge. What this changesAdds editing of queued messages and automatic restoration of provably rejected sends into the native chat composer. Example: Two queued messages are rejected because their session is archived.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides useful native-chat recovery through existing storage owners, with no blocking correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared Swift chat UI connects iOS and macOS composers to the durable SQLite outbox and draft store; Gateway history supplies delivery evidence before automatic recovery. flowchart TD
A[Native message menu] --> B[Chat view model]
C[Gateway history] --> B
B --> D[Existing cancellation transaction]
D --> E[SQLite outbox]
D --> F[SQLite composer draft]
F --> G[Visible composer]
Technical reviewBest possible solution: Land the shared transactional Edit and restore path while retaining existing delivery-uncertainty protections. Do we have a high-confidence way to reproduce the issue? Current-main source and the inspected before screenshot establish the missing Edit action; the contributor supplies after-change simulator evidence rather than a reviewer-executed reproduction. Is this the best way to solve the issue? The implementation keeps one durable owner, shares cancellation's canonical-proof transaction, and preserves ambiguous sends instead of introducing a competing queue or draft store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0e57ae4cb187. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +554, Tests +718, Docs +1. Total +1273 across 17 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 12, 2026, 4:18 PM ET / 21:18 UTC (Revision 2). |
|
End-to-end proof on
The session was unarchived afterwards and the simulator deleted. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…omposer (openclaw#197908) * feat(chat): edit queued messages and restore rejected sends to the composer * fix(chat): restore on draft bind and keep edit errors in their own chat








Related: #197846
What Problem This Solves
A message queued in native chat (iOS and macOS) can only be retried or deleted. To fix a typo you have to delete the message and retype it. When the Gateway rejects a send for good, the text sits in a red "Not sent" bubble instead of coming back to you.
User Impact
Why This Change Was Made
PR #197846 gave each chat a saved draft. Edit is one store operation that, in a single transaction, removes the outbox row and appends its text and attachments to that draft. It uses the same canonical-proof lock as cancel, so a row that chat history shows as delivered is removed as confirmed and the draft is not touched. Rows whose delivery is unknown (
delivery_unconfirmed, branch-parked) offer no Edit, and the store refuses them too.Auto-restore is an automatic Edit with stricter gates:
The gates are re-checked inside the draft write chain, right before the composer changes. A refusal (another view claimed the row, or the draft is full) is remembered for that failure, so it is not retried on every history load.
Accepted edges (named in code):
Evidence
Simulator (iOS 27, isolated local Gateway): pair, stop the Gateway, send a message (it queues), touch and hold it.
mainwith #197846Screenshots are in the PR comments, taken on this head (
a333ce50c09).Tests: every restore gate was disabled one at a time, and its test failed:
had_unacknowledged_sendEdit cases: a queued row, a failed row, a proven-delivered row (removed as confirmed, draft untouched), unconfirmed and branch-parked rows (no Edit), a session switch during the move (no error shown in the new chat), and attachments that keep their stored positions.
Suites: the OpenClawKit store and outbox suites pass. Full-run failures are limited to audio and TLS timing tests that also fail on the base and pass in isolation. iOS chat suites pass, except one audio render case that also fails on the base. The macOS app builds. i18n verify reports no changes.
Reviews: three second-model review rounds. All findings applied, including the final round's low items, after a simplify pass that shares the attachment SQL with the draft insert path and makes restore use the same Edit rule.
End to end, with an upgrade from v2026.11.3 (see the PR comment): messages queued on v2026.11.3, including one with a photo, survive the upgrade. Edit moves the text and the full photo into a draft that survives a kill and relaunch. A real Gateway rejection (archived session, three attempts) restores the first message into the empty composer. The second stays "Not sent" because the composer is no longer empty, and Edit then appends it below.