Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Description
In OpenCode 1.18.3, a headless subagent can deadlock when repeated parallel tool calls trigger a doom_loop permission request.
Observed sequence:
- A subagent submitted three identical
go test -race -shuffle=on -count=1 ./...Bash calls in one parallel batch. - All three commands finished successfully and produced output with exit code 0.
- OpenCode created a pending permission request with
permission: "doom_loop"andpatterns: ["bash"]. - The session processor waited at the permission Deferred. The successful tool results were not settled, all three Bash parts remained
running, and the synchronous parent task waited indefinitely. - Replying
onceto that permission request immediately allowed all three parts to becomecompletedwith exit code 0 and the subagent resumed.
Expected behavior:
- A permission request from a headless/subagent session should be routed to a responder or explicitly rejected/timed out instead of waiting forever.
- A permission wait should not prevent already-finished parallel tool invocations from settling their results.
This overlaps with #22167 and #13715, but the additional symptom here is that already-successful parallel tool calls remain running because their results are not consumed while the processor is waiting on Permission.ask. PR #32301 may improve nested permission routing, but it does not appear to cover this result-settlement behavior.
Plugins
oh-my-openagent (subagent orchestration)
OpenCode version
1.18.3
Steps to reproduce
- Run OpenCode in a headless/server context with the default
doom_loop: askbehavior and no permission responder attached to the child session. - Start a synchronous subagent task.
- In one tool turn, have the subagent issue the same Bash command three times in parallel. The observed command was
go test -race -shuffle=on -count=1 ./.... - Wait for the
doom_looppermission request. - Observe that the commands have produced successful output, but their tool parts remain
runningand the parent task does not return. - Reply
onceto the pending permission request. The completed results settle immediately and the child session continues.
Screenshot and/or share link
No public share link. The state was verified through the local server permission endpoint, session event log, and tool-part records.
Operating System
Ubuntu 24.04.4 LTS, Linux aarch64
Terminal
Headless OpenCode server/API
Reacted by Jason Casden
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Jul 19, 2026
This issue might be a duplicate of existing issues. Please check:
opencode serve+opencode attachif any permission is set to "ask" #16367: Agent hangs indefinitely withopencode servewhendoom_looppermission is set toaskin headless mode — same root cause of permission waiting without a responderThe additional symptom you've identified (already-completed parallel tool calls remaining
runningwhile the processor waits onPermission.ask) adds a new angle beyond what those issues cover, so if you feel this is distinct enough, feel free to leave it open for maintainer review.github-actions commentedon Sep 17, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.