You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (#4707 audit gap b) #8314
Filed by the #4707 closing audit of design #4706 (task 12695, lane code-n, 2026-11-10). Evidence at origin/main 9b65fa2, bin/opencode-acp-adapter.mjs.
Gap
pendingClientRequests (:206) holds one entry per outbound session/request_permission (requestClient, :224-232); an entry is deleted only when the ACP client's response arrives (dispatch, response branch). The adapter sets no timeout anywhere on that wait.
If the client never answers:
the map entry leaks for the adapter's process lifetime (bounded only by process exit and by the number of unanswered asks — small, but unbounded within a long-lived process), and
handlePermissionAsked (:446ff) awaits forever, so the permission reply is never posted to the serve. No evidence in this repo shows the pinned serve expiring an unanswered permission.asked on its own clock, so the serve-side tool call the permission gates stays blocked until the session is interrupted or deleted.
Fix shape (named, not designed here)
Give the client request a bounded wait in the adapter: on expiry, resolve the permission flow through the path handlePermissionAsked already uses for a failed client request — post {decision: "reject"} to POST /api/session/:id/permission/:permId/reply — and delete the pendingClientRequests entry. The timeout value is the implementer's call, recorded on the PR; it should be generous enough for a human approver and finite.
Verdict: work kind task/small-fix · priority/normal · effort/s · kind/bug (labels applied this run, plus status/triaged and queue/queued for the follow-on)
Priority why: priority/normal — priorities brief line 5: everything else by usefulness; a bounded named fix for a real hang in the fleet's ACP adapter.
Evidence the gap is live on current main: bin/opencode-acp-adapter.mjs requestClient still registers pendingClientRequests entries with no timeout (the only setTimeout uses in the file are the event-stream and reconnect paths), entries are deleted only in the dispatch response branch, and handlePermissionAsked still awaits the client request — so an unanswered ask still leaks the entry and blocks the permission reply indefinitely, exactly as filed by the Phase 4 (audit) of #4706 — closing state-and-route inventory + contract statement for the OpenClaw ACP adapter #4707 audit.
First step: add the bounded wait in requestClient for permission requests; on expiry route through handlePermissionAsked's existing failed-request path (reject posted to the serve reply endpoint) and delete the pending entry. Timeout value is the implementer's call, recorded on the PR — generous for a human approver, finite.
Acceptance: unanswered request expires → reject posted + entry deleted; answered request behaves exactly as before; tests cover both paths.
Fix packet:repo-health:v1:fix:developing-today/code:issue:8314 → enqueued as task 20121 (queue repo-health-code-pilot, status queued).
🤖 Agent note · state: in progress (fix in PR #11215)
Agent: queue worker (repo-worker-code), lane any-e
Session / ID: task 20121
Found via: queue claim
PR #11215 bounds the ACP adapter's permission-request wait: requestClient entries in pendingClientRequests now expire after PERMISSION_REQUEST_TIMEOUT_MS (default 600,000 ms — generous for a human approver, finite so an abandoned ask cannot wedge a gated tool call; OPENCODE_ACP_PERMISSION_TIMEOUT_MS overrides). On expiry the entry is deleted and the request rejects through handlePermissionAsked's existing failed-request path, posting {decision: reject} to the serve reply endpoint. Answered requests are unchanged.
Verification: node --test bin/opencode-acp-adapter.test.mjs — 23 passed, 0 failed, including a new unanswered-expiry test (reject posted, late answer ignored) and the pre-existing answered round-trip test. PR #11215 closes this issue on merge; the timeout rationale is recorded on the PR as the acceptance requires.
Agent: queue worker (repo-worker-code), lane any-e
Session / ID: task 20121
Found via: queue claim
Task 20121 is done: PR #11215 MERGED (squash 554e1404a902f4bc4836a22ccff0df1fb15efdea, 2026-11-17T10:23:02Z), and this issue was closed by the merge.
The ACP adapter's permission-request wait is now bounded (PERMISSION_REQUEST_TIMEOUT_MS, default 600,000 ms, env-overridable; rationale on the PR): an unanswered session/request_permission expires, its pendingClientRequests entry is deleted, and the flow resolves through the existing failed-request path, posting the reject decision to the serve reply endpoint. Answered requests are unchanged.
Verification: node --test bin/opencode-acp-adapter.test.mjs — 23 passed, 0 failed (new unanswered-expiry test + pre-existing answered round-trip).
Activity
developing-today commentedon Nov 10, 2026
CODE-2481
dezren39 commentedon Nov 17, 2026
🤖 Agent note · picked up + triaged
task/small-fix· priority/normal · effort/s · kind/bug (labels applied this run, plus status/triaged and queue/queued for the follow-on)requestClientstill registerspendingClientRequestsentries with no timeout (the only setTimeout uses in the file are the event-stream and reconnect paths), entries are deleted only in the dispatch response branch, andhandlePermissionAskedstill awaits the client request — so an unanswered ask still leaks the entry and blocks the permission reply indefinitely, exactly as filed by the Phase 4 (audit) of #4706 — closing state-and-route inventory + contract statement for the OpenClaw ACP adapter #4707 audit.requestClientfor permission requests; on expiry route throughhandlePermissionAsked's existing failed-request path (reject posted to the serve reply endpoint) and delete the pending entry. Timeout value is the implementer's call, recorded on the PR — generous for a human approver, finite.repo-health:v1:fix:developing-today/code:issue:8314→ enqueued as task 20121 (queue repo-health-code-pilot, status queued).dezren39 commentedon Nov 17, 2026
🤖 Agent note · state: in progress (fix in PR #11215)
PR #11215 bounds the ACP adapter's permission-request wait:
requestCliententries inpendingClientRequestsnow expire afterPERMISSION_REQUEST_TIMEOUT_MS(default 600,000 ms — generous for a human approver, finite so an abandoned ask cannot wedge a gated tool call;OPENCODE_ACP_PERMISSION_TIMEOUT_MSoverrides). On expiry the entry is deleted and the request rejects throughhandlePermissionAsked's existing failed-request path, posting{decision: reject}to the serve reply endpoint. Answered requests are unchanged.Verification:
node --test bin/opencode-acp-adapter.test.mjs— 23 passed, 0 failed, including a new unanswered-expiry test (reject posted, late answer ignored) and the pre-existing answered round-trip test. PR #11215 closes this issue on merge; the timeout rationale is recorded on the PR as the acceptance requires.fix(acp-adapter): bound the permission-request wait (#8314) (#11215)
dezren39 commentedon Nov 17, 2026
🤖 Agent note · state: done (fix merged, issue closed)
Task 20121 is done: PR #11215 MERGED (squash
554e1404a902f4bc4836a22ccff0df1fb15efdea, 2026-11-17T10:23:02Z), and this issue was closed by the merge.PERMISSION_REQUEST_TIMEOUT_MS, default 600,000 ms, env-overridable; rationale on the PR): an unansweredsession/request_permissionexpires, itspendingClientRequestsentry is deleted, and the flow resolves through the existing failed-request path, posting the reject decision to the serve reply endpoint. Answered requests are unchanged.node --test bin/opencode-acp-adapter.test.mjs— 23 passed, 0 failed (new unanswered-expiry test + pre-existing answered round-trip).Task 20121 completes as
fixed_merged.