Repository navigation
Description
[Bug]: Binding type: "acp" sessions silently fail — session created, process spawned, but systemSent never delivered
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Binding type: "acp" + opencode agent on Telegram group topic creates session and spawns opencode acp process, but systemSent is never delivered, no transcript produced, and no error is logged. User never receives a response.
Steps to reproduce
- Configure an ACP agent with runtime
type: "acp",mode: "persistent", backendacpx:
{
"agents": {
"list": [{
"id": "opencode",
"runtime": { "type": "acp", "acp": { "agent": "opencode", "backend": "acpx", "mode": "persistent" } }
}]
}
}- Bind a Telegram group topic to it via
type: "acp":
{
"type": "acp",
"agentId": "opencode",
"match": {
"channel": "telegram",
"accountId": "default",
"peer": { "kind": "group", "id": "-100XXXXXXXXXX:topic:2" }
},
"acp": { "label": "opencode", "mode": "persistent" }
}- Send a message in the bound topic.
- Check
sessions.json→ session created, butsystemSentabsent,totalTokens: 0, no.jsonltranscript. ps aux | grep "opencode acp"→ process is running but idle.
Expected behavior
Session receives systemSent, the ACP agent processes the message, and a response is delivered back to the Telegram topic. This works correctly when the binding is changed to type: "route", and also works via sessions_spawn(runtime="acp", agentId="opencode") and direct acpx opencode exec "hello".
Actual behavior
Session JSON created, opencode acp process spawned, but systemSent never becomes true. No .jsonl transcript file is generated. Process sits idle indefinitely. Gateway logs show no errors — the message is silently lost.
From sessions.json (redacted):
sessionId: a1ba2f33-...
systemSent: (field absent)
totalTokens: 0
status: (absent)
error: (absent)
sessionFile: (none)
OpenClaw version
2026.6.10
Operating system
macOS 25.5.0 (arm64)
Model
opencode-go/qwen3.7-plus (via OpenCode CLI)
Provider / routing chain
openclaw → acpx plugin (0.8.0) → opencode acp (v1.17.11, gpt-5.5) → opencode-go/qwen3.7-plus
Logs, screenshots, and evidence
Failing session (type: "acp"):
sessionId: a1ba2f33-d2d2-4eeb-9af7-7bd37b639767
systemSent: (absent)
totalTokens: 0
started: 13:09:36
Process: aiii 10807 ... ~/.opencode/bin/opencode acp
Working session (same config, only changed to type: "route"):
sessionId: 8c6787a7-2326-471e-8998-b4b6c18a24e6
systemSent: True ✅
totalTokens: 35,714
status: done
sessionFile: 8c6787a7-...-topic-2.jsonl (4KB)
Impact and severity
- Affected: Any Telegram group topic bound via
type: "acp"to an ACP agent - Severity: High — messages are silently dropped with no error, user never receives a response
- Frequency: 5/5 observed attempts with
type: "acp"binding; 0 failures withtype: "route"workaround - Consequence: ACP agent bindings are unusable; users must switch to
type: "route"binding
Additional information
- Direct
acpx opencode execworks sessions_spawn(runtime="acp", agentId="opencode")works- Only the binding
type: "acp"path fails - Related: ACP: shouldReplaceEnsuredSession causes infinite replace loop with acpx 0.3.1 (sessions spawn fails) #56855 (closed, different failure mode — infinite loop vs silent hang)
- Comments from
assistationandJacktenon ACP: shouldReplaceEnsuredSession causes infinite replace loop with acpx 0.3.1 (sessions spawn fails) #56855 describe similar symptoms of silent message loss in the binding path - Suspected root cause: binding-triggered
ensureSessiondelivers the first prompt (systemSent) differently thansessions_spawn, and the opencode acp bridge never receives it
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 27, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 27, 2026, 2:09 AM ET / 06:09 UTC.
Summary
Keep open: Telegram forum-topic
type:"acp"bindings are documented and wired as supported behavior, the report is against latest release v2026.6.10, and current main does not show a matching fix for first-prompt delivery into acpx/opencode.Reproducibility: no. live Telegram/acpx reproduction was run, but docs and current source show this is a supported path and the observed idle ACP session matches the gap between configured binding initialization and first-turn dispatch.
Ways to help us reproduce this
Next step
Queue a focused bug-fix PR because the contract is documented and source-reproducible, but require live or strongly instrumented proof for the exact Telegram/acpx first-turn path.
Review details
Best possible solution:
Repair the existing Telegram configured ACP binding dispatch so a matched topic both initializes the ACP session and sends the inbound prompt through
reply_dispatch/acpManager.runTurn, surfacing a visible error if dispatch cannot start.Do we have a high-confidence way to reproduce the issue?
No live Telegram/acpx reproduction was run, but docs and current source show this is a supported path and the observed idle ACP session matches the gap between configured binding initialization and first-turn dispatch.
Is this the best way to solve the issue?
Yes: the best fix is to preserve the existing
type:"acp"binding contract and repair first-prompt dispatch, not add a new binding type or maketype:"route"the workaround.AGENTS.md: found and applied where relevant.
Remaining risk / open question:
runTurnwas not live-reproduced with Telegram/acpx/opencode in this read-only review, so the fix needs targeted regression coverage plus real transport/runtime proof.Codex review notes: model internal, reasoning high; reviewed against fbfadbd806e1.
Label changes
Label changes:
P1: A documented Telegram ACP binding workflow can silently drop live user messages with no response in the latest release.impact:message-loss: The reported bound-topic message is accepted far enough to create a session but never reaches the user-visible ACP reply path.impact:session-state: The affected session is left with missingsystemSent, zero tokens, and no transcript, so agent session state never advances.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.Label justifications:
P1: A documented Telegram ACP binding workflow can silently drop live user messages with no response in the latest release.impact:message-loss: The reported bound-topic message is accepted far enough to create a session but never reaches the user-visible ACP reply path.impact:session-state: The affected session is left with missingsystemSent, zero tokens, and no transcript, so agent session state never advances.Evidence reviewed
Acceptance criteria:
What I checked:
opencode acp, butsystemSentremains absent, no transcript is written, and switching only the binding totype:"route"works.bindings[].typeas"acp", include Telegram forum topic identity syntax, and state OpenClaw ensures the configured ACP session before use and routes messages in that channel/topic/chat to it. Public docs:docs/tools/acp-agents.md. (docs/tools/acp-agents.md:330, fbfadbd806e1)match.channel:"telegram"and topic-qualified peer ids. Public docs:docs/channels/telegram.md. (docs/channels/telegram.md:688, fbfadbd806e1)type:"acp"as a persistent ACP conversation binding and say those entries resolve by exact conversation identity rather than normal route tier order. Public docs:docs/gateway/config-agents.md. (docs/gateway/config-agents.md:1135, fbfadbd806e1)resolveConfiguredBindingRoute, rewrites the route, and records configured binding mode with the bound ACP session key. (extensions/telegram/src/conversation-route.ts:112, fbfadbd806e1)initializeSession; this matches the reporter's observed session/process creation before prompt delivery stalls. (src/acp/persistent-bindings.lifecycle.ts:56, fbfadbd806e1)Likely related people:
docs/tools/acp-agents.md,docs/channels/telegram.md,src/channels/plugins/acp-configured-binding-consumer.ts)docs/tools/acp-agents.md,src/channels/plugins/acp-configured-binding-consumer.ts)extensions/telegram/src,src/acp)src/auto-reply/reply,extensions/acpx)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jul 12, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 19, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.
allen0304 commentedon Jul 25, 2026
Re-test results (2026-07-25, OpenClaw 2026.7.1-2)
Confirmed: both bugs still present in the current release. Additionally, the investigation surfaced a second, related bug in the
type: "route"subagent delivery path for the same Telegram group topic scenario.Environment
-1003697845241, forum topic 2acpx, target:opencodemessages.groupChat.visibleReplies: "message_tool"Bug 1 (original):
type: "acp"binding — stdin never reaches CLISame silent-fail pattern as reported in June:
Gateway log evidence:
Process spawned but idle:
✅ Gateway receives message
✅ CLI process spawned
❌ Message content never written to CLI stdin — CLI idles indefinitely, no response ever sent to topic
Suspected code path:
dist/dispatch-acp-session.runtime-DN_0YgLN.js— the message relay to stdin appears to fail for group topic routing metadata (threadId handling).Bug 2 (new discovery):
type: "route"— subagent completion announce fails to deliverWhen topic 2 binding uses
type: "route"→opencodeagent (which internally spawns ACP subagent), the CLI does receive input and produce output, but the results can't be delivered back to the Telegram topic.Gateway log evidence:
✅ Route binding routes message to opencode agent
✅ Agent spawns ACP subagent (
sessions_spawn(runtime="acp"))✅ OpenCode CLI receives input, processes file, produces complete output
❌ Subagent completion announce retries 3 times, all fail — results never delivered to Telegram
Source code trace for Bug 2
Four key files in the delivery chain:
subagent-announce-BH7YpLmx.jsdeliverSubagentAnnouncementsource-reply-delivery-mode-Cl9ZnCi6.jschatType === "group"→ checksmessages.groupChat.visibleReplies→ returns"message_tool_only"completion-delivery-policy-MroGvjFb.jscompletionRequiresMessageToolDelivery()→ true for group topicssubagent-announce-origin-DPSebzOW.jsrequiresMessageToolDeliveryis true, but announce agent didn't callmessage(action=send)→ returns errorRoot cause: Group chat
visibleReplies: "message_tool"forcesmessage_tool_onlydelivery for subagent completions. The announce agent (parent session) receives the delivery trigger, starts a turn, but the completion routing withmessage_tool_onlymode fails because the agent doesn't produce a message-tool-mediated visible reply within the announce turn.Reproduction steps
Bug 1 (type: "acp"):
type: "acp"binding targeting an ACP harnessBug 2 (type: "route" → ACP subagent):
type: "route"binding to an agent withruntime.type: "acp"messages.groupChat.visibleRepliesis"message_tool"Summary
type: "acp"type: "route"(ACP subagent)Both bugs are specific to Telegram group topics — direct chat ACP bindings work fine. The common theme is that group topic routing metadata (threadId, delivery context) isn't handled correctly in the ACP input/output pipelines.
allen0304 commentedon Jul 25, 2026
Update: second
type: "acp"test + confirmed workaround (2026-07-25)Ran a second
type: "acp"test (after the earlier route-mode subagent fix) — same result, confirming the bug is stable and reproducible.type: "acp"test #2Confirmed workaround
The following combination works end-to-end (tested twice with ACP-spawned OpenCode CLI tasks):
type: "route"avoids the stdin delivery bugvisibleReplies: "automatic"avoids the subagent-"did not use the message tool" bugBoth bugs are specific to Telegram group topic routing metadata (threadId, delivery context) not being handled correctly in the ACP input/output pipelines.