Skip to content

Load deferred repo hooks after session creation#312036

Merged
DonJayamanne merged 2 commits intomainfrom
don/internal-koi
Apr 24, 2026
Merged

Load deferred repo hooks after session creation#312036
DonJayamanne merged 2 commits intomainfrom
don/internal-koi

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

Ensure that deferred repository hooks are loaded immediately after creating a session in the Copilot CLI session service. This change enhances the session initialization process.

Copilot AI review requested due to automatic review settings April 22, 2026 23:14
@DonJayamanne DonJayamanne self-assigned this Apr 22, 2026
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 updates the Copilot CLI session initialization flow to ensure any deferred repository hooks are loaded immediately after a session is created or re-opened, improving session readiness for repo-aware behaviors.

Changes:

  • Call sessionManager.loadDeferredRepoHooks(sdkSession) after createSession(...) completes.
  • Call sessionManager.loadDeferredRepoHooks(sdkSession) after getSession(...) returns an existing session.
Show a summary per file
File Description
extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts Loads deferred repo hooks right after SDK sessions are created or retrieved.

Copilot's findings

Comments suppressed due to low confidence (1)

extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts:763

  • Same as in createSession: this new loadDeferredRepoHooks call will currently break existing unit tests because the shared MockCliSdkSessionManager used across Copilot CLI session tests doesn’t define this method. Update the mock(s) accordingly or feature-detect before calling to avoid runtime errors.
				await sessionManager.loadDeferredRepoHooks(sdkSession);
  • Files reviewed: 1/1 changed files
  • Comments generated: 1

…ssionService

Co-authored-by: Copilot <copilot@github.com>
@DonJayamanne DonJayamanne marked this pull request as ready for review April 23, 2026 19:18
@DonJayamanne DonJayamanne merged commit dd1eb81 into main Apr 24, 2026
40 of 41 checks passed
@DonJayamanne DonJayamanne deleted the don/internal-koi branch April 24, 2026 02:59
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 24, 2026
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.

3 participants