openclaw - ✅(Solved) Fix feat(acp): support streamTo="thread" to relay ACP progress directly to Discord/slack threads [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#55574Fetched 2026-04-08 01:37:47
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Fix Action

Fix / Workaround

  1. ACP progress updates are sent directly to the bound Discord/Slack thread as messages (not just parent session system events)
  2. This gives users real-time visibility into codex/claude-code progress without polling or workarounds

PR fix notes

PR #59366: feat(acp): support streamTo="thread" for ACP spawns

Description (problem / solution / changelog)

Summary

  • add streamTo="thread" as an ACP spawn target and require it to be paired with thread=true
  • relay ACP progress directly to the bound thread delivery target while preserving existing streamTo="parent" behavior
  • cover Discord and Slack thread delivery in ACP relay tests and document the new ACP spawn option

Closes #55574.

Test Plan

  • OPENCLAW_TEST_PROFILE=serial OPENCLAW_TEST_SERIAL_GATEWAY=1 corepack pnpm test -- src/agents/tools/sessions-spawn-tool.test.ts
  • OPENCLAW_TEST_PROFILE=serial OPENCLAW_TEST_SERIAL_GATEWAY=1 corepack pnpm test -- src/agents/acp-spawn-parent-stream.test.ts
  • OPENCLAW_TEST_PROFILE=serial OPENCLAW_TEST_SERIAL_GATEWAY=1 corepack pnpm test -- src/agents/acp-spawn.test.ts
  • NODE_OPTIONS=--max-old-space-size=8192 corepack pnpm exec tsc -p tsconfig.json --noEmit --pretty false

Changed files

  • docs/tools/acp-agents.md (modified, +4/-1)
  • src/agents/acp-spawn-parent-stream.test.ts (modified, +155/-0)
  • src/agents/acp-spawn-parent-stream.ts (modified, +66/-2)
  • src/agents/acp-spawn.test.ts (modified, +188/-1)
  • src/agents/acp-spawn.ts (modified, +119/-18)
  • src/agents/tools/sessions-spawn-tool.test.ts (modified, +35/-2)
  • src/agents/tools/sessions-spawn-tool.ts (modified, +3/-2)
  • src/channels/model-overrides.test.ts (modified, +19/-2)
  • src/plugin-sdk/browser-maintenance.test.ts (modified, +6/-3)
RAW_BUFFERClick to expand / collapse

Problem

Currently sessions_spawn with streamTo: "parent" relays ACP progress as system events to the parent session. This works internally but does not surface real-time progress to users on chat platforms (Discord, Slack, etc.) — the progress events stay invisible in the channel.

Proposed Solution

Add "thread" as a valid value for streamTo in ACP spawn (ACP_SPAWN_STREAM_TARGETS). When streamTo: "thread" is set alongside thread: true:

  1. ACP progress updates are sent directly to the bound Discord/Slack thread as messages (not just parent session system events)
  2. This gives users real-time visibility into codex/claude-code progress without polling or workarounds

Current Behavior

  • streamTo: "parent" → progress as system events in parent session (invisible to Discord users)
  • No streamTo: "thread" option exists
  • ACP_SPAWN_STREAM_TARGETS = ["parent"] (hardcoded enum)

Implementation Notes

  • The thread channel ID is already available in thread-bound sessions
  • Core change is ~100-200 lines: extend the enum, add a channel-provider send path for progress events instead of (or in addition to) parent session injection
  • Should work for any channel provider that supports threads (Discord, Slack, etc.)

Use Case

When spawning coding agents (codex, claude-code) from Discord, users want to see real-time progress in the thread rather than waiting for the entire run to complete.

extent analysis

Fix Plan

To add real-time progress updates to Discord/Slack threads, we will implement the following steps:

  • Extend the ACP_SPAWN_STREAM_TARGETS enum to include "thread"
  • Add a new send path for progress events to channel providers that support threads
  • Update the sessions_spawn function to handle streamTo: "thread" and send progress updates to the bound thread

Example Code

// Extend the ACP_SPAWN_STREAM_TARGETS enum
const ACP_SPAWN_STREAM_TARGETS = ["parent", "thread"];

// Update the sessions_spawn function
function sessions_spawn(options) {
  if (options.streamTo === "thread" && options.thread) {
    // Send progress updates to the bound thread
    const threadChannelId = getThreadChannelId();
    const channelProvider = getChannelProvider();
    channelProvider.sendMessage(threadChannelId, `Progress update: ${options.progress}`);
  } else if (options.streamTo === "parent") {
    // Send progress updates to the parent session
    const parentSession = getParentSession();
    parentSession.emit("progress", options.progress);
  }
}

// Helper function to get the thread channel ID
function getThreadChannelId() {
  // Return the thread channel ID from the thread-bound session
  return threadBoundSession.threadChannelId;
}

// Helper function to get the channel provider
function getChannelProvider() {
  // Return the channel provider instance (e.g. Discord, Slack)
  return channelProviderInstance;
}

Verification

To verify that the fix worked, test the sessions_spawn function with streamTo: "thread" and thread: true. Check that progress updates are sent to the bound Discord/Slack thread in real-time.

Extra Tips

  • Ensure that the channel provider supports threads and has the necessary permissions to send messages.
  • Handle errors and edge cases, such as when the thread channel ID is not available or the channel provider fails to send the message.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix feat(acp): support streamTo="thread" to relay ACP progress directly to Discord/slack threads [1 pull requests, 1 participants]