Skip to content

hook streaming first pass#293514

Merged
justschen merged 10 commits intomainfrom
justin/musharna
Feb 7, 2026
Merged

hook streaming first pass#293514
justschen merged 10 commits intomainfrom
justin/musharna

Conversation

@justschen
Copy link
Copy Markdown
Collaborator

@justschen justschen commented Feb 6, 2026

adds specific hook part for rendering

Screenshot 2026-02-06 at 11 27 38 AM (1) Screenshot 2026-02-06 at 11 27 45 AM (1) Screenshot 2026-02-06 at 2 57 50 PM

cc @pwang347 @roblourens

justschen and others added 3 commits February 5, 2026 19:40
…chatHookContentPart.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 6, 2026 19:40
Copy link
Copy Markdown
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 introduces a new chat progress “hook” part so hook execution results can be streamed from extensions, persisted in chat sessions, and rendered in the chat UI.

Changes:

  • Adds proposed API surface for ChatResponseHookPart and a hookProgress(...) helper on ChatResponseStream.
  • Extends the internal chat model/progress unions and session operation log schema to recognize the new kind: 'hook' part.
  • Implements a new UI content part (ChatHookContentPart) and wires it into the chat list renderer.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts Adds proposed API types + stream method for reporting hook execution results.
src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.ts Updates persistence equality logic to account for the new hook part kind.
src/vs/workbench/contrib/chat/common/model/chatModel.ts Adds hook to response/history unions and response stringification ignore list.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Defines ChatHookType, ChatHookOutcome, and IChatHookPart and includes it in IChatProgress.
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Routes kind: 'hook' content to a dedicated renderer content part.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css Styles hook outcome icon and hook detail display.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.ts Implements the collapsible hook result UI component.
src/vs/workbench/api/common/extHostTypes.ts Adds ext host-side ChatResponseHookPart type for the API implementation.
src/vs/workbench/api/common/extHostTypeConverters.ts Adds DTO conversions and part detection for ChatResponseHookPart.
src/vs/workbench/api/common/extHostChatAgents2.ts Adds hookProgress(...) streaming method implementation in the ext host response stream.
src/vs/workbench/api/common/extHost.api.impl.ts Exposes ChatResponseHookPart constructor on the proposed API object.

Comment thread src/vs/workbench/api/common/extHostChatAgents2.ts Outdated
@justschen justschen marked this pull request as ready for review February 6, 2026 21:40
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 6, 2026
Comment thread src/vs/workbench/api/common/extHostTypes.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/chatService/chatService.ts Outdated
Comment thread src/vs/workbench/api/common/extHostTypes.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/chatService/chatService.ts Outdated
pwang347
pwang347 previously approved these changes Feb 6, 2026
dmitrivMS
dmitrivMS previously approved these changes Feb 6, 2026
@justschen justschen dismissed stale reviews from dmitrivMS and pwang347 via e42067a February 6, 2026 23:27
pwang347
pwang347 previously approved these changes Feb 6, 2026
@justschen justschen merged commit 92f3084 into main Feb 7, 2026
18 checks passed
@justschen justschen deleted the justin/musharna branch February 7, 2026 00:03
daviddossett pushed a commit to daviddossett/vscode that referenced this pull request Feb 7, 2026
* hooks streaming first pass

* Update src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update styling

* modify api shape

* address some comments + do not render for now

* new icons + no more continue

* make sure we render right, some comments addressed

* uncomment that stuffs

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pwang347 pushed a commit that referenced this pull request Feb 10, 2026
* hooks streaming first pass

* Update src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update styling

* modify api shape

* address some comments + do not render for now

* new icons + no more continue

* make sure we render right, some comments addressed

