Skip to content

feat: relay ACP completion back to DM sessions#47531

Closed
Groos-dev wants to merge 3 commits into
openclaw:mainfrom
Groos-dev:feat/acp-dm-completion-relay-47443
Closed

feat: relay ACP completion back to DM sessions#47531
Groos-dev wants to merge 3 commits into
openclaw:mainfrom
Groos-dev:feat/acp-dm-completion-relay-47443

Conversation

@Groos-dev

Copy link
Copy Markdown

Summary

  • add a dedicated ACP completion relay for non-thread / DM spawns
  • start the relay from acp-spawn only for non-thread, non-parent-stream runs with a deliverable requester origin
  • cover the new relay behavior with focused tests

Testing

  • corepack pnpm exec vitest run src/agents/acp-spawn-completion-relay.test.ts src/agents/acp-spawn-parent-stream.test.ts
  • corepack pnpm exec vitest run src/agents/acp-spawn.test.ts (currently fails on main with a pre-existing module mock/load issue in src/agents/tools/sessions-spawn-tool.ts)

Closes #47443

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Mar 15, 2026
@Groos-dev

Copy link
Copy Markdown
Author

Added commit Groos-dev@83652684:

  • bot-message-context.ts: pass context cfg directly into resolveTelegramConversationRoute instead of re-fetching a fresh config, fixing the route resolution for per-topic agent routing
  • bot-message-context.topic-agentid.test.ts: thread the mocked config through test harness calls so the config fixture is actually exercised

Net result: the one previously-failing test in this file now passes. All other test:channels failures are pre-existing on main (verified by stash comparison: base=14 failed, this branch=13 failed).

@steipete

Copy link
Copy Markdown
Contributor

Closing this as implemented after Codex review.

Current main already relays ACP background-run completion back to the requester DM/session via the detached task pipeline, so the draft PR's dedicated completion-relay path is no longer needed.

What I checked:

  • ACP spawns now register requester-bound background tasks: spawnAcpDirect creates an ACP task run for accepted non-thread/background spawns and stores requesterOrigin, which is the routing data needed to send completion back to the originating DM/session. (src/agents/acp-spawn.ts:1347, 00bd2cf7a376)
  • ACP runtime records terminal completion/failure summaries for those background tasks: The ACP control-plane resolves the parent/requester context from the spawned session, creates the background task record at turn start, and marks it terminal with terminalSummary/terminalOutcome when the run ends. (src/acp/control-plane/manager.core.ts:723, 00bd2cf7a376)
  • Task registry delivers ACP terminal updates back to requester origin or parent session: maybeDeliverTaskTerminalUpdate sends the formatted completion message to requesterOrigin when the channel is deliverable, and otherwise queues a system event back to the owning session as fallback. (src/tasks/task-registry.ts:1018, 00bd2cf7a376)
  • Tests cover ACP terminal delivery to the originating DM/thread: Task-registry tests assert that ACP runs with requesterOrigin are marked delivered and send Background task done: messages back to the originating channel/thread, including terminal summaries for successful runs. (src/tasks/task-registry.test.ts:549, 0e7250f37bf3)
  • The shipped release already contains this implementation: The latest release commit v2026.4.22 includes the same ACP background-task creation, terminal recording, and task-registry delivery paths. (00bd2cf7a376)

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review notes: reviewed against 0e7250f37bf3; fix evidence: release v2026.4.22, commit 00bd2cf7a376.

@steipete steipete closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP on DM/non-thread surfaces needs first-class completion relay / proactive notification

2 participants