Skip to content

Fix Request Changes in Conductor: register ExitPlanMode on PreToolUse#5

Merged
ndom91 merged 1 commit into
ndom91:mainfrom
plain-thinh-tran:conductor-plan-approval-bug
Jun 28, 2026
Merged

Fix Request Changes in Conductor: register ExitPlanMode on PreToolUse#5
ndom91 merged 1 commit into
ndom91:mainfrom
plain-thinh-tran:conductor-plan-approval-bug

Conversation

@plain-thinh-tran

@plain-thinh-tran plain-thinh-tran commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Problem

When running the plugin under Conductor, the annotator opens but Request Changes never reaches the agent.

Root cause

The annotator hook was registered on the PermissionRequest event. Conductor launches Claude Code with:

--permission-mode bypassPermissions --permission-prompt-tool stdio

In that configuration a PermissionRequest hook decision is never surfaced as the authoritative decision (Conductor routes ExitPlanMode through its own stdio prompt channel), so the hook's deny + feedback never made it back to the model.

Fix

Register the hook on PreToolUse instead. PreToolUse fires before the permission flow and regardless of --permission-mode, so a deny (Request Changes) is honored across hosts — plain Claude Code CLI, OpenCode, pi, and Conductor.

The hook output shape changes accordingly:

  • Approve → { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "allow" } }
  • Deny → { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: "..." } }

All consumers of the output (the OpenCode bridge in opencode/bridge.js and the pi extension in shared/piExtension.mjs), the shared validation in shared/planReview.mjs, the types, and the tests are updated to match.

The annotator hook was registered on the `PermissionRequest` event. In
Conductor — which launches Claude Code with `--permission-mode
bypassPermissions --permission-prompt-tool stdio` — a `PermissionRequest`
hook decision is never surfaced, so "Request Changes" feedback never made
it back to the model.

Switch the hook to `PreToolUse`, which fires before the permission flow
and regardless of permission mode, so a `deny` (Request Changes) is honored
across all hosts including Conductor. The hook output changes to the
PreToolUse shape (`permissionDecision` / `permissionDecisionReason`); the
OpenCode and pi bridges and all tests are updated to match.

Note: exiting plan mode on approve in Conductor is still owned by
Conductor's own plan-approval UI and is out of scope for this change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ndom91 ndom91 merged commit 29df0bb into ndom91:main Jun 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants