Skip to content

WIP - adopt latest AHP#320209

Draft
lszomoru wants to merge 3 commits into
mainfrom
lszomoru/ahp-changes-adoption
Draft

WIP - adopt latest AHP#320209
lszomoru wants to merge 3 commits into
mainfrom
lszomoru/ahp-changes-adoption

Conversation

@lszomoru
Copy link
Copy Markdown
Member

@lszomoru lszomoru commented Jun 6, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 6, 2026 07:10
@lszomoru lszomoru self-assigned this Jun 6, 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 VS Code’s Agent Host integration to align with the latest Agent Host Protocol (AHP) revision (bumped .ahp-version), including a protocol-level reshaping of “changesets” and related client/server plumbing across workbench UI, sessions providers, and agent host services/tests.

Changes:

  • Adopt upstream protocol updates: move the changeset catalogue to SessionState.changesets (now Changeset with changeKind) and move aggregate counts to SessionSummary.changes (ChangesSummary).
  • Update agent host server/client and sessions provider logic to compute, persist, migrate, and surface changes summaries (including new META_CHANGES_SUMMARY storage key) while keeping detailed diffs behind changeset subscriptions.
  • Adjust tool-call contributor handling and various tests to match the updated protocol types/locations.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.ts Switch session-list chip from changeset catalogue counts to changesSummary aggregate.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Minor tool-call contributor check refactor and import alignment.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts Reorders/clarifies filtering of MCP server customizations.
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts Updates provider tests for changes aggregate instead of changesets counts.
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts Plumbs SessionSummary.changes and SessionState.changesets into adapter/provider paths.
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionChangesets.ts Updates changeset catalogue type from ChangesetSummary to Changeset.
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Updates listSessions test expectations to assert changes aggregate.
src/vs/platform/agentHost/test/node/protocol/clientTools.integrationTest.ts Updates tool contributor assertions/types for new protocol shape.
src/vs/platform/agentHost/test/node/mockAgent.ts Updates tool-call contributor imports/comments for new contributor field usage.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Adjusts contributor assertions to account for optional contributor.
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts Updates changeset seeding and contributor fields in side-effects tests.
src/vs/platform/agentHost/test/node/agentService.test.ts Updates agent service tests for new changeset catalogue + changes aggregate split.
src/vs/platform/agentHost/test/node/agentHostCommitOperationHandler.test.ts Adapts changeset service mock to new persistChangesSummary API.
src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts Updates persistence expectations from diff blobs to META_CHANGES_SUMMARY.
src/vs/platform/agentHost/test/node/agentHostChangesetCoordinator.test.ts Updates coordinator tests for new summary persistence contract.
src/vs/platform/agentHost/node/protocolServerHandler.ts Updates listSessions payload and adjusts resource-watch snapshot typing.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Moves ToolCallContributorKind import and builds contributor inline.
src/vs/platform/agentHost/node/agentService.ts Seeds state.changesets, plumbs changes, and parses/prefers persisted changes summary.
src/vs/platform/agentHost/node/agentHostStateManager.ts Adds setSessionSummaryChanges and moves catalogue to state.changesets.
src/vs/platform/agentHost/node/agentHostSkillCompletionProvider.ts Splits MCP server filtering logic for clarity.
src/vs/platform/agentHost/node/agentHostSessionGitStateService.ts Updates git-only catalogue handling to use state.changesets.
src/vs/platform/agentHost/node/agentHostChangesetService.ts Introduces META_CHANGES_SUMMARY, computes/persists changes aggregate, updates publish path.
src/vs/platform/agentHost/node/agentHostChangesetCoordinator.ts Updates list overlay to changes aggregate + migration/persistence path.
src/vs/platform/agentHost/common/state/sessionState.ts Re-exports updated protocol symbols/types (e.g. Changeset, McpServerStatus).
src/vs/platform/agentHost/common/state/protocol/common/state.ts Removes ResourceWatchState from the Snapshot union.
src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts Adds SessionState.changesets, adds SessionSummary.changes, defines ChangesSummary.
src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.ts Moves SessionChangesetsChanged reducer target from summary to session state.
src/vs/platform/agentHost/common/state/protocol/channels-session/actions.ts Updates action typing/docs for Changeset and SessionState.changesets.
src/vs/platform/agentHost/common/state/protocol/channels-root/notifications.ts Updates notification docs to remove changesets-specific language.
src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts Renames ChangesetSummaryChangeset and adds changeKind.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Bumps protocol version hash to latest synced upstream.
src/vs/platform/agentHost/common/changesetUri.ts Seeds default catalogue with changeKind values.
src/vs/platform/agentHost/common/agentService.ts Updates IAgentSessionMetadata contract: adds changes, changes changesets element type.
src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts Maps listSessions response to include changes aggregate.

