From 26707f296c1f474ac32037bff54735f84031fd66 Mon Sep 17 00:00:00 2001 From: Phil Hie Date: Thu, 9 Jul 2026 18:27:27 +0200 Subject: [PATCH] fix(setup): don't auto-install plan-tune AUQ hooks in Conductor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PreToolUse question-preference-hook participates in the Agent-SDK canUseTool elicitation flow Conductor uses to render AskUserQuestion. Its presence corrupts that round-trip even when it returns `defer`, so AUQ comes back as [Tool result missing due to internal error] and no options render. Native AUQ works fine in Conductor until this hook is registered — the flakiness the backstop worked around is caused by the backstop itself. Codex is unaffected (it doesn't read settings.json), which is why AUQ breaks in Claude but not Codex on the same workspace. Stop treating a Conductor workspace as an implicit opt-in; fall through to the normal (non-interactive skip) decision so native AUQ keeps working. Explicit opt-in via --plan-tune-hooks / GSTACK_PLAN_TUNE_HOOKS / plan_tune_hooks config still installs the hooks. Refs #2207 --- setup | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/setup b/setup index 275236cd3..b298b7b46 100755 --- a/setup +++ b/setup @@ -1380,16 +1380,22 @@ if [ "$NO_TEAM_MODE" -ne 1 ] \ *) PT_DECISION="prompt" ;; esac - # Conductor host reliability: the PreToolUse preference hook also carries the - # Conductor-prose enforcement (deny the flaky mcp__conductor__AskUserQuestion, - # redirect to a prose decision brief). A Conductor workspace setup otherwise - # falls through to "prompt" → the non-interactive skip below, leaving Conductor - # users without that backstop. Treat Conductor as an implicit opt-in — but - # only on the silent fall-through, never overriding an explicit --no-plan-tune-hooks. - if [ "$PT_DECISION" = "prompt" ] && { [ -n "${CONDUCTOR_WORKSPACE_PATH:-}" ] || [ -n "${CONDUCTOR_PORT:-}" ]; }; then - PT_DECISION="yes" - _PT_CONDUCTOR_AUTO=1 - fi + # Conductor host: do NOT auto-install the plan-tune AUQ hooks here. + # + # The PreToolUse preference hook participates in the Agent-SDK `canUseTool` + # elicitation flow that Conductor uses to render AskUserQuestion. Its mere + # presence corrupts that round-trip — even when it returns `defer` — so the + # tool comes back as `[Tool result missing due to internal error]` and no + # options render. In other words, native AUQ works fine in Conductor UNTIL + # this hook is registered; the "flaky mcp__conductor__AskUserQuestion" this + # backstop was meant to work around is caused by the backstop itself. + # (Codex sessions never read ~/.claude/settings.json, so they're unaffected — + # which is why AUQ works in Codex but breaks in Claude on the same workspace.) + # + # Fall through to the normal decision below: a Conductor workspace with no + # explicit --plan-tune-hooks / GSTACK_PLAN_TUNE_HOOKS / plan_tune_hooks config + # takes the non-interactive skip and keeps native AUQ working. Users who + # genuinely want the prose backstop can still opt in explicitly. _install_plan_tune_hooks() { "$SETTINGS_HOOK" add-event \