Skip to content

Add start session hook#3497

Merged
pwang347 merged 34 commits intomainfrom
pawang/startSessionHooks
Feb 6, 2026
Merged

Add start session hook#3497
pwang347 merged 34 commits intomainfrom
pawang/startSessionHooks

Conversation

@pwang347
Copy link
Member

@pwang347 pwang347 commented Feb 5, 2026

No description provided.

Base automatically changed from pawang/subagentHooks to main February 5, 2026 23:58
@pwang347 pwang347 marked this pull request as ready for review February 6, 2026 00:11
Copilot AI review requested due to automatic review settings February 6, 2026 00:11
@pwang347 pwang347 enabled auto-merge February 6, 2026 00:11
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 6, 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 adds support for a new SessionStart hook that allows hooks to provide additional context when a chat session begins. The implementation mirrors the existing SubagentStart hook pattern, executing on the first turn of regular chat sessions while SubagentStart continues to execute for subagent requests.

Changes:

  • Added SessionStartHookInput and SessionStartHookOutput interface definitions for the new hook type
  • Implemented executeSessionStartHook method following the same pattern as executeSubagentStartHook
  • Added runStartHooks method to execute start hooks (SessionStart or SubagentStart) before the main request loop
  • Integrated start hook execution in defaultIntentRequestHandler to run before user prompt submission

Reviewed changes

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

File Description
src/platform/chat/common/chatHookService.ts Adds TypeScript interface definitions for SessionStart hook input/output
src/extension/intents/node/toolCallingLoop.ts Implements SessionStart hook execution logic and adds runStartHooks method
src/extension/prompt/node/defaultIntentRequestHandler.ts Integrates start hook execution before the main tool calling loop

@pwang347 pwang347 added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 62a8644 Feb 6, 2026
19 checks passed
@pwang347 pwang347 deleted the pawang/startSessionHooks branch February 6, 2026 01:35
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.

2 participants