Skip to content

[Bug]: Subagent announce doesn't preserve Slack assistant app thread context #17731

@Taskle

Description

@Taskle

Summary

When spawning a subagent via sessions_spawn from within a Slack assistant app thread (topic session), the announce routes to the base DM session instead of the originating thread. The announce response either gets lost or delivers as a flat DM, never reaching the thread where the user is actively chatting.

Root cause (suspected)
runSubagentAnnounceFlow() in subagent-announce.ts uses the parent session's deliveryContext. For Slack assistant app threads, sessions are split into a base session and topic-specific sessions (-topic-). The spawn originates from the topic session, but the announce resolves to the base session's deliveryContext, which has no threadId — so the response can't route back to the correct Slack thread.

Workaround
Use the message tool to explicitly send results to the thread with the threadId parameter after polling sessions_list for completion. This bypasses the announce system and delivers reliably.

Steps to reproduce

  1. Configure OpenClaw with Slack channel with Slack's "assistant experience" enabled via api.slack/com/apps/[ID]/app-assistant and toggling on "Agent or Assistant"
  2. Open a DM with the bot — Slack creates an assistant_app_thread
  3. From within that thread, have the agent call sessions_spawn(task="...", label="test")
  4. Wait for subagent to complete

Expected behavior

Announce summary appears in the same assistant thread

Actual behavior

Announce lands in the base DM session (.jsonl), not the topic session (-topic-.jsonl). Response is generated but never delivered to Slack.

OpenClaw version

2026.2.14

Operating system

Ubuntu Linux (AWS EC2)

Install method

npm global

Logs, screenshots, and evidence

N/A

Impact and severity

Given data is lost, namely a message reply to a spawned subagent never gets received by the user, I would consider this high impact and high severity.

Additional information

The subagent docs state: "Announce replies preserve thread/topic routing when available (Slack threads, Telegram topics, Matrix threads)." This works for normal Slack threads but not for Slack assistant app threads, which use a different session topology (base + topic sessions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions