Fix Request Changes in Conductor: register ExitPlanMode on PreToolUse#5
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PermissionRequestevent. Conductor launches Claude Code with:In that configuration a
PermissionRequesthook decision is never surfaced as the authoritative decision (Conductor routes ExitPlanMode through its own stdio prompt channel), so the hook'sdeny+ feedback never made it back to the model.Fix
Register the hook on
PreToolUseinstead.PreToolUsefires before the permission flow and regardless of--permission-mode, so adeny(Request Changes) is honored across hosts — plain Claude Code CLI, OpenCode, pi, and Conductor.The hook output shape changes accordingly:
{ hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "allow" } }{ hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: "..." } }All consumers of the output (the OpenCode bridge in
opencode/bridge.jsand the pi extension inshared/piExtension.mjs), the shared validation inshared/planReview.mjs, the types, and the tests are updated to match.