Repository navigation
Conversation
OpenCode 1 reported permission/question replies as generic `active`, which the lifecycle tool-flight precedence suppresses while the session is blocked, so a session stayed in Needs You until the turn ended. Report `permission-resolved` (the turn-boundary event the OpenCode 2 plugin already emits) and map it to active in the OpenCode 1 deriver. Fixes OrchestratorInc#7564
🏆 Review leaderboardOct 26, 2026–Nov 2, 2026 · UTC
Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded. Show 7 more reviewers
|
Meraj-08
left a comment
There was a problem hiding this comment.
Thanks, the single-prompt case works: on real OpenCode 1.18.18, answering "Allow once" now returns the session to active within 2s and ao send is delivered, where main stays blocked and refuses it. Reject behaves the same as before.
[P1] With two prompts open, the first reply lets AO type into the second dialog. When the model makes two bash calls in one step, OpenCode 1 shows a second permission prompt after the first is answered. On c0285d65c9, the first reply moves the session to active while that prompt is still on screen, so ao send is accepted and its keystrokes go into the dialog. The message never reached the agent, and the dialog moved to OpenCode's "Allow always" confirmation for whoami *, one Enter away from a standing grant. main refuses the send in this state. Could the plugin track open asks by their request id and send permission-resolved only once none remain?
OpenCode can hold several permission/question dialogs at once. The plugin reported every reply, so answering the first of two prompts sent AO back to active while the second dialog was still on screen - `ao send` was accepted again and its keystrokes typed into that dialog instead of reaching the agent. The plugin now tracks open asks by their request id and emits the turn-boundary permission-resolved event only when the last dialog closes; while one remains open there is no report, the session stays blocked, and AO keeps refusing sends. Replies that carry no matching id fall back to closing the oldest tracked ask. Addresses the review P1 on PR OrchestratorInc#7596.
|
Addressed the P1 in 89c44aa: the plugin now tracks open asks by their request id ( |
Meraj-08
left a comment
There was a problem hiding this comment.
LGTM. Reviewed through 89c44aa355 on real OpenCode 1.18.18: with two prompts open, answering the first now keeps the session blocked and ao send refused until the second is answered, and a single prompt still returns to active within 2s.
Code changes: +10 -5
Tests: +7 -0
Others: +0 -0
Problem
On OpenCode 1, answering a permission or question prompt (approve or reject) left the AO session blocked in Needs You until the whole turn ended. Everything delivered to the session in that window was refused.
The plugin forwarded the reply as generic
active, but the lifecycle tool-flight precedence deliberately suppresses genericactivewhile a dialog is open (it must not let sibling tool traffic clear a live dialog), and the OpenCode payload carries no tool identity, so no correlated tool post could clear it either. Only a turn-boundary event lifts the block.Fix
permission.replied,question.replied, andquestion.rejectedaspermission-resolved— the same turn-boundary event the OpenCode 2 plugin already emits — instead of genericactive.permission-resolvedto active. The lifecycle reducer already treats that event as definitive, so the block clears as soon as the user answers, and the session returns to idle at the turn end.Verification
go test ./internal/adapters/agent/opencode/...permission-resolvedand that the event is wired throughao hooks opencode.active→permission-resolved→ active) is already pinned byTestToolPrecedence_DefinitivePermissionResolutionClearsBlocked.Fixes #7564