* uncomment that stuffs

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sbatten pushed a commit that referenced this pull request Feb 11, 2026
* Add initial hooks support (#292699)

* Restructure hook execution to always go through the renderer process (#292763)

* Restructure hook execution to always go through the renderer process
Add output channel

* cleanup

* Fixes

* Hooks format cleanup (#292928)

* Add diagnostics for hooks (#292912)

* preToolUse hook supporting "deny" (#292890)

* preToolUse hook supporting "deny"

* Fix tests

* Simplify tests

* Fix test

* Add common output hook types and reorganize related code (#292961)

* Add common output hook types, reorganize a bit more

* test fixes

* Fix extHostHooks for web (#292968)

* Rename and clarify internal vs external chat hook types (#292979)

* Make explicit chat hook "internal" vs "external" types

* Renames

* Avoid types re-export

* Move to hooks/

* This

* Updates for chat extension hooks (#292991)

* Enhance preToolUse hook and clean up code (#293265)

* Flesh out preToolUse hook

* Cleanup

* cleanups

* Cleanup

* String update (#293298)

* PostToolUse hook (#293282)

* Add onDidExecuteHook event to HooksExecutionService (#293279)

* Add onDidExecuteHook event to HooksExecutionService

* Fix MockHooksExecutionService to include onDidExecuteHook event

* Extend Disposable instead of using DisposableStore

* Fire onDidExecuteHook event even when no hooks are registered

* Fixes

* Handle multiple post/preToolUse hooks more correctly (#293517)

* Improve tests

* Handle multiple post/preToolUse hooks more correctly

* Support OS-specific commands for hooks (#293530)

* hook streaming first pass (#293514)

* hooks streaming first pass

* Update src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update styling

* modify api shape

* address some comments + do not render for now

* new icons + no more continue

* make sure we render right, some comments addressed

* uncomment that stuffs

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Support transcript_path on hooks (#293567)

* updatedInput for PreToolUse (#293575)

* Support PreCompact hook (#293581)

* Support PreCompact hook

* add this

* Handle remote OS for hook detection (#293596)

* Add common blocking behaviour for hooks (#293543)

* Add /hooks slash command (#293583)

* Add /hooks slash command

* await

* Build fix

* Update configure hooks flow and supported paths (#293643)

* update

* updates

* Update src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update handling

* PR

* test

* fix test

* cleanup

* nit

* cleanup

* clean

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Don't fail hooks when missing token (#293811)

* Make chatHooks proposal self contained

* Add support for continue, stopReason and systemMessage for tool hooks (#294016)

* Add back button to configure hooks menu (#294043)

* Move PreToolUse to extension (#294042)

* Move PreToolUse to extension

* Migrate PostToolUse

* Update handling of claude hooks config (#294187)

* Add more configuration slash commands (#294231)

* Move hook execution to extension (#294215)

* Refactor hook execution

* Fix compilation: add IExtHostHooks import, remove unused IHookResult, inline ChatRequestHooks type

* Move hooks property to chatHooks proposal, sync DTS

* cleanup

* Remove dead hook execution code: proxy, RPC, output channel, progress events

All hook execution now happens in the extension via NodeHookExecutor.
HooksExecutionService is now a pure registry (registerHooks/getHooksForSession).

Removed:
- executeHook, setProxy, onDidHookProgress from service
- IHooksExecutionProxy, IHookProgressEvent, HookAbortError, formatHookErrorMessage
- hooksCommandTypes.ts, hooksTypes.ts (dead type files)
- mainThreadHooks proxy setup
- extHostHooksNode., extHostHooksWorker.
- ExtHostHooksShape. protocol
- IExtHostHooks DI registrations
- ChatHooksProgressContribution
- All associated test files

* Remove HooksExecutionService entirely

The service was only a registry for session hooks, but hooks are already
passed directly on the chat request DTO. The registerHooks/getHooksForSession
pattern was redundant.

* Restore modelName support in chatSubagentContentPart that was accidentally removed during merge

* Revert unrelated tabIndex change on chatSubagentContentPart

* Remove empty hooks ext host infrastructure

Delete IExtHostHooks, NodeExtHostHooks, WorkerExtHostHooks,
MainThreadHooks, ExtHostHooksShape, MainThreadHooksShape -
all were empty stubs after hook execution moved to extension.

* Remove mainThreadHooks import from extensionHost.contribution

* Fix DTS comments: env and timeoutSec are values, not implementation promises

* Update hook timeout format (#294266)

* Add support for disabling all hooks and use JSONC (#294234)

* fix for moving hooks to extension (#294441)

* fix for moving hooks to extension

* fix hygiene

* address comments

---------

Co-authored-by: Rob Lourens <roblourens@gmail.com>
Co-authored-by: Justin Chen <54879025+justschen@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants