Repository navigation
fix(media): show retained generated images after delivery is blocked - #184640
sunlit-deng wants to merge 1 commit into
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds displayable managed image blocks to generated-media completion messages retained after delivery is blocked. Example: Generation produces generated.png, but completion delivery is blocked.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main image-retention bug, and no introduced correctness or security blockers were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe background media completion owner receives generated attachments and delivery outcomes, persists retained results through the session transcript owner, and exposes images through existing Gateway history and managed-media download APIs. flowchart LR
A[Image generation] --> B[Completion delivery]
B --> C[Blocked completion retention]
C --> D[Managed media owner]
C --> E[Session transcript]
E --> F[Gateway history]
F --> G[Authorized image download]
D --> G
Technical reviewBest possible solution: Retain image display blocks through the existing completion, transcript, and managed-media owners while preserving original-session binding and idempotency. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that blocked retention records media references without image display blocks; the contributor also supplies a failing baseline trace, which was inspected but not rerun during this read-only review. Is this the best way to solve the issue? The repair addresses the producer-side omission using established managed-media APIs, preserves valid images when another preparation fails, and reconciles ownership without duplicating the retained message. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ed141d019864. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +102, Tests +488. Total +590 across 5 files. Added test files: 2. View PR surface stats
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 (3 earlier review cycles)
Reviewed October 26, 2026, 9:18 PM ET / October 27, 2026, 01:18 UTC (Revision 4). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
fb44a16 to
16d6f1d
Compare
16d6f1d to
517b8fd
Compare
What Problem This Solves
Fixes generated images from blocked completion deliveries appearing only as filenames after users reopen the original session.
Fixes #184585
Why This Change Was Made
Blocked completions prepare images independently, so an invalid image does not discard valid ones. If media ownership attachment fails after the transcript commit, a retry reconciles ownership without adding another completion message.
User Impact
Users can reopen the original session and download generated images after completion delivery fails.
Evidence
Validated on exact head
517b8fd84a202fce943b1f840851431ba092fcfeafter rebasing ontoef5d3dcefec4c343a8429f5e9decf7356d9d65bc. The deterministic local PNG provider fixture used no external provider credentials; I reran the production-path proof on this final head.OPENCLAW_MEDIA_RETENTION_PROOF=1 node --import ./scripts/tsx.mjs test/proofs/media-retention-live-proof.mtsexercised theimage_generatetool, delivery wake and queue admission, blocked-completion persistence, WSSchat.history, and authenticated HTTPS artifact download. Changing the session-store path after generation makes production queue admission dead-letter delivery.a3805cb6a2f413fbe17ac4470b20e1edf1c53483had zero image blocks; rerunning the same command on exact head517b8fd84a202fce943b1f840851431ba092fcfeproduced one. The head download returned HTTP 200 with 68 matching PNG bytes. A reader withoutoperator.readis denied; the e2e test also verifies the revoked ticket returns 404 before file I/O.src/agents/tools/media-generate-background-completion.ts, preserving main's queue/runtime imports with the PR's transcript and managed-media imports. The exact-head conflict receipt passed; focused tests passed 2 files and 30 tests.createManagedOutgoingMediaBlocksandattachManagedOutgoingMediaToMessage.Tested head SHA:
517b8fd84a202fce943b1f840851431ba092fcfe.AI-assisted: built with Codex