Skip to content

Rename and clarify internal vs external chat hook types#292979

Merged
roblourens merged 6 commits intomainfrom
roblou/burning-ladybug
Feb 5, 2026
Merged

Rename and clarify internal vs external chat hook types#292979
roblourens merged 6 commits intomainfrom
roblou/burning-ladybug

Conversation

@roblourens
Copy link
Member

Introduce clearer distinctions between internal and external hook types, enhancing the structure and readability of the code. Update relevant references in the codebase to reflect these changes.

Copilot AI review requested due to automatic review settings February 5, 2026 00:45
@roblourens roblourens enabled auto-merge (squash) February 5, 2026 00:45
@roblourens roblourens self-assigned this Feb 5, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 5, 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

This PR refactors the chat hooks type system by introducing clear separation between internal and external hook types. The changes split type definitions into two new files to better distinguish between types used within VS Code (camelCase) and types that cross the process boundary to external commands (snake_case for hook-specific fields).

Changes:

  • Created hooksInternalTypes.ts for VS Code-internal types with camelCase naming (IPreToolUseCallerInput, IHookResult, IPreToolUseHookResult)
  • Created hooksExternalTypes.ts for external command contract types with snake_case for hook-specific input fields (IPreToolUseCommandInput with tool_name, tool_input, tool_use_id)
  • Refactored hooksExecutionService.ts to import from new files and added conversion logic between internal and external representations
  • Renamed toolArgs to toolInput and added toolCallId field to better align with standard naming
  • Introduced hookSpecificOutput wrapper structure in command output for clearer organization
  • Updated languageModelToolsService.ts to use the new interface
  • Updated tests to reflect the new wrapper structure and field names

Reviewed changes

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

Show a summary per file
File Description
hooksInternalTypes.ts New file defining internal types used within VS Code with camelCase naming and validators for hook output
hooksExternalTypes.ts New file defining external command contract types with mixed naming convention
hooksExecutionService.ts Refactored to import types from new files, added conversion logic between internal/external formats, and re-exports types for consumers
languageModelToolsService.ts Updated to use renamed field toolInput and added toolCallId parameter
hooksExecutionService.test.ts Updated tests to expect new hookSpecificOutput wrapper structure
languageModelToolsService.test.ts Updated test assertion to use renamed toolInput field

pwang347
pwang347 previously approved these changes Feb 5, 2026
@roblourens roblourens merged commit 10f0654 into main Feb 5, 2026
22 checks passed
@roblourens roblourens deleted the roblou/burning-ladybug branch February 5, 2026 01:31
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.

3 participants