Repository navigation
fix(control-ui): edit failed messages before resending - #191871
Conversation
Co-authored-by: jacobtomlinson <[email protected]>
Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: cb434411-d880-4945-a2b1-51814a1aebb6
|
🦞👀 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. |
Synthetic Control UI recovery proofBefore: five images are rejected; Try again continues with the rejected images still in history. After editing: the original text and five removable images are restored to the composer. After removing one and resending: only the four retained images remain in the active conversation, including after reconnect. Actual production Control UI with synthetic Gateway I/O and synthetic courtyard images. Backend tests separately verify active model-context exclusion of the rejected branch. |
Co-authored-by: jacobtomlinson <[email protected]>
Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: ad894fda-026a-4a42-b2ac-b9bd28fc3abb
|
Codex review: needs maintainer review before merge. What this changesAdds an Edit message action that restores the latest failed input and its attachments through the existing rewind flow. Example: A message containing five courtyard images is rejected by a model accepting four.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR adds a useful recovery shortcut while preserving safe continuation behavior; no introduced correctness defect was found, but failing CI still needs classification. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI maps a failed run to its persisted user message, invokes permission-checked sessions.rewind, and restores the returned text and attachments to the composer. flowchart LR
A[Failed reply notice] --> B[Current failure and draft guards]
B --> C[Existing rewind confirmation]
C --> D[Permission checked sessions rewind]
D --> E[Inactive original branch]
D --> F[Restored composer]
F --> G[Edited message submission]
Technical reviewBest possible solution: Retain the focused shortcut through existing rewind and composer owners, with safe continuation kept separate. Do we have a high-confidence way to reproduce the issue? Current main has continuation and per-message rewind, but lacks the failed-reply edit shortcut; supplied screenshots demonstrate the requested recovery flow, without claiming a live provider reproduction. Is this the best way to solve the issue? The smallest complete implementation connects the failure notice to existing confirmed rewind, preserving current-run identity, unsent drafts, attachment restoration, and continuation semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d28078304a6c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +95, Tests +473, Docs +14. Total +582 across 13 files. Added test files: 2. View PR surface stats
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 Reviewed November 3, 2026, 7:22 AM ET / 12:22 UTC. |
Co-authored-by: jacobtomlinson <[email protected]>
Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 199d8e1-da6d-4b6a-9179-1de0267e2e0e
|
I did manage to work around this by modifying my serving setup to increase this limit, but I still think we might want to handle this failure mode better |
Keep cached failure facts and continuation eager. Delegate optional editing to the existing live reader, rewind, and confirmation owners. Consolidate its fixtures and allocate only measured regression growth. Co-authored-by: jacobtomlinson <[email protected]>
Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 0f438d23-c1ac-4100-8393-4e3ad1116ccd
Use canonical leaf value types and read-only fields rather than depending on the page host. Runtime JavaScript is unchanged after type erasure. Co-authored-by: jacobtomlinson <[email protected]>
Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 60200a2d-ad81-4cd3-b2eb-7f3855fa6ad3
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix(control-ui): edit failed messages before resending Co-authored-by: jacobtomlinson <[email protected]> * fix(control-ui): edit failed messages before resending Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: cb434411-d880-4945-a2b1-51814a1aebb6 * fix(control-ui): keep failed-message recovery lazy Co-authored-by: jacobtomlinson <[email protected]> * Publish openclaw/recover-failed-image-messages Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: ad894fda-026a-4a42-b2ac-b9bd28fc3abb * fix(control-ui): retain shared recovery translations Co-authored-by: jacobtomlinson <[email protected]> * Publish openclaw/recover-failed-image-messages Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 199d8e1-da6d-4b6a-9179-1de0267e2e0e * fix(control-ui): defer optional failed-message edit work Keep cached failure facts and continuation eager. Delegate optional editing to the existing live reader, rewind, and confirmation owners. Consolidate its fixtures and allocate only measured regression growth. Co-authored-by: jacobtomlinson <[email protected]> * Publish openclaw/recover-failed-image-messages Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 0f438d23-c1ac-4100-8393-4e3ad1116ccd * fix(control-ui): remove failed-edit typed host cycle Use canonical leaf value types and read-only fields rather than depending on the page host. Runtime JavaScript is unchanged after type erasure. Co-authored-by: jacobtomlinson <[email protected]> * Publish openclaw/recover-failed-image-messages Worked on by: - @jacobtomlinson Co-authored-by: jacobtomlinson <[email protected]> OpenClaw-Publication: 60200a2d-ad81-4cd3-b2eb-7f3855fa6ad3 --------- Co-authored-by: jacobtomlinson <[email protected]>



Co-authored with @jacobtomlinson, who reported the failed-image recovery problem.
Work sessions
What Problem This Solves
Fixes: a rejected image-heavy message cannot be corrected from the failure notice, and continuing leaves its original images in active model context.
User Impact
Users can choose Edit message on the latest failed turn, confirm the existing rewind, remove attachments in the composer, and resend. Image-only messages work too. An existing unsent draft is left untouched; editing is disabled until that draft is sent or cleared. Try again keeps its existing continuation behavior so completed tool actions are not replayed automatically.
Why This Change Was Made
Reuse the existing
sessions.rewindowner rather than add a provider-specific image cap or another history-editing path. Rewind removes the rejected tail from active context and clears its resume bindings while retaining the original as an inactive branch. Current-failure, canonical latest-user, imported-entry, and draft guards are checked again at the point of effect. Older failures cannot rewind newer user input. Rewinding does not undo external actions.Cached failure facts, details, and Try again remain eager. Only the optional new editor, its admission selector, and its copy load on demand. They consume live scope, reader, rewind, and confirmation operations from their existing owners; the shared RewindButton retains its original behavior. The new copy has one dedicated cold namespace, leaving shared recovery copy intact.
Evidence
openModelContextAsync → buildSessionContext → convertToLlmoutput after rewind and four-image resend. The original branch remains durable. Covers inline images and persisted media references; unchanged backend proof reused.git diff --check: passed. Exact merged-sourcelint:ui:i18nalso passed unchanged.1da6b8021bd64d2380e3430cad40fb0bd82f6b13, base5ead822527e350cecdf30cbe0f04b1f418fdb349. The old candidate reproduces 1,280,771 B chat-boot gzip, over the unchanged 1,280,674 B limit. The qualified runtime candidate measures 1,280,434 B — 337 B smaller, with 240 B headroom. Startup is 90,546 B; request counts stay 3 startup / 20 chat. No performance limits, checker logic, or recorded boot-module lists changed. Prior head5886d63subsequently passed hosted performance and i18n checks.config/test-lines-allocations/failed-image-message-recovery.txtallocates 504 lines, exactly the measured positive regression delta. Both working-tree and staged ratchets pass on the exact merge/base, with 24 lines slack. The shared test-line scalar is unchanged. This funds the required browser, canonical-context, and current-owner/draft regressions.bc3da5acc7f3; no duplicate review request was posted.Proof boundary: browser Gateway I/O and courtyard images are synthetic; the backend integration reconstructs real agent/model context. A live GLM/provider request is not claimed; isolated provider credentials were not imported.
Screenshots
Actual production Control UI with synthetic Gateway I/O; all captures were visually inspected. Final settled after captures are byte-identical to the embedded assets, so those images are reused without another upload.
Before: the rejected five-image turn offers continuation, but the attachments cannot be edited there.
After editing: the original text and five removable images are back in the composer.
After removing one and resending: only the four retained images remain in the active conversation, including after reconnect.
Worked on by