Skip to content

fix: directly deliver completed media fallback - #84371

Closed
fuller-stack-dev wants to merge 7 commits into
openclaw:mainfrom
fuller-stack-dev:fix/media-completion-direct-fallback
Closed

fuller-stack-dev wants to merge 7 commits into
openclaw:mainfrom
fuller-stack-dev:fix/media-completion-direct-fallback

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented May 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Keep generated media tasks active until completion delivery is confirmed, so duplicate/retry checks see the task while delivery is still pending.
  • Add duplicate and recent-completion guards for image, video, and music generation requests.
  • Add a direct generated-media fallback when requester-agent/message-tool delivery misses the completed media, while preserving the active wake/message-tool handoff path from upstream/main.
  • Address review follow-up by preserving concurrent distinct image prompts, keeping same-prompt duplicate guards, reporting all active image tasks, and updating the generated-media fallback docs.

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.ts
  • pnpm changed:lanes --json --base upstream/main
  • pnpm check:changed --base upstream/main
  • git diff --check upstream/main...HEAD
  • git merge-tree HEAD upstream/main

Review follow-up verification

Current head bd363a476fa4185247f558ff691d5f69ee2bef6b addresses the latest ClawSweeper findings from the durable review comment:

  • Same-prompt image retries still return active/recent status, while distinct image prompts can start their own task.
  • Recent duplicate guards now keep multiple recent media starts per session/tool so a completed prompt remains guarded after another prompt starts.
  • image_generate action:"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, and docs/tools/video-generation.md document the direct generated-media fallback.
  • Generated-media success completions now use one direct fallback/idempotency path; if that generated-media fallback cannot confirm delivery, OpenClaw fails the handoff instead of trying a second direct send with another key.

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 -> lanes core, 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 --help reported OpenClaw 2026.5.19 (fe92ef2)) against live Discord channel transport. Target channel is redacted as discord channel:...5762; the live fallback message id was 1506455834782072842. After the review-follow-up updates, current head bd363a476fa4185247f558ff691d5f69ee2bef6b was 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=module proof script from the PR checkout. The script resolved command-scoped Discord secrets for the configured channel, loaded the configured Discord plugin, called deliverSubagentAnnouncement(...) from src/agents/subagent-announce-delivery.ts, forced active requester wake to return queued:false with source_reply_delivery_mode_mismatch, forced the requester-agent handoff to return no message-tool/media delivery evidence, and let the PR fallback call the real sendMessage(...) transport. Then I fetched the exact Discord message by id with handleDiscordAction({ action: "fetchMessage", guildId: "<redacted>", channelId: "...5762", messageId: "1506455834782072842" }) and checked the active session mirror line with sed -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:

active requester wake:
  waitForTranscriptCommit: true
  sourceReplyDeliveryMode: message_tool_only
  steeringMode: all

requester-agent handoff:
  method: agent
  expectFinal: true
  deliver: false
  channel: discord
  to: channel:...5762
  sourceReplyDeliveryMode: message_tool_only
  idempotencyKey: PR84371-MEDIA-FALLBACK-fe92ef2-1779237455145
  mediaEvents: 1

direct fallback result:
  delivered: true
  path: direct
  phase: direct-primary
  phaseDelivered: true

sendMessage receipt:
  messageId: 1506455834782072842
  platformMessageIds: [1506455834782072842]
  parts: [{ kind: media, index: 0 }]

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/png attachment. 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 26133709129 skipped downstream proof jobs after reporting actor fuller-stack-dev had 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.

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.
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
The PR changes async image, music, and video completion delivery so generated-media tasks remain active until delivery is confirmed, adds duplicate/recent-completion guards, adds one direct generated-media fallback, and updates regression tests and docs.

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
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Summary: Strong Discord proof and broad regression coverage make the PR reviewable, with readiness limited by fallback-policy risk, missing Telegram-specific proof, and overlapping branch ownership.

Rank-up moves:

What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
Sufficient (live_output): The PR body includes redacted live Discord output with send receipt, exact message readback, transcript mirror proof, and current-head focused validation after follow-up commits.

Mantis proof suggestion
A native Telegram recording would directly reduce the remaining transport-specific delivery risk for this visible generated-media fallback. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram desktop proof: verify generated-media completion fallback posts exactly one media attachment to the original Telegram chat/topic after message-tool delivery misses.

Risk before merge

  • Merging changes documented behavior from fail-closed/no auto-post to one visible direct media post when active wake and requester-agent/message-tool delivery miss generated media.
  • The supplied real proof is Discord-only; the Telegram maintainer note asks for real Telegram proof for transport-visible behavior, and the requested Telegram Mantis run was skipped.
  • The overlapping PR Fix media completion duplicate delivery #84006 is still open on the same media-completion and duplicate-guard area, so maintainers should choose one canonical branch before landing.
  • The PR changes task terminal timing, duplicate-guard freshness reads, and transcript write-lock reuse, so in-flight session upgrade behavior remains a maintainer review point.

Maintainer options:

  1. Settle proof and branch ownership (recommended)
    Before merge, maintainers can choose this PR as the canonical branch over Fix media completion duplicate delivery #84006 and require Telegram or equivalent proof for the direct fallback path.
  2. Accept the Discord shared-path proof
    Maintainers can explicitly accept the supplied live Discord readback plus current-head focused checks if they judge the shared outbound delivery path sufficient.
  3. Pause the non-canonical branch
    If maintainers prefer the older branch or the prior fail-closed policy, pause or close the branch that should not own the final implementation.

Next step before merge
Human review is the right lane because the remaining blockers are fallback-policy acceptance, Telegram proof expectations, and canonical-branch selection rather than a narrow automated repair.

Security
Cleared: No concrete security or supply-chain regression found; the diff does not add dependencies, CI, release scripts, package resolution changes, or new credential handling.

Review details

Best 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:

  • P1: The PR addresses a user-facing generated-media delivery failure where completed media can fail to reach the original chat.
  • merge-risk: 🚨 compatibility: The diff intentionally changes the documented fail-closed behavior to a visible direct post fallback when media handoff evidence is missing.
  • merge-risk: 🚨 message-delivery: The new fallback can affect whether generated media is dropped, duplicated, or posted directly to the original transport target.
  • merge-risk: 🚨 session-state: The patch changes task terminal timing, transcript mirror writes, and duplicate-guard state around active sessions.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🦞 diamond lobster, patch quality is 🐚 platinum hermit, and Strong Discord proof and broad regression coverage make the PR reviewable, with readiness limited by fallback-policy risk, missing Telegram-specific proof, and overlapping branch ownership.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted live Discord output with send receipt, exact message readback, transcript mirror proof, and current-head focused validation after follow-up commits.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted live Discord output with send receipt, exact message readback, transcript mirror proof, and current-head focused validation after follow-up commits.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible generated-media fallback behavior that can be demonstrated in a Telegram chat/topic recording.

What I checked:

  • Current main fail-closed behavior: On current main, successful media generation is marked complete before the completion wake is attempted, so the task can leave the active set while delivery is still pending or failed. (src/agents/tools/media-generate-background-shared.ts:344, c8a35c4645dc)
  • Current main missing-media handling: On current main, generated-media completions that require message-tool delivery return failure when the requester-agent handoff does not show message-tool/media evidence; there is no direct generated-media fallback in this path. (src/agents/subagent-announce-delivery.ts:818, c8a35c4645dc)
  • PR direct fallback implementation: The PR adds deliverGeneratedMediaCompletionDirect, using the existing sendMessage dependency with generated media URLs, an idempotency key, and session mirror metadata, then calls it when message-tool or expected-media evidence is missing. (src/agents/subagent-announce-delivery.ts:609, 5b96ef89144e)
  • PR task completion ordering: The PR records 'Generated media; delivering completion', waits for wake/fallback delivery, completes the task only after delivery is confirmed, and fails the task if completion delivery cannot be confirmed. (src/agents/tools/media-generate-background-shared.ts:369, 5b96ef89144e)
  • Real behavior proof: The PR body includes live Discord transport proof with direct fallback result, send receipt, exact Discord message readback, and transcript mirror proof; current-head checks also passed for focused tests, lint, changed lanes, changed check, and autoreview. (5b96ef89144e)
  • Related open work: The related media-completion branch Fix media completion duplicate delivery #84006 is still open and overlaps the same completion-delivery, duplicate-guard, and task-lifecycle area.

Likely related people:

  • steipete: GitHub path history shows repeated recent work on async media completion and task delivery, including the shared async media scheduler and message-tool completion contract. (role: feature owner and recent area contributor; confidence: high; commits: fd8afc1dce46, 1a956b6ba156, 4526b447781d; files: src/agents/tools/media-generate-background-shared.ts, src/agents/subagent-announce-delivery.ts, src/tasks/task-registry.ts)
  • Galin Iliev: Recent main history on subagent completion announce delivery added stale completion recovery and wake retry behavior adjacent to this fallback path. (role: recent area contributor; confidence: medium; commits: 04eac15f43d5, 57ec361682e2; files: src/agents/subagent-announce-delivery.ts)
  • fuller-stack-dev: Beyond authoring this PR, prior merged history on current main includes a Telegram topic media-completion routing fix in the same delivery file. (role: recent adjacent contributor; confidence: medium; commits: ff47c516086a; files: src/agents/subagent-announce-delivery.ts)
  • Merlin: History shows prior work unifying task, subagent, and media completion routing through the requester-session delivery policy. (role: adjacent owner; confidence: medium; commits: 16c27c145958; files: src/agents/tools/media-generate-background-shared.ts, src/tasks/task-registry.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a35c4645dc.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 💎 rare Mossy Review Wisp

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 💎 rare.
Trait: finds missing screenshots.
Image traits: location branch lighthouse; accessory rollback rope; palette amber, ink, and glacier blue; mood curious; pose sitting proudly on a smooth stone; shell starlit enamel shell; lighting gentle morning glow; background quiet workflow signs.
Share on X: post this hatch
Copy: My PR egg hatched a 💎 rare Mossy Review Wisp in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 20, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@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.

@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 20, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

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 summary: Make this PR merge-ready for ClawSweeper automerge. Rebase onto latest main, address PR comments and review findings, fix CI/check failures, add required changelog if needed, and validate before returning.

Worker actions:

  • build_fix_artifact on this PR: planned - Maintainer opted this PR into ClawSweeper automerge/autofix repair; run the direct Codex edit loop after live hydration instead of a separate read-only planning pass.

No push, rebase, replacement PR, merge, or ClawSweeper re-review happened on this pass.

fish notes: model gpt-5.5, reasoning high.

Automerge progress:

  • 2026-05-20 01:11:24 UTC review queued fe92ef21ce51 (queued)

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper stop

@clawsweeper clawsweeper Bot added clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge labels May 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 20, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the current review findings on head 6fc2d765eba10b28f4f6afc7d6dc5e96cb3b1a20.

  • Restored image prompt compatibility: same-prompt image retries still return active/recent status, while distinct image prompts can start their own task.
  • Kept recent duplicate guards for concurrent image prompts by tracking multiple recent media starts per session/tool.
  • Updated image_generate action:"status" so concurrent image tasks are all visible.
  • Updated docs/automation/tasks.md and docs/tools/media-overview.md for direct generated-media fallback behavior.
  • Refreshed the PR body proof section with the current-head review-follow-up verification and the existing live Discord transport proof boundary.

Verification:

  • 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 -> 2 files, 57 tests 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.
  • git diff --check -> passed.
  • pnpm changed:lanes --json --base upstream/main -> lanes core, 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.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Follow-up after the CI lint failure: pushed head 64f9df425c8c5244522252cf9f380eb2e9bd5198.

  • Removed the unnecessary non-null assertion in src/agents/image-generation-task-status.ts that failed check-lint.
  • Refreshed the PR body proof section again so the current-head SHA and verification list are up to date.

Additional verification after the lint fix:

  • pnpm test src/agents/tools/image-generate-tool.test.ts src/agents/image-generation-task-status.test.ts -> 2 files, 46 tests passed.
  • pnpm lint --threads=8 -> passed.
  • pnpm format:check -- src/agents/image-generation-task-status.ts -> passed.
  • git diff --check -> passed.
  • pnpm check:changed --base upstream/main -> passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 20, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the latest ClawSweeper P2 findings on head bd363a476fa4185247f558ff691d5f69ee2bef6b.

  • Removed the second success direct-send fallback from src/agents/tools/media-generate-background-shared.ts. Generated-media completions now rely on the single direct fallback inside deliverSubagentAnnouncement; if that fallback cannot confirm delivery, the completion handoff fails instead of trying a second sendMessage with another idempotency key.
  • Kept direct failure-summary delivery unchanged, since failure notices do not carry generated media attachments.
  • Updated docs/tools/image-generation.md, docs/tools/music-generation.md, and docs/tools/video-generation.md so the per-tool docs match the media overview fallback behavior.
  • Refreshed the PR body proof section for this final head.

Verification after these fixes:

  • 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 format:check -- src/agents/tools/media-generate-background-shared.ts src/agents/tools/video-generate-background.test.ts docs/tools/image-generation.md docs/tools/music-generation.md docs/tools/video-generation.md -> passed.
  • git diff --check -> passed.
  • 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.

@clawsweeper re-review

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Addressed the latest P2 findings on head bd363a476fa4185247f558ff691d5f69ee2bef6b: removed the second success direct media fallback path, kept generated-media success fallback on the single subagent idempotency key, added regression coverage for the unconfirmed fallback case, and updated the image/music/video tool docs.

@clawsweeper

clawsweeper Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 20, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper merge

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

I think we broke him 😔

@clawsweeper

clawsweeper Bot commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper approve

@steipete steipete self-assigned this May 22, 2026
@steipete

Copy link
Copy Markdown
Contributor

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 main across the same media completion, duplicate-guard, task lifecycle, and docs files. The remaining branch delta is not a clean additive follow-up; it still overlaps the landed implementation, and some pieces are older than the merged fix. For example, #84006 keeps the generated-media direct fallback to only the missing media URLs, while this branch still carries the stale all-expected-media fallback shape.

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 main with just that delta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:human-review Needs maintainer review before ClawSweeper can continue docs Improvements or additions to documentation mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants