From b16d0e349428208e9f3b7e49f22c671e6371c56c Mon Sep 17 00:00:00 2001 From: danielplant Date: Wed, 5 Aug 2026 19:24:08 -0400 Subject: [PATCH 1/4] fix: restore Conductor AskUserQuestion popups --- SKILL.md | 9 +- autoplan/SKILL.md | 37 ++- benchmark-models/SKILL.md | 9 +- benchmark/SKILL.md | 9 +- bin/gstack-settings-hook | 55 +++-- browse/SKILL.md | 9 +- canary/SKILL.md | 37 ++- codex/SKILL.md | 37 ++- context-restore/SKILL.md | 37 ++- context-save/SKILL.md | 37 ++- cso/SKILL.md | 37 ++- design-consultation/SKILL.md | 37 ++- design-html/SKILL.md | 37 ++- design-review/SKILL.md | 37 ++- design-shotgun/SKILL.md | 37 ++- devex-review/SKILL.md | 37 ++- diagram/SKILL.md | 37 ++- document-generate/SKILL.md | 37 ++- document-release/SKILL.md | 37 ++- gstack-upgrade/migrations/v1.58.0.0.sh | 11 +- gstack-upgrade/migrations/v1.60.2.0.sh | 85 +++++++ health/SKILL.md | 37 ++- hosts/claude/hooks/auq-error-fallback-hook.ts | 198 ++++++++++++--- .../claude/hooks/question-preference-hook.ts | 97 ++++++-- investigate/SKILL.md | 37 ++- ios-clean/SKILL.md | 37 ++- ios-design-review/SKILL.md | 37 ++- ios-fix/SKILL.md | 37 ++- ios-qa/SKILL.md | 37 ++- ios-sync/SKILL.md | 37 ++- land-and-deploy/SKILL.md | 37 ++- landing-report/SKILL.md | 37 ++- learn/SKILL.md | 37 ++- make-pdf/SKILL.md | 9 +- office-hours/SKILL.md | 37 ++- open-gstack-browser/SKILL.md | 37 ++- pair-agent/SKILL.md | 37 ++- plan-ceo-review/SKILL.md | 37 ++- plan-design-review/SKILL.md | 37 ++- plan-devex-review/SKILL.md | 37 ++- plan-eng-review/SKILL.md | 37 ++- plan-tune/SKILL.md | 37 ++- qa-only/SKILL.md | 37 ++- qa/SKILL.md | 37 ++- retro/SKILL.md | 37 ++- review/SKILL.md | 37 ++- scrape/SKILL.md | 37 ++- .../preamble/generate-ask-user-format.ts | 28 ++- .../preamble/generate-preamble-bash.ts | 9 +- setup | 12 +- setup-browser-cookies/SKILL.md | 9 +- setup-deploy/SKILL.md | 37 ++- setup-gbrain/SKILL.md | 37 ++- ship/SKILL.md | 37 ++- skillify/SKILL.md | 37 ++- spec/SKILL.md | 74 ++++-- sync-gbrain/SKILL.md | 37 ++- test/auq-error-fallback-hook.test.ts | 228 ++++++++++++++++-- test/fixtures/golden/claude-ship-SKILL.md | 37 ++- test/fixtures/golden/codex-ship-SKILL.md | 37 ++- test/fixtures/golden/factory-ship-SKILL.md | 37 ++- .../gstack-settings-hook-schema-aware.test.ts | 76 ++++++ ...gstack-upgrade-migration-v1_60_2_0.test.ts | 130 ++++++++++ test/helpers/carve-guards.ts | 10 +- test/helpers/touchfiles.ts | 9 +- test/memory-cache-injection.test.ts | 2 +- test/question-preference-hook.test.ts | 142 +++++++++-- test/resolver-ask-user-format.test.ts | 44 ++-- ...kill-e2e-auq-unavailable-fallback.test.ts} | 32 +-- test/skill-e2e-auto-decide-preserved.test.ts | 4 +- 70 files changed, 2145 insertions(+), 820 deletions(-) create mode 100755 gstack-upgrade/migrations/v1.60.2.0.sh create mode 100644 test/gstack-upgrade-migration-v1_60_2_0.test.ts rename test/{skill-e2e-conductor-prose.test.ts => skill-e2e-auq-unavailable-fallback.test.ts} (50%) diff --git a/SKILL.md b/SKILL.md index aaa5612dd4..7b124bce62 100644 --- a/SKILL.md +++ b/SKILL.md @@ -47,10 +47,11 @@ echo "REPO_MODE: $REPO_MODE" _SESSION_KIND=$(~/.claude/skills/gstack/bin/gstack-session-kind 2>/dev/null || echo "interactive") case "$_SESSION_KIND" in spawned|headless|interactive) ;; *) _SESSION_KIND="interactive" ;; esac echo "SESSION_KIND: $_SESSION_KIND" -# Conductor host: AskUserQuestion is unreliable here (native disabled, MCP -# variant flaky), so skills render decisions as prose instead of calling the -# tool. Gated on !headless so an eval/CI run INSIDE Conductor (GSTACK_HEADLESS) -# still BLOCKs rather than rendering prose to nobody. +# Conductor host: native AskUserQuestion is disabled (--disallowedTools), so +# route clickable questions through mcp__conductor__AskUserQuestion with plain +# STRING options (see the AskUserQuestion Format section). Signal it here so +# skills pick the right tool + payload shape. Gated on !headless so an eval/CI +# run INSIDE Conductor (GSTACK_HEADLESS) still BLOCKs rather than prompting nobody. if [ "$_SESSION_KIND" != "headless" ] && { [ -n "${CONDUCTOR_WORKSPACE_PATH:-}" ] || [ -n "${CONDUCTOR_PORT:-}" ]; }; then echo "CONDUCTOR_SESSION: true" fi diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 5346f1d437..b20766bfbb 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -57,10 +57,11 @@ echo "REPO_MODE: $REPO_MODE" _SESSION_KIND=$(~/.claude/skills/gstack/bin/gstack-session-kind 2>/dev/null || echo "interactive") case "$_SESSION_KIND" in spawned|headless|interactive) ;; *) _SESSION_KIND="interactive" ;; esac echo "SESSION_KIND: $_SESSION_KIND" -# Conductor host: AskUserQuestion is unreliable here (native disabled, MCP -# variant flaky), so skills render decisions as prose instead of calling the -# tool. Gated on !headless so an eval/CI run INSIDE Conductor (GSTACK_HEADLESS) -# still BLOCKs rather than rendering prose to nobody. +# Conductor host: native AskUserQuestion is disabled (--disallowedTools), so +# route clickable questions through mcp__conductor__AskUserQuestion with plain +# STRING options (see the AskUserQuestion Format section). Signal it here so +# skills pick the right tool + payload shape. Gated on !headless so an eval/CI +# run INSIDE Conductor (GSTACK_HEADLESS) still BLOCKs rather than prompting nobody. if [ "$_SESSION_KIND" != "headless" ] && { [ -n "${CONDUCTOR_WORKSPACE_PATH:-}" ] || [ -n "${CONDUCTOR_PORT:-}" ]; }; then echo "CONDUCTOR_SESSION: true" fi @@ -342,20 +343,28 @@ AI orchestrator (e.g., OpenClaw). In spawned sessions: "AskUserQuestion" can resolve to two tools at runtime: the **host MCP variant** (e.g. `mcp__conductor__AskUserQuestion` — appears in your tool list when the host registers it) or the **native** Claude Code tool. -**Conductor rule (read before the MCP rule):** if `CONDUCTOR_SESSION: true` was echoed by the preamble, do NOT call AskUserQuestion at all — neither native nor any `mcp__*__AskUserQuestion` variant. Render EVERY decision brief as the **prose form** below and STOP. This is proactive, not a reaction to a failure: Conductor disables native AUQ and its MCP variant is flaky (it returns `[Tool result missing due to internal error]`), so prose is the reliable path. **Auto-decide preferences still apply first:** if a `[plan-tune auto-decide]