gstack/hosts/claude/hooks
kalpajit279 78d7d30ec9 fix: pre-empt broken AskUserQuestion on the Claude Desktop host
The PreToolUse transport-avoidance in question-preference-hook only guarded
against Conductor. The Claude Desktop app (CLAUDE_CODE_ENTRYPOINT=claude-desktop)
advertises + enables AskUserQuestion (CLAUDE_CODE_ENABLE_ASK_USER_QUESTION_TOOL=true)
but its handler returns "[Tool result missing due to internal error]".

PostToolUse hooks do NOT fire on that transport-error path, so
auq-error-fallback-hook cannot rescue it after the fact — the model just sees the
raw error. Extend the existing PreToolUse deny to also fire when
CLAUDE_CODE_ENTRYPOINT=claude-desktop, redirecting to the same prose decision
brief. Generalize the reason label ([conductor] / [claude-desktop]).

Tests: mirror the ambient-env strip (delete CLAUDE_CODE_ENTRYPOINT) in the two
hook test runners so a suite run inside Claude Desktop stays deterministic, and
add a "Claude Desktop prose redirect" describe block paralleling the Conductor
cases.

Verified on claude.exe 2.1.197 (Windows): the identical AUQ call that returned
the missing-result error now returns the [claude-desktop] prose-redirect deny.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 23:42:21 +05:30
..
auq-error-fallback-hook v1.57.2.0 feat: AskUserQuestion prose fallback when the tool fails at runtime (#1908) 2026-06-07 21:38:21 -07:00
auq-error-fallback-hook.ts v1.57.2.0 feat: AskUserQuestion prose fallback when the tool fails at runtime (#1908) 2026-06-07 21:38:21 -07:00
question-log-hook v1.52.0.0 feat(plan-tune): explicit consent + first-run setup wizard for contributors (#1741) 2026-05-28 18:21:09 -07:00
question-log-hook.ts v1.52.0.0 feat(plan-tune): explicit consent + first-run setup wizard for contributors (#1741) 2026-05-28 18:21:09 -07:00
question-preference-hook v1.52.0.0 feat(plan-tune): explicit consent + first-run setup wizard for contributors (#1741) 2026-05-28 18:21:09 -07:00
question-preference-hook.ts fix: pre-empt broken AskUserQuestion on the Claude Desktop host 2026-07-01 23:42:21 +05:30