Copilot's findings

  • Files reviewed: 34/34 changed files
  • Comments generated: 10

Comment on lines 295 to 299
return this._makeItem(rawId, {
title: summary.title,
status: summary.status,
activity: summary.activity,
workingDirectory: workingDir,
Comment on lines +329 to +335
changes: opts.changesSummary
? {
files: opts.changesSummary.files ?? 0,
insertions: opts.changesSummary.additions ?? 0,
deletions: opts.changesSummary.deletions ?? 0,
}
: undefined,
Comment on lines +382 to +385
const changesSummary = metadata[META_CHANGES_SUMMARY];
if (changesSummary !== undefined) {
return { ...entry, changes: JSON.parse(changesSummary) as ChangesSummary };
}
Comment on lines 47 to 52
export const CHANGESET_DB_METADATA_KEYS: Record<string, true> = {
[META_CHANGESET_UNCOMMITTED]: true,
[META_CHANGESET_SESSION]: true,
[META_CHANGES_SUMMARY]: true,
[META_LEGACY_DIFFS]: true,
};
META_CHANGESET_UNCOMMITTED,
META_LEGACY_DIFFS,
} from './agentHostChangesetService.js';
import { ChangesSummary } from '../common/state/protocol/channels-session/state.js';
import { parseChangesetUri } from '../common/changesetUri.js';
import { AgentHostChangesetStateCache, type IAgentHostChangesetStateRetentionOptions } from './agentHostChangesetStateCache.js';
import { arrayEquals, structuralEquals } from '../../../base/common/equals.js';
import { ChangesSummary } from '../common/state/protocol/state.js';
import type { InvokeChangesetOperationParams, InvokeChangesetOperationResult } from '../common/state/protocol/channels-changeset/commands.js';
import { AhpErrorCodes, AHP_SESSION_NOT_FOUND, ContentEncoding, JSON_RPC_INTERNAL_ERROR, ProtocolError, ResourceChangeType, ResourceType, ResourceWriteMode, type CreateResourceWatchParams, type CreateResourceWatchResult, type DirectoryEntry, type ResourceCopyParams, type ResourceCopyResult, type ResourceDeleteParams, type ResourceDeleteResult, type ResourceListResult, type ResourceMkdirParams, type ResourceMkdirResult, type ResourceMoveParams, type ResourceMoveResult, type ResourceReadResult, type ResourceResolveParams, type ResourceResolveResult, type ResourceWatchState, type ResourceWriteParams, type ResourceWriteResult, type IStateSnapshot } from '../common/state/sessionProtocol.js';
import { MessageAttachmentKind, type MessageAttachment, type MessageResourceAttachment } from '../common/state/protocol/state.js';
import { ChangesSummary, MessageAttachmentKind, type MessageAttachment, type MessageResourceAttachment } from '../common/state/protocol/state.js';
import { NullLogService } from '../../../log/common/log.js';
import { AgentSession, IAgentSessionMetadata } from '../../common/agentService.js';
import { buildDefaultChangesetCatalogue, buildSessionChangesetUri, buildUncommittedChangesetUri } from '../../common/changesetUri.js';
import { ChangesSummary } from '../../common/state/protocol/state.js';
Comment on lines 68 to 74
const toolStartAction = getActionEnvelope(toolStartNotif).action as {
toolCallId: string;
contributor?: ToolCallContributor;
contributor?: { kind: string; clientId?: string };
};
assert.strictEqual(toolStartAction.toolCallId, 'tc-client-1');
assert.deepStrictEqual(toolStartAction.contributor, { kind: ToolCallContributorKind.Client, clientId: 'test-client-tool' });
assert.strictEqual(toolStartAction.contributor?.clientId, 'test-client-tool');

Comment on lines 248 to 252
createdAt: s.startTime,
modifiedAt: s.modifiedTime,
workingDirectory: s.workingDirectory?.toString(),
changesets: s.changesets ? [...s.changesets] : undefined,
});
return this._makeItem(rawId, {
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