PreToolUse hook "ask" creates an unanswerable confirmation for tools declaring presentation: "hidden", hanging the session
@justschen is already working on this.
Since Sep 18, 2026.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.7k
- PR merge metrics
- PR metrics pending
Description
When a PreToolUse hook returns permissionDecision: "ask" for a tool whose prepareInvocation returns presentation: "hidden", the confirmation is constructed and awaited but never rendered. The tool call hangs indefinitely with no way to answer it. The only exit is interrupting the session.
Repro (VS Code Insiders 1.138.0-insider)
- Add a PreToolUse hook returning {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"ask","permissionDecisionReason":"test"}} for fetch_webpage.
- Ask the agent to fetch any URL.
- The turn stalls. No confirmation appears anywhere in the chat.
Observed: a tool_call record pending 357200ms, terminated only by user interrupt with ERROR: Canceled. The turn_start had no matching turn_end. No record carried a non-ok status.
Cause
- resolveAutoConfirmFromHook handles ask by setting confirmationMessages.title, allowAutoConfirm: false, and autoConfirmed: undefined, then reaching awaitConfirmation. It never clears the invocation's presentation.
- copilot_fetchWebPage declares prepareInvocation → { presentation: "hidden" }.
- ChatToolInvocationPart returns before building any DOM when presentation === "hidden".
- The confirmation carousel also excludes hidden invocations, even while state is WaitingForConfirmation.
Net effect: a confirmation exists in the model, is awaited, and has no UI surface.
Suggested fix: when a hook forces confirmation, clear or override presentation so the invocation renders. Alternatively, treat ask on a hidden-presentation tool as unsupported and fall back to deny with the reason, rather than deadlocking.
Related: #325742 covers the deny case (visibility). This is the ask case (deadlock).
VS Code: 1.138.0-insider
Commit: 60ac69b364809ee6976d6dc3ed74cc7628f637da
Copilot Chat: 0.66.2026091101 (GitHub.copilot-chat)
OS: macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.