Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds hook-related context propagation in the chat workbench, primarily to support passing a transcript_path into hook command stdin, and to expose whether hooks are enabled on a chat request for extensions using the proposed private participant API.
Changes:
- Add
hasHooksEnabledto chat request objects (internal + proposedchatParticipantPrivateAPI) and populate it when building agent requests. - Extend hook execution to remember a per-session transcript path and include it as
transcript_pathin subsequent hook inputs. - Update hook stdin JSON serialization to convert URI-like values to filesystem paths.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts | Adds hasHooksEnabled to the proposed ChatRequest type. |
| src/vs/workbench/contrib/chat/common/participants/chatAgents.ts | Extends internal request shape with hasHooksEnabled. |
| src/vs/workbench/contrib/chat/common/hooks/hooksExecutionService.ts | Stores transcript path per session and injects transcript_path into hook inputs; adds URI JSON replacer for logging. |
| src/vs/workbench/contrib/chat/common/hooks/hooksCommandTypes.ts | Extends hook input type to include transcript_path and changes cwd typing. |
| src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts | Computes hasHooksEnabled from collected hooks and attaches to agent request. |
| src/vs/workbench/api/node/extHostHooksNode.ts | Serializes hook input with a replacer that converts UriComponents to fsPath before writing to stdin. |
| src/vs/workbench/api/common/extHostTypeConverters.ts | Plumbs hasHooksEnabled to the extension API surface with proposed-API gating. |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/hooks/hooksExecutionService.ts:332
- New behavior caches a session transcript path from the first hook input and forwards it to subsequent hook executions. There are already unit tests for HooksExecutionService; please add coverage to verify (1) transcript path extraction from input and (2) that
transcript_pathis included in later hook inputs when not explicitly passed again.
// Extract and store transcript_path from input when present (e.g. SessionStart)
const inputTranscriptPath = this._extractTranscriptPath(options?.input);
if (inputTranscriptPath) {
this._sessionTranscriptPaths.set(sessionKey, inputTranscriptPath);
}
zhichli
approved these changes
Feb 7, 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.
No description provided.