Skip to content

ACP mode:run without thread binding has no completion delivery to parent session #44720

@the3asic

Description

@the3asic

Summary

ACP mode: "run" sessions spawned via sessions_spawn without thread binding have no completion delivery mechanism back to the parent/requester session. Subagent mode: "run" sessions auto-announce completion to the parent, but equivalent ACP sessions silently complete with no notification.

Steps to Reproduce

  1. From a main or agent session (e.g. Telegram direct chat, no thread/topic), spawn an ACP run:
{
  "runtime": "acp",
  "agentId": "claude",
  "mode": "run",
  "task": "Run date and report the time",
  "runTimeoutSeconds": 60
}
  1. The task executes successfully — the session JSONL shows correct assistant output.
  2. The parent session never receives a completion event or auto-announce.

Observed Behavior

  • Subagent mode: "run": Completion auto-announces to parent session ✅
  • ACP mode: "run" without thread binding: Task completes, result written to session JSONL, but parent session receives nothing ❌
  • ACP mode: "run" with streamTo: "parent": Only a start system event is delivered; no completion or end event arrives ❌

Timeline from gateway logs (streamTo: "parent" case)

13:57:25 — stream log: kind=system_event, text="Started claude session..."
13:57:45 — session JSONL: assistant responds with correct output, stopReason=stop
           (no further stream log entries, no completion event)

Expected Behavior

ACP mode: "run" should deliver completion results back to the requester session, consistent with subagent mode: "run" behavior. At minimum when streamTo: "parent" is set, a completion/end system event should be emitted.

Context

  • ACP delivery appears designed primarily for thread-bound scenarios (Discord threads / Telegram topics). Non-thread-bound spawns from direct sessions have no delivery target.
  • Startup identity reconcile also fails consistently (checked=3 resolved=0 failed=3) because it runs ~80ms after acpx backend registered but ~1s before backend ready — possibly related but not the direct cause of this delivery gap.
  • Gateway version: 2026.3.11 (updated today)
  • acpx version: 0.1.16
  • ACP backend: claude (Claude Code CLI)

Workarounds

  • Poll the ACP session JSONL manually after spawning
  • Use thread-bound ACP sessions (requires forum-mode Telegram or Discord threads)
  • Use native subagent runtime instead of ACP when auto-announce is needed

Suggestion

  1. For mode: "run" without thread binding, deliver completion to the requester session the same way subagents do (auto-announce).
  2. For streamTo: "parent", ensure a completion/end event is written to the stream log when the ACP run finishes.
  3. Consider adding a startup reconcile retry or gate on backend ready (separate issue if preferred).

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