Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new PreCompact hook type to the chat prompt-syntax hooks system so it can be configured in hooks.json, displayed/validated via schema metadata, and parsed/collected from supported hook file formats.
Changes:
- Extend
HookType/HOOK_TYPES/IChatRequestHooksand JSON schema to includePreCompact. - Add Claude compatibility mapping for
PreCompact. - Ensure parsed hooks collection in
PromptsServiceinitializes storage forPreCompact.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts | Initializes the per-hook-type collection map with a PreCompact bucket so parsed hooks can be retained. |
| src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.ts | Defines the new hook type and exposes it via metadata + schema so it can be authored/validated. |
| src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.ts | Maps Claude’s PreCompact hook identifier to the new HookType.PreCompact. |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.ts:25
parseCopilotHookssupports Copilot CLI-style camelCase hook ids viaresolveCopilotCliHookType(...), buthookCopilotCliCompat.tsdoes not map apreCompactid toHookType.PreCompact. That means a hooks.json authored in Copilot CLI format usingpreCompactwill be silently ignored; consider adding the missing mapping soPreCompactworks across supported formats.
PreCompact = 'PreCompact',
SubagentStart = 'SubagentStart',
SubagentStop = 'SubagentStop',
Stop = 'Stop',
bhavyaus
approved these changes
Feb 7, 2026
daviddossett
pushed a commit
to daviddossett/vscode
that referenced
this pull request
Feb 7, 2026
* Support PreCompact hook * add this
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.
No description provided.