Skip to content

music_generate background task completion delivery consistently fails (completion wake + fallback both fail) #91003

Description

@kumaxs

Bug Description

music_generate background task completion delivery fails consistently. The music generation itself succeeds (confirmed by media file existing on disk), but neither the session wake mechanism nor the fallback completion agent delivery path works correctly.

Result: User never receives the generated music via the normal session flow.

Reproduction Steps

  1. In a webchat session, call music_generate with a prompt
  2. The session calls sessions_yield to wait for completion
  3. Music generation completes successfully on the provider side
  4. Session is NOT woken up (no completion event injected into the session)
  5. Fallback completion agent attempts delivery but fails with: "Music generation completion delivery failed after successful generation"
  6. User sees nothing

Expected Behavior

As documented in the official music-generation.md:

  • "Completion wake: OpenClaw injects an internal completion event back into the same session so the model can write the user-facing follow-up itself."
  • When session cannot be woken, fallback completion agent should successfully deliver via message tool

Actual Behavior

Both paths fail:

  1. Session wake fails silently — session is not woken up
  2. Fallback delivery fails — completion agent reports "Music generation completion delivery failed after successful generation"

Environment

  • Platform: macOS (Mac Mini M4 16GB)
  • Channel: webchat
  • OpenClaw: Latest version (2026-06-07)
  • Model: minimax/music-2.6
  • Session kind: dashboard (agent:main:dashboard:...)

Additional Context

  • This appears related to session compaction — after sessions_yield, if compaction runs while waiting, the session may lose its "wakenable" state
  • Multiple consecutive attempts all fail with the same pattern
  • User confirmed the media file IS successfully generated and exists on disk at: ~/.openclaw/media/tool-music-generation/track-1---*.mp3
  • The task status shows "completed successfully" but delivery to the session fails

Tags

bug, music-generation, completion-wake, session-compaction, webchat

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions