Rename and clarify internal vs external chat hook types#292979
Merged
roblourens merged 6 commits intomainfrom Feb 5, 2026
Merged
Rename and clarify internal vs external chat hook types#292979roblourens merged 6 commits intomainfrom
roblourens merged 6 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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.tsfor VS Code-internal types with camelCase naming (IPreToolUseCallerInput, IHookResult, IPreToolUseHookResult) - Created
hooksExternalTypes.tsfor external command contract types with snake_case for hook-specific input fields (IPreToolUseCommandInput with tool_name, tool_input, tool_use_id) - Refactored
hooksExecutionService.tsto import from new files and added conversion logic between internal and external representations - Renamed
toolArgstotoolInputand addedtoolCallIdfield to better align with standard naming - Introduced
hookSpecificOutputwrapper structure in command output for clearer organization - Updated
languageModelToolsService.tsto 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
previously approved these changes
Feb 5, 2026
benvillalobos
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.