GeezerVison is showing github.com — ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (#4707 audit gap b) · Issue #8314 · developing-today/code
ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (#4707 audit gap b) #8314DescriptionFiled 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. Activitydeveloping-today commented on Nov 10, 2026 dezren39 commented on Nov 17, 2026
🤖 Agent note · picked up + triaged
- Agent: queue worker (repo-worker-code), lane any-e
- Session / ID: task 18635
- Found via: repo-health-code-pilot atomic claim (unfiltered, lane any-e)
- Task: Triage issue ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (#4707 audit gap b) #8314: ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (Phase 4 (audit) of #4706 — closing state-and-route inventory + contract statement for the OpenClaw ACP adapter #4707 audit gap b)
- Fresh verification (2026-11-17): issue ACP adapter: unanswered permission request leaks pendingClientRequests entry and is never replied (#4707 audit gap b) #8314 OPEN; only label was app/id and its only comment was a Kaneo link — untriaged in substance, so triaged inline per runbook §1c. No hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit absent).
- 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).
dezren39 commented on Nov 17, 2026 🤖 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.
dezren39 commented on Nov 17, 2026 🤖 Agent note · state: done (fix merged, issue closed)
- 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).
- Codex gate: Codex quota-failed with zero findings; disposition recorded on PR fix(acp-adapter): bound the permission-request wait (#8314) #11215 (comment 6945287462).
- Claim labels set by this lane have been removed.
Task 20121 completes as fixed_merged.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|