Skip to content

Conversation

@roblourens
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 04:52
@roblourens roblourens self-assigned this Feb 11, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new chat hook type for handling tool failures so hook configuration, parsing, and the proposed API type surface can represent a distinct “post tool use (failure)” lifecycle event.

Changes:

  • Extended the proposed ChatHookType union to include PostToolUseFailure.
  • Added PostToolUseFailure to the internal hook type enum/metadata and JSON schema for hook files.
  • Updated hook parsing/collection to recognize and collect PostToolUseFailure entries (including Claude compat mapping).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/vscode-dts/vscode.proposed.chatHooks.d.ts Extends the proposed API hook type union with PostToolUseFailure.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts Ensures hooks of the new type are collected during hook discovery/parse.
src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.ts Adds the new hook type to the enum, UI metadata list, and hook JSON schema.
src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.ts Adds Claude-format name mapping for PostToolUseFailure.

Comment on lines 14 to 20
export const CLAUDE_HOOK_TYPE_MAP: Record<string, HookType> = {
'SessionStart': HookType.SessionStart,
'UserPromptSubmit': HookType.UserPromptSubmit,
'PreToolUse': HookType.PreToolUse,
'PostToolUse': HookType.PostToolUse,
'PostToolUseFailure': HookType.PostToolUseFailure,
'PreCompact': HookType.PreCompact,
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add/extend unit tests to cover the new Claude hook type mapping for PostToolUseFailure (e.g. resolveClaudeHookType('PostToolUseFailure'), getClaudeHookTypeName(HookType.PostToolUseFailure), and parsing a Claude-format JSON that uses PostToolUseFailure). Right now the test suite only asserts a couple of hook types, so regressions in this new mapping wouldn’t be caught.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants