Skip to content

coding-agent skill should recommend sessions_spawn over exec background for completion notification #50398

@tymrtn

Description

@tymrtn

Problem

The bundled coding-agent skill (SKILL.md) instructs agents to use exec with background: true for long-running coding tasks, and openclaw system event --text '...' --mode now for completion notification.

This notification path is broken:

  1. exec background → process exits → notifyOnExit enqueues system event → triggers heartbeat
  2. Heartbeat runs as an isolated session with no conversation context from the parent
  3. The isolated session has no knowledge of what was delegated, no decision tree, no instructions to forward to a channel
  4. Result: completion is silently consumed by a context-free heartbeat session. Nothing reaches the user.

This is compounded by issue #29215 (heartbeat.target defaults to none) and issue #23315 (subagent completion not delivered).

What works instead

sessions_spawn with mode: "run" + sessions_yield:

sessions_spawn(task="...", mode="run", label="my-task")
sessions_yield(message="Waiting for completion...")
// Result auto-announces back to the requester session
// Agent has full context to take the next action

This delivers the result back to the session that spawned the task, with full conversation context preserved. The agent can verify the work, execute the next step in a chain, or escalate to the user — all without a broken notification pipeline.

Suggested fix

Update skills/coding-agent/SKILL.md:

  1. Replace the exec background pattern with sessions_spawn + sessions_yield as the recommended approach for Claude Code tasks
  2. Remove or deprecate the "Auto-Notify on Completion" section that recommends openclaw system event
  3. Keep exec (non-background) for quick one-shot commands that complete immediately

Impact

Any agent using the coding-agent skill to delegate background work will never receive completion notifications. This affects the core workflow of: spawn agent → wait → get result → take next action.

Environment

  • OpenClaw 2026.3.13 (stable, npm)
  • macOS Darwin 24.6.0 (arm64)
  • Claude Code via claude --permission-mode bypassPermissions --print
  • Confirmed: sessions_spawn + sessions_yield works correctly on this version
  • Confirmed: exec background + openclaw system event does NOT deliver to any channel

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions