Hook-denied (PreToolUse deny) tool calls are invisible in the chat UI — add a way to surface them
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Feature request
When a `PreToolUse` hook denies a tool call, the blocked invocation is **completely hidden from the chat UI**. The model's attempt only appears in the agent debug log (`github.copilot.chat.agentDebugLog.enabled` / "Developer: Show Agent Debug Logs") — it never shows up in the conversation, so there is no in-chat feedback that the model tried a tool and was blocked.
### Current behavior (by design in code)
- `_handlePreToolUseDenial` in `src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.ts` sets the invocation's `presentation` to `ToolInvocationPresentation.Hidden` (around lines 437 and 446).
- `IChatToolInvocation.isEffectivelyHidden()` (`src/vs/workbench/contrib/chat/common/chatService/chatService.ts`) then returns `true`, so `ChatToolInvocationPart` renders an empty node (`src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts:76`).
- There is no user setting that overrides this. The only visibility-adjacent settings (`chat.agent.thinking.collapsedTools`, terminal collapse settings) affect calls that are already shown.
### Problem
When authoring or debugging hooks, there is no way to tell from the chat that a tool was attempted and denied. Users must dig through the agent debug logs to even discover the model tried the tool. This makes `PreToolUse` deny hooks hard to trust and iterate on.
### Proposal (any one of these would help)
1. Render denied tool calls in chat as a collapsed/dimmed "blocked by hook" entry showing the tool name and `permissionDecisionReason`, instead of hiding them entirely.
2. Add a setting (e.g. `chat.tools.showBlockedInvocations`) to opt into showing hook-denied tool calls in the chat.
3. At minimum, document that a hook's `systemMessage` output field is currently the only supported way to surface a block in chat.
### Environment
- VS Code Insiders, agent mode with GitHub Copilot Chat
- Custom `.github/hooks/` `PreToolUse` hook returning `permissionDecision: "deny"`
Contributor guide
Assessment
This issue has not been assessed yet.