Repository navigation
fix: directly deliver completed media fallback - #84371
fuller-stack-dev wants to merge 7 commits into
Conversation
Treat transcript appends emitted during embedded prompt streaming as owned session writes so message-tool delivery mirrors do not trip the session takeover fence before the tool result and silent final reply can commit.
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level. Current main completes generated-media tasks before delivery confirmation and then reports failure when message-tool media evidence is missing; the PR body supplies live Discord proof for the repaired boundary. PR rating Rank-up moves:
What the crustacean ranks mean
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. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land one canonical generated-media completion implementation after maintainers accept the fallback policy and either obtain Telegram/equivalent transport proof or explicitly accept the Discord shared-path proof for this release. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main completes generated-media tasks before delivery confirmation and then reports failure when message-tool media evidence is missing; the PR body supplies live Discord proof for the repaired boundary. Is this the best way to solve the issue? Yes if maintainers accept the policy shift. The implementation belongs at the shared completion-delivery boundary and reuses existing sendMessage/mirror paths, but the final merge should settle Telegram proof expectations and the overlapping branch first. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a35c4645dc. |
|
ClawSweeper PR egg ✨ Hatched: 💎 rare Mossy Review Wisp Hatch commandComment Hatchability rules:
Rarity: 💎 rare. What is this egg doing here?
|
|
@openclaw-mantis telegram desktop proof Verify PR 84371 generated-media completion fallback on the current PR head. Need visible real-user Telegram proof that a generated media completion posts exactly one media attachment to the original chat after requester-agent/message-tool delivery misses or fails to attach the generated media. Also capture terminal/log evidence that the media task remains active through completion delivery and the session transcript/mirror path completes cleanly. Redact tokens and credentials. |
|
@clawsweeper re-review Real behavior proof has been added to the PR body for head fe92ef2, and the Real behavior proof check is now green. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper automerge |
|
ClawSweeper 🐠 automerge status This repair pass finished without changing the PR. ClawSweeper checked the branch and found no safe patch to push this time. Executor outcome: source PR #84371 is paused by clawsweeper:human-review; refusing to mutate the PR branch. Worker actions:
No push, rebase, replacement PR, merge, or ClawSweeper re-review happened on this pass. fish notes: model gpt-5.5, reasoning high. Automerge progress:
|
|
@clawsweeper stop |
|
Addressed the current review findings on head
Verification:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up after the CI lint failure: pushed head
Additional verification after the lint fix:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed the latest ClawSweeper P2 findings on head
Verification after these fixes:
@clawsweeper re-review |
|
@clawsweeper re-review Addressed the latest P2 findings on head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper merge |
|
@clawsweeper automerge |
I think we broke him 😔 |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper automerge |
|
@clawsweeper approve |
|
Thanks for pushing this through and for the detailed proof. We landed the canonical fix for this area in #84006, merged as 37a9f58. I rechecked this branch after #84006 merged. This PR now conflicts with current Closing this as superseded by #84006. If there is a specific remaining behavior gap after the merged fix, please open a fresh narrow PR against current |
Summary
upstream/main.Verification
pnpm test src/agents/subagent-announce-delivery.test.ts src/agents/tools/media-generate-background-shared.test.ts src/agents/tools/image-generate-tool.test.ts src/agents/tools/music-generate-tool.test.ts src/agents/tools/video-generate-tool.test.ts src/agents/tools/video-generate-background.test.ts src/agents/image-generation-task-status.test.ts src/agents/video-generation-task-status.test.ts src/agents/tools/music-generate-tool.status.test.ts src/agents/tools/video-generate-tool.status.test.ts src/agents/pi-embedded-runner/run/attempt.session-lock.test.tspnpm changed:lanes --json --base upstream/mainpnpm check:changed --base upstream/maingit diff --check upstream/main...HEADgit merge-tree HEAD upstream/mainReview follow-up verification
Current head
bd363a476fa4185247f558ff691d5f69ee2bef6baddresses the latest ClawSweeper findings from the durable review comment:image_generateaction:"status"reports every active image task instead of hiding concurrent image work behind a single task.docs/automation/tasks.md,docs/tools/media-overview.md,docs/tools/image-generation.md,docs/tools/music-generation.md, anddocs/tools/video-generation.mddocument the direct generated-media fallback.Current-head commands after those updates:
pnpm test src/agents/tools/image-generate-tool.test.ts src/agents/image-generation-task-status.test.ts-> 2 files, 46 tests passed.pnpm test src/agents/subagent-announce-delivery.test.ts src/agents/tools/media-generate-background-shared.test.ts src/agents/tools/video-generate-background.test.ts src/agents/tools/image-generate-background.test.ts src/agents/tools/music-generate-background.test.ts-> 5 files, 78 tests passed.pnpm test src/agents/subagent-announce-delivery.test.ts src/agents/tools/media-generate-background-shared.test.ts-> 2 files, 57 tests passed.pnpm lint --threads=8-> passed.pnpm format -- src/agents/media-generation-task-status-shared.ts src/agents/image-generation-task-status.ts src/agents/image-generation-task-status.test.ts src/agents/tools/image-generate-tool.actions.ts src/agents/tools/image-generate-tool.ts src/agents/tools/image-generate-tool.test.ts docs/automation/tasks.md docs/tools/media-overview.md-> passed.pnpm format:check -- src/agents/media-generation-task-status-shared.ts src/agents/image-generation-task-status.ts src/agents/image-generation-task-status.test.ts src/agents/tools/image-generate-tool.actions.ts src/agents/tools/image-generate-tool.ts src/agents/tools/image-generate-tool.test.ts docs/automation/tasks.md docs/tools/media-overview.md-> passed.pnpm format:check -- src/agents/image-generation-task-status.ts-> passed after the lint fix.git diff --check-> passed.pnpm changed:lanes --json --base upstream/main-> lanescore,coreTests,docs.pnpm check:changed --base upstream/main-> passed.AUTOREVIEW_AUTO_TESTS=0 AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION=1 .agents/skills/autoreview/scripts/autoreview --mode local-> clean; no accepted/actionable findings reported.Real behavior proof
Behavior addressed: Generated media completions keep the task/session delivery path active until completion delivery is confirmed. If active requester wake and requester-agent/message-tool delivery miss the generated media, the PR fallback posts one direct channel media message to the original chat. The follow-up commit also prevents duplicate image-generation task handling from collapsing distinct image prompts while preserving same-prompt duplicate guards.
Real environment tested: Live Discord transport proof was collected from this PR branch at
fe92ef21ce51888cba717edd999a4ef90772a28b(pnpm openclaw --helpreportedOpenClaw 2026.5.19 (fe92ef2)) against live Discord channel transport. Target channel is redacted asdiscord channel:...5762; the live fallback message id was1506455834782072842. After the review-follow-up updates, current headbd363a476fa4185247f558ff691d5f69ee2bef6bwas verified with the current-head tests/checks above. The follow-up commit did not change the direct Discord fallback transport boundary exercised by the live proof; it changed image duplicate-guard/status behavior and docs.Exact steps or command run after this patch: Live fallback proof used an inline
node --import tsx --input-type=moduleproof script from the PR checkout. The script resolved command-scoped Discord secrets for the configured channel, loaded the configured Discord plugin, calleddeliverSubagentAnnouncement(...)fromsrc/agents/subagent-announce-delivery.ts, forced active requester wake to returnqueued:falsewithsource_reply_delivery_mode_mismatch, forced the requester-agent handoff to return no message-tool/media delivery evidence, and let the PR fallback call the realsendMessage(...)transport. Then I fetched the exact Discord message by id withhandleDiscordAction({ action: "fetchMessage", guildId: "<redacted>", channelId: "...5762", messageId: "1506455834782072842" })and checked the active session mirror line withsed -n '19p' <state>/agents/main/sessions/6c7c13d6-d515-4cf4-ad90-ba2a84ef203f.jsonl | jq .... After the current-head follow-up patch, I reran the focused task/status/fallback tests, formatting checks,git diff --check,pnpm check:changed --base upstream/main, and autoreview listed in Review follow-up verification.Evidence after fix: Redacted console output from the live proof run:
Exact live Discord readback after the fallback send:
{ "ok": true, "message": { "id": "1506455834782072842", "content": "The generated image is ready.", "timestampUtc": "2026-05-20T00:37:39.608Z", "authorBot": true, "attachmentCount": 1, "attachment": { "filename": "PR84371-MEDIA-FALLBACK-fe92ef2-1779237455145.png", "size": 91, "width": 1, "height": 1, "content_type": "image/png" } } }Transcript mirror proof from the active Discord session after delivery:
{ "type": "message", "timestamp": "2026-05-20T00:37:39.973Z", "role": "assistant", "text": "PR84371-MEDIA-FALLBACK-fe92ef2-1779237455145.png", "provider": "openclaw", "model": "delivery-mirror", "stopReason": "stop", "idempotencyKey": "PR84371-MEDIA-FALLBACK-fe92ef2-177923...generated-media-direct" }Observed result after fix: The fallback produced exactly one Discord bot message in the original channel with the fixed completion text and exactly one
image/pngattachment. The active wake/requester-agent message-tool path was attempted first and missed media, then the direct fallback delivered once and the active session mirror committed after the send. Current-head tests additionally prove same-prompt image duplicate calls are guarded, distinct image prompts start separate tasks, recent success guards survive concurrent image prompts, and status reports all active image tasks.What was not tested: Mantis Telegram Desktop visual proof did not run because workflow
26133709129skipped downstream proof jobs after reporting actorfuller-stack-devhad only read permission. This proof uses live Discord transport, live Discord readback, and the real session mirror path instead. The media generator provider itself was not called; the proof injected the completed generated-media event at the delivery boundary while the fallback transport/readback/transcript surfaces were real. Live Discord transport was not rerun after the review-follow-up commits because those commits did not change the direct fallback transport implementation exercised by the proof; current-head verification covered the changed duplicate-guard/status, single-send idempotency, and docs behavior.