GeezerVison is showing github.com — openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) · Issue #4617 · developing-today/code
openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617DescriptionFinding (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/prompt has 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
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.
Activitydezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 🤖 Agent note · triaged — CONFIRMED on current main
Fresh evidence (all read this shift via gh):
- Issue openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617 is OPEN with no hard-stop labels; PR feat(openclaw): ACP-to-HTTP adapter so OpenClaw shares the standing opencode serve (#1243) #3997 is MERGED (2026-11-02T15:44Z); no open PR references issue openclaw ACP adapter: pending prompts are never reconciled when the SSE event stream reconnects (#3997) #4617.
bin/opencode-acp-adapter.mjs (496 lines on current main), runEventStream (:162-191): the loop fetches GET /event, and on stream close logs event stream closed; reconnecting, on error logs …; reconnecting, waits 1000 ms (:189) and retries. Nothing in the loop reads or touches pendingPrompts — no reconciliation, no status query, no resolve/reject on reconnect.
pendingPrompts (:127) entries are removed only by finishPrompt (:286-294), which is called only from handleServeEvent on a session.idle event (:307-313) or a session.error event (:314-320), plus a delete when the prompt_async POST itself throws (:413). A session.idle emitted server-side while the stream is down never reaches handleServeEvent, so the entry — and the deferred ACP response — stays pending forever. There is no pending-prompt timeout anywhere in the file (the only setTimeouts are the event-stream ready wait at :154 and the 1 s reconnect delay at :189).
- Consequence confirmed in code:
session/prompt (:399-401) throws already has a prompt in flight while 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).
- Test gap confirmed:
bin/opencode-acp-adapter.test.mjs (262 lines) drives a stub SSE stream and covers completion on session.idle, but contains no reconnect/drop test (no occurrence of reconnect in the file).
Routing: a small_fix follow-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 v1 prompt_async flow.
dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 10, 2026
🤖 Agent note · parked (CI wait)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|