Repository navigation
fix(agents): media generation blocks channel turns sharing the main session - #160998
Merged
Merged
Conversation
…n key Image, video and music generation in channel sessions that share the main session (for example QA-channel or Matrix direct chats under the default DM scope) ran in the foreground and blocked the turn instead of starting a background task. The media tools received the channel alias session key (agent:<id>:<channel>:...:direct:<peer>) while SQLite stores the requester under the durable run session key (agent:<id>:main). Since #159179 (6652f7e) detaching requires a bound requester transcript, and the alias lookup found no session entry, so detach was false and the provider call ran inline. Pass the durable requester session key (runSessionKey, falling back to the agent session key) to image, video and music generation, as the other requester-scoped tools already do. Cron run keys keep their existing behavior; transcript and cron-continuation safeguards are unchanged. Proof: regression in openclaw-tools.tts-config.test.ts fails before and passes after; 65 owner/sibling tests pass. image-generation-lifecycle.e2e now reaches background start, running-duplicate dedupe and completion delivery with internal provenance (previously stuck at the first turn); its final "recently succeeded" duplicate check still fails separately.
…d duplicate #159179 removed the tasks.list terminal-state wait from image-generation-lifecycle.e2e together with the Tasks runtime. Completion delivery precedes the task's terminal success (unchanged product order), so the third duplicate request could arrive while the task still reported "Generated media; delivering completion" and never saw "recently succeeded". Restore the wait through the surviving owner: image_generate action=status via tools.invoke on the requester's durable session. The test first asserts that the status reports the running task (so the observable is not vacuous), then waits for "No active image generation task" before the third request. Proof: with d068991 the e2e file passes 1/1 (61 s).
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes: image, video, and music generation in channel sessions that share the main session (default DM scope) run in the foreground and block the turn instead of detaching, a 9.7 regression from #159179.
User Impact
Media generation in shared-main channel sessions backgrounds again and no longer blocks the conversation turn.
Why This Change Was Made
Since #159179, media detach requires a bound requester transcript, but channel sessions sharing main passed the alias key, so the entry lookup missed. The tools now receive the durable
runSessionKey. A second, test-only commit restores the image-generation-lifecycle e2e wait for the terminal task state (the removedtasks.listwait) viaimage_generate action=status.Evidence
test/e2e/qa-lab/media/image-generation-lifecycle.e2e.test.tspasses locally at eae603c; it failed in Full Release Validation release checks (jobs 109251108779, 109179390422) without the fix.