Repository navigation
Open
Labels
priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/queuedHas a queued task in the Supabase agent queueHas a queued task in the Supabase agent queuesource/design-architectFiled by the repo design architect jobFiled by the repo design architect jobsource/pr-comment-reviewFiled by the pr-comment-review jobFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Finding (from PR review)
If the SSE event stream drops during an active prompt and the server completes that prompt before reconnection, the prompt's final session.idle event is lost and the ACP request hangs forever. Codex (P2, PR #3997):
This reconnect path neither resolves or rejects pending prompts nor queries their current status, and
session/prompthas no other completion mechanism. The ACP request therefore remains pending indefinitely, with subsequent prompts rejected as already in flight even after the stream reconnects. Reconcile pending sessions after reconnecting, or explicitly fail their outstanding requests when event continuity is lost.
Evidence
- Source PR: feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 — feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 (merged 2026-11-02 as-is)
- Review comment: feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 (comment) — chatgpt-codex-connector[bot], 2026-11-01T21:31:18Z,
bin/opencode-acp-adapter.mjs:189 - No-response evidence: the review thread is unresolved (GraphQL
reviewThreads, checked 2026-11-02), the comment has no replies, and PR feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 contains a single commit (8e67215, 2026-11-01T21:26:51Z) that predates the comment — no fix followed it before merge. - Still live on current main (verified by raw read 2026-11-02):
bin/opencode-acp-adapter.mjs:185-190— the event-stream loop logs "reconnecting" and retries after 1s; nothing reconciles, resolves, or rejects entries inpendingPromptson reconnect.
Acceptance criteria
- After an event-stream reconnect, pending prompts are reconciled against the server's current session state (resolved/rejected accordingly) or explicitly failed when event continuity was lost.
- A test simulates a stream drop + completion during the gap and shows the prompt does not remain pending indefinitely.
- Or the finding is resolved by a documented decision on this issue.
Metadata
Metadata
Assignees
Labels
priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/queuedHas a queued task in the Supabase agent queueHas a queued task in the Supabase agent queuesource/design-architectFiled by the repo design architect jobFiled by the repo design architect jobsource/pr-comment-reviewFiled by the pr-comment-review jobFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon Nov 2, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 2, 2026
🤖 Agent note · triaged — CONFIRMED on current main
9f730f1c22efc3ebc4605c63d7813e962f596ec5(2026-11-02).Fresh evidence (all read this shift via
gh):bin/opencode-acp-adapter.mjs(496 lines on current main),runEventStream(:162-191): the loop fetchesGET /event, and on stream close logsevent stream closed; reconnecting, on error logs…; reconnecting, waits 1000 ms (:189) and retries. Nothing in the loop reads or touchespendingPrompts— no reconciliation, no status query, no resolve/reject on reconnect.pendingPrompts(:127) entries are removed only byfinishPrompt(:286-294), which is called only fromhandleServeEventon asession.idleevent (:307-313) or asession.errorevent (:314-320), plus a delete when theprompt_asyncPOST itself throws (:413). Asession.idleemitted server-side while the stream is down never reacheshandleServeEvent, so the entry — and the deferred ACP response — stays pending forever. There is no pending-prompt timeout anywhere in the file (the onlysetTimeouts are the event-stream ready wait at :154 and the 1 s reconnect delay at :189).session/prompt(:399-401) throwsalready has a prompt in flightwhile an entry lingers, so later prompts for that session are rejected indefinitely even after the stream reconnects — exactly the Codex P2 on PR feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 (comment r4437436115).bin/opencode-acp-adapter.test.mjs(262 lines) drives a stub SSE stream and covers completion onsession.idle, but contains no reconnect/drop test (no occurrence ofreconnectin the file).Routing: a
small_fixfollow-up task has been enqueued from this triage: on event-stream reconnect, reconcile each pending prompt against the server's current session state (resolve/reject accordingly) or explicitly fail it when event continuity was lost, plus a drop-and-complete test using the existing stub harness. Note for sequencing: issue #4614 (triage task 6516) covers migrating this same adapter to the standing server's v2 session contract — if that migration lands first, implement the reconciliation against the v2 contract instead of the v1prompt_asyncflow.dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
9f730f1c(full evidence in the triage note above on issue openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617). Follow-up fix enqueued as task 6535 (small_fix: reconcile pending prompts on event-stream reconnect + drop-and-complete test); issue openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617 stays OPEN pending that fix.57 remaining items
developing-today commentedon Nov 8, 2026
🤖 Agent note · done
a23b3ce454:bin/opencode-acp-adapter.mjs:196—pendingPromptsMap (acpSessionId → {requestId}).runEventStream(~lines 229–259) — on stream close/error it logs "reconnecting", waits 1s, and reconnects; it never reconciles, resolves, or rejects entries inpendingPromptsand never queries current session status. Entries are removed only on terminal serve events, prompt-post error, or cancel — all event-driven — so a terminal event lost during a disconnect still hangs the ACP request indefinitely and later prompts are rejected as already in flight.bin/opencode-acp-adapter.test.mjs(375 lines) has no reconnect/stream-drop test.repo-health:v1:fix:developing-today/code:issue:4617), scoped to the reconnect-reconciliation remainder only. Per Drew's triage doctrine (code#7016), this triage completion does not close issue openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617; it returns to the queue for real work as task 12842.developing-today commentedon Nov 8, 2026
🤖 Agent note · picked up
developing-today commentedon Nov 8, 2026
🤖 Agent note · triaged (remainder after partial verification)
Verdict: REAL AND CURRENT (verified fresh 2026-11-08, lane code-t):
discussion_r4437436115never answered) is still live on origin/mainb7b7f596e4e9.bin/opencode-acp-adapter.mjs,runEventStream's reconnect loop (~lines 230–262) logs "event stream closed; reconnecting", waits 1s, and retries — nothing reconciles, resolves, or rejectspendingPromptson reconnect. Prompt completion is deferred entirely to serve terminal events (session/promptregisterspendingPromptsand returns undefined;finishPromptfires onsession.execution.succeeded/.failed), so a terminal event lost during a drop leaves the ACP request pending indefinitely, and the next prompt is rejected as already in flight (~line 469) even after reconnect.bin/opencode-acp-adapter.test.mjsis on main alongside the adapter.Disposition: the fix packet for this issue already exists in the queue as task 12842 (dedupe
repo-health:v1:fix:developing-today/code:issue:4617, queued 2026-11-08T04:59:48Z — my enqueue attempt deduped against it, no duplicate created). Its scope is the acceptance on this issue: reconcile pending prompts against server session state after reconnect (or explicitly fail them when continuity was lost), plus the drop+completion regression test, preserving the #4618 cancel-marker semantics. Issue #4617 stays OPEN.