refactor(copilotcli): move worktree properties and metadata tracking to session request lifecycle#308960
Merged
DonJayamanne merged 1 commit intomainfrom Apr 10, 2026
Merged
refactor(copilotcli): move worktree properties and metadata tracking to session request lifecycle#308960DonJayamanne merged 1 commit intomainfrom
DonJayamanne merged 1 commit intomainfrom
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors Copilot CLI chat session handling so worktree property persistence, workspace-folder tracking, and request metadata recording occur during the request lifecycle (start of a request) rather than during session initialization/creation, clarifying responsibilities and timing.
Changes:
- Extend
SessionRequestLifecycle.startRequestto record request details (agent + mode instructions) and to initialize worktree/workspace-folder metadata on the first request. - Update
CopilotCLIChatSessionParticipantto pass workspace + agent context intostartRequestand propagate resolved agent information. - Adjust initializer and tests to remove/relocate assertions now covered by request-lifecycle tests.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/sessionRequestLifecycle.ts | Adds metadata/worktree/workspace-folder setup to startRequest and injects metadata/log services. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts | Passes workspace + agent info into request lifecycle and threads agent through session creation helpers. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionInitializer.ts | Removes worktree/workspace-folder/metadata side-effects from initialization/creation paths. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/sessionRequestLifecycle.spec.ts | Adds coverage for new startRequest responsibilities. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/chatSessionInitializer.spec.ts | Updates expectations to reflect moved responsibilities out of initializer. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
alexr00
approved these changes
Apr 10, 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.
Move the handling of worktree properties and request metadata tracking to the session request lifecycle, improving the organization of the code and ensuring that these actions occur at the appropriate time during the request process. This change simplifies the initialization process and enhances the clarity of the session management logic.