Skip to content

[Bug]: Discord subagent thread binding omits delivery origin for initial child run #83170

@100menotu001

Description

@100menotu001

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Discord thread-bound delegated subagent sessions can be accepted and bound successfully, but the child still posts its initial reply into the parent channel because the Discord subagent_spawning hook does not return a routable delivery origin.

Steps to reproduce

  1. In a Discord channel with thread bindings enabled, call sessions_spawn with thread=true and mode=session.
  2. Observe that the spawn is accepted and the child session completes normally.
  3. Observe that the child reply posts into the parent channel instead of a visible Discord thread.

Expected behavior

When Discord thread binding succeeds for a delegated child session, the initial child run should route into the bound Discord thread.

Actual behavior

The child session is accepted and the binding exists, but the initial child reply still routes to the parent channel.

OpenClaw version

2026.5.6

Operating system

macOS (Apple Silicon)

Install method

pnpm dev / local source checkout reproduction, plus managed local OpenClaw runtime reproduction

Model

openai/gpt-5.4

Provider / routing chain

openclaw -> discord bot adapter -> openai/gpt-5.4

Additional provider/model setup details

Reproduced from a Discord group session with channels.discord.threadBindings.enabled=true and spawnSubagentSessions=true.

Logs, screenshots, and evidence

  • Live reproduction showed sessions_spawn(thread=true, mode=session) returning accepted while the child session still resolved to the parent #general channel.
  • Local code trace shows:
    • Discord hook creates the binding in extensions/discord/src/subagent-hooks.ts.
    • The generic spawn path only switches the child onto the thread when deliveryOrigin is returned from subagent_spawning.
    • Discord currently returns threadBindingReady: true without deliveryOrigin.

Impact and severity

  • Affected: Discord delegated child sessions using thread-bound sessions_spawn.
  • Severity: Medium.
  • Frequency: Reproduced on each observed attempt in this setup.
  • Consequence: delegated work appears in the parent channel instead of a visible thread, weakening isolation and making threaded delegation look broken.

Additional information

Related context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.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.

    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