Skip to content

refactor(copilotcli): move worktree properties and metadata tracking to session request lifecycle#308960

Merged
DonJayamanne merged 1 commit intomainfrom
don/wet-raven
Apr 10, 2026
Merged

refactor(copilotcli): move worktree properties and metadata tracking to session request lifecycle#308960
DonJayamanne merged 1 commit intomainfrom
don/wet-raven

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings April 10, 2026 07:26
@DonJayamanne DonJayamanne self-assigned this Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: e9aba237 Current: d1d5749d

Changed (1)

agentSessionsViewer/ApprovalRowLongLabel/Light
Before After
before after

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

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.startRequest to record request details (agent + mode instructions) and to initialize worktree/workspace-folder metadata on the first request.
  • Update CopilotCLIChatSessionParticipant to pass workspace + agent context into startRequest and 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

@DonJayamanne DonJayamanne marked this pull request as ready for review April 10, 2026 07:39
@DonJayamanne DonJayamanne enabled auto-merge (squash) April 10, 2026 07:39
@DonJayamanne DonJayamanne merged commit 4660585 into main Apr 10, 2026
30 checks passed
@DonJayamanne DonJayamanne deleted the don/wet-raven branch April 10, 2026 08:06
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 10, 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