feat: Implement session Git state management and commit operations#318734
Merged
DonJayamanne merged 4 commits intoJun 4, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds server-side changeset operations for agent-host sessions, with a commit operation backed by Git state probing and Copilot-generated commit messages.
Changes:
- Extracts session Git state probing into
AgentHostSessionGitStateService. - Adds a changeset operation contribution framework and a
commitoperation handler/provider. - Extends agent-host connection interfaces, clients, DI wiring, and tests for the new operation flow.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.ts |
Delegates changeset operation invocation through the editor remote client. |
src/vs/workbench/contrib/terminal/test/browser/agentHostPty.test.ts |
Updates mock agent connection for the new interface method. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts |
Adds logging wrapper support for changeset operation calls. |
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts |
Updates mock agent service for new auth and operation APIs. |
src/vs/platform/agentHost/test/node/copilotGitProject.test.ts |
Updates Git service test double for new Git methods. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Updates Git service test double for new Git methods. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Adds token-caching coverage and updates Git service stubs. |
src/vs/platform/agentHost/test/node/agentHostCommitOperationProvider.test.ts |
Adds coverage for commit operation advertisement logic. |
src/vs/platform/agentHost/test/node/agentHostCommitOperationHandler.test.ts |
Adds coverage for commit handler success, clean tree, and cancellation paths. |
src/vs/platform/agentHost/test/common/sessionTestHelpers.ts |
Updates no-op Git service helper for the expanded interface. |
src/vs/platform/agentHost/node/protocolServerHandler.ts |
Delegates invokeChangesetOperation to AgentService. |
src/vs/platform/agentHost/node/agentService.ts |
Wires Git state service, operation contributions, token caching, and invocation dispatch. |
src/vs/platform/agentHost/node/agentHostSessionGitStateService.ts |
Adds dedicated service for session Git state probing and changeset catalogue updates. |
src/vs/platform/agentHost/node/agentHostServerMain.ts |
Registers IAgentService in server DI scope. |
src/vs/platform/agentHost/node/agentHostMain.ts |
Registers IAgentService in local agent-host DI scope. |
src/vs/platform/agentHost/node/agentHostGitService.ts |
Adds Git commit, upstream detection, and push helpers. |
src/vs/platform/agentHost/node/agentHostCommitOperationProvider.ts |
Adds commit operation contribution for uncommitted changesets. |
src/vs/platform/agentHost/node/agentHostCommitOperationHandler.ts |
Implements commit operation execution and Copilot commit message generation. |
src/vs/platform/agentHost/node/agentHostChangesetOperationContributionService.ts |
Adds contribution registry, operation refresh, validation, and dispatch. |
src/vs/platform/agentHost/node/agentHostChangesetOperationContributions.ts |
Registers default changeset operation contributions. |
src/vs/platform/agentHost/electron-browser/localAgentHostService.ts |
Delegates local changeset operation invocation. |
src/vs/platform/agentHost/common/changesetOperation.ts |
Defines common changeset operation contribution interfaces. |
src/vs/platform/agentHost/common/agentService.ts |
Extends agent service/connection interfaces for auth token retrieval and operation invocation. |
src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts |
Sends changeset operation requests over JSON-RPC. |
src/vs/platform/agentHost/browser/nullAgentHostService.ts |
Adds unsupported stub for changeset operation invocation. |
Copilot's findings
- Files reviewed: 25/25 changed files
- Comments generated: 3
b410315 to
ebf443d
Compare
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
b8672d5 to
78bbb50
Compare
connor4312
reviewed
Jun 3, 2026
connor4312
reviewed
Jun 3, 2026
connor4312
reviewed
Jun 3, 2026
connor4312
reviewed
Jun 3, 2026
connor4312
reviewed
Jun 3, 2026
… and state management
…ment in AgentHost
32f5429 to
3d4edd7
Compare
connor4312
reviewed
Jun 4, 2026
| readonly token: string; | ||
| } | ||
|
|
||
| export class AgentHostAuthenticationService { |
Member
There was a problem hiding this comment.
We can probably make this @Injectable and have consumers use this rather than adding stuff to the big agentService
connor4312
approved these changes
Jun 4, 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.
Fixes #317921
AgentHostSessionGitStateServiceto manage Git state during agent sessions.AgentServicefor session lifecycle management.AgentHostCommitOperationHandlerto commit changes and refresh changesets.AgentServiceto store authentication tokens for GitHub Copilot.