Repository navigation
agent host: adopt AHP 1.1 with transition compatibility - #348236
Merged
Merged
Conversation
Sync the published protocol definitions, adopt renamed wire fields and dedicated annotation channels, and preserve existing automation extensions during regeneration. Co-authored-by: Copilot <[email protected]>
Keep connections to pre-sync agent hosts working during the AHP 1.1 transition. - Send both frame-limit field names and accept either name in channel negotiation. - Read legacy canvas sources and editing flags. Publish aliases for older clients. - Use advertised annotation resources, with a fallback for older native hosts. - Keep transition helpers in one module with a note to remove them after migration. - Add mixed-version tests for subscriptions, reconnects, TCP, canvases, and edit review. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
Ben Villalobos (@benvillalobos)Matched files:
Joaquín Ruales (@jruales)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
|
Base:
|
Check stored annotation state instead of the lazy channel snapshot. - Keep the peer-chat ownership regression check with dedicated annotation channels. - Preserve empty snapshots for unwritten annotation resources. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
Sync AHP with the upstreamed one-time trigger (microsoft/agent-host-protocol#603) and drop the local protocol patch. VS Code-only scheduled-chat state (purpose, existing-chat target, admission and dispatch receipts, existing-chat support) moves into namespaced _meta, the session origin keeps purpose as a VS Code extension member, and conditional updates are removed. Hosts migrate previously stored top-level fields on load. Co-authored-by: Copilot <[email protected]>
…crosoft/vscode into agents/adopt-ahp-one-time-triggers
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A host-only upgrade breaks legacy clients’ feedback subscriptions and writes, while annotation resource reuse and incomplete session summaries can misdirect feedback or expose incorrect counts.
5 open issues
Preserve legacy annotation subscriptions and writes · New Restore saved annotation counts before listing sessions · New Update session summary counts after eviction · New Include annotations resource in surfaced-session notifications · New Refresh feedback channel when the annotations resource changes · New
What changed in this PR
This PR updates VS Code’s Agent Host integration to the published AHP 1.1 definitions and adds compatibility helpers for the transition from pre-sync hosts and clients.
Changes:
- Supports canonical and legacy frame limits, canvas sources, and editing flags.
- Moves annotations to dedicated channels and carries advertised resources through session metadata.
- Expands mixed-version tests and preserves VS Code automation extensions during protocol generation.
| File | Description |
|---|---|
| src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Tracks advertised annotation resources through session updates. |
| src/vs/workbench/contrib/sessions/providers/agentHost/AGENT_HOST_SESSIONS_PROVIDER.md | Documents conditional AHP 1.1 offers. |
| src/vs/workbench/contrib/sessions/common/agentHostSessionsProvider.ts | Clarifies the advertised annotations-channel contract. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Updates canvas fixtures to uri. |
| src/vs/workbench/contrib/chat/test/browser/agentHost/agentHostEditReview.test.ts | Tests editing status bits and legacy compatibility. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostEditReview.ts | Reads editing state through the transition helper. |
| src/vs/workbench/contrib/canvases/test/common/agentHostCanvas.test.ts | Tests legacy sources and canonical precedence. |
| src/vs/workbench/contrib/canvases/common/agentHostCanvas.ts | Accepts canonical and legacy canvas sources. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Tests annotation advertisement, updates, and fallback. |
| src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts | Updates annotations-channel documentation. |
| src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts | Checks canonical canvas source output. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Updates flow-control and legacy reconnect cases. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Updates canvas projection expectations. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Reads canonical canvas sources in assertions. |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Updates canvas aliases and annotations migration coverage. |
| src/vs/platform/agentHost/test/node/agentHostTcp.test.ts | Tests TCP results and mixed-version negotiation. |
| src/vs/platform/agentHost/test/node/agentHostSubscriptionService.test.ts | Tests annotation ownership and provider isolation. |
| src/vs/platform/agentHost/test/node/agentHostStateManager.test.ts | Tests dedicated annotations and canvas aliases. |
| src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts | Tests editing bits and unknown-bit preservation. |
| src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts | Tests legacy limits, reconnects, and annotation metadata. |
| src/vs/platform/agentHost/test/common/annotationsUri.test.ts | Adds annotation URI identity and parsing tests. |
| src/vs/platform/agentHost/test/common/ahpJsonlLogger.test.ts | Verifies both canvas source fields are redacted. |
| src/vs/platform/agentHost/test/common/agentSubscription.test.ts | Updates canvas and annotations subscription fixtures. |
| src/vs/platform/agentHost/test/common/agentHostTcpConnection.test.ts | Uses canonical frame limits in capacity tests. |
| src/vs/platform/agentHost/test/common/agentHostChannelDelivery.test.ts | Tests legacy limit decoding and validation. |
| src/vs/platform/agentHost/test/common/agentHostChannel.test.ts | Tests dual-field negotiation and acceptance bounds. |
| src/vs/platform/agentHost/node/shared/agentFeedbackServerTools.ts | Updates annotations-channel documentation. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Includes annotations in listed session summaries. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Publishes and clears canonical canvas sources. |
| src/vs/platform/agentHost/node/agentSessionResidency.ts | Recognizes dedicated annotations for residency exclusions. |
| src/vs/platform/agentHost/node/agentService.ts | Advertises annotations and updates channel routing. |
| src/vs/platform/agentHost/node/agentHostTcpConnections.ts | Returns an empty object after TCP creation. |
| src/vs/platform/agentHost/node/agentHostStateManager.ts | Manages dedicated annotations and compatibility aliases. |
| src/vs/platform/agentHost/node/agentHostChangesetService.ts | Publishes editing status bits with legacy aliases. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Re-exports changeset file status flags. |
| src/vs/platform/agentHost/common/state/protocol/common/state.ts | Syncs frame-limit names and preservation annotations. |
| src/vs/platform/agentHost/common/state/protocol/common/notifications.ts | Updates generated frame terminology. |
| src/vs/platform/agentHost/common/state/protocol/common/messages.ts | Updates the TCP command result type. |
| src/vs/platform/agentHost/common/state/protocol/common/commands.ts | Clarifies generated provider capability documentation. |
| src/vs/platform/agentHost/common/state/protocol/channels-tcp/commands.ts | Defines the empty TCP creation result. |
| src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts | Syncs annotations documentation and preservation metadata. |
| src/vs/platform/agentHost/common/state/protocol/channels-session/actions.ts | Clarifies chat-summary identity rules. |
| src/vs/platform/agentHost/common/state/protocol/channels-root/state.ts | Marks model selections for unknown-member preservation. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/state.ts | Syncs chat metadata and annotations documentation. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/commands.ts | Clarifies provider semantics for chat creation and moves. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/actions.ts | Syncs duration constraints and stability annotations. |
| src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts | Replaces the editing boolean with status flags. |
| src/vs/platform/agentHost/common/state/protocol/channels-changeset/commands.ts | Updates documented nonce-conflict semantics. |
| src/vs/platform/agentHost/common/state/protocol/channels-canvas/state.ts | Renames the canvas source field to uri. |
| src/vs/platform/agentHost/common/state/protocol/channels-automation/state.ts | Adds generated unknown-member preservation annotations. |
| src/vs/platform/agentHost/common/state/protocol/channels-automation/actions.ts | Documents preservation requirements for replacement objects. |
| src/vs/platform/agentHost/common/state/protocol/channels-annotations/state.ts | Documents dedicated, advertised annotation resources. |
| src/vs/platform/agentHost/common/state/protocol/.ahp-version | Records the updated upstream revision. |
| src/vs/platform/agentHost/common/state/agentSubscription.ts | Updates annotations subscription documentation. |
| src/vs/platform/agentHost/common/meta/vscode/agentFeedbackAnnotations.ts | Documents feedback on advertised channels. |
| src/vs/platform/agentHost/common/annotationsUri.ts | Builds dedicated channels and parses retained identities. |
| src/vs/platform/agentHost/common/ahpJsonlLogger.ts | Redacts canonical and legacy canvas sources. |
| src/vs/platform/agentHost/common/agentHostTcpConnection.ts | Uses canonical limits while publishing legacy aliases. |
| src/vs/platform/agentHost/common/agentHostSubscriptionService.ts | Excludes unrelated host-wide channels from session resolution. |
| src/vs/platform/agentHost/common/agentHostProtocolTransition.ts | Centralizes temporary compatibility helpers. |
| src/vs/platform/agentHost/common/agentHostChannelTelemetry.ts | Recognizes dedicated annotations channels. |
| src/vs/platform/agentHost/common/agentHostChannelDelivery.ts | Reads both limit spellings and uses canonical limits. |
| src/vs/platform/agentHost/common/agentHostChannel.ts | Negotiates limits with compatibility aliases. |
| src/vs/platform/agentHost/common/agent.ts | Adds annotations to session metadata. |
| src/vs/platform/agentHost/browser/agentHostProtocolClient.ts | Preserves advertised annotations in listed metadata. |
| scripts/sync-agent-host-protocol.ts | Applies the local overlay after generation. |
| scripts/agent-host-protocol.patch | Preserves existing VS Code automation extensions. |
| build/filters.ts | Exempts the protocol patch from indentation checks. |
Review effort: Balanced
Co-authored-by: Copilot <[email protected]>
AHP one-time triggers reuse misfirePolicy and allow any ISO 8601 runAt. Skip occurrences missed while unavailable, accept explicit UTC offsets, and normalize run times to UTC. Co-authored-by: Copilot <[email protected]>
A malformed existing-chat target in _meta must not silently fall back to creating a new session. Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima)
previously approved these changes
Nov 13, 2026
Drop the dispatched/rejected receipts: run lifecycle and session linkage already show whether a one-time message was sent. Merge the scheduled-chat marker and existing-chat target into one _meta entry and keep only the admitted-run id. Co-authored-by: Copilot <[email protected]>
Connor Peet (connor4312)
disabled auto-merge
November 13, 2026 21:44
Adopts the upstreamed one-time trigger (microsoft/agent-host-protocol#603) on top of #348236, replacing the local protocol patch that preserved the Send Later edits from #347963. ### What changed - Ran `scripts/sync-agent-host-protocol.ts` against AHP `main` (`f1f4d4ac`) and deleted `scripts/agent-host-protocol.patch`. The sync script now applies that patch only when it exists. - AHP now defines only `oneTime` triggers and `automations.oneTime`. Generic "run once" automations also use `oneTime` triggers, so a scheduled chat can't be inferred from the trigger. The VS Code-only state moves into namespaced `_meta` through helpers in `agentHostAutomationsMeta.ts`: - Scheduled-chat purpose: `vscode.scheduledChat` on definition and run `_meta`. - Existing-chat target: `vscode.scheduledChatConversation` on definition `_meta`. - Admission and dispatch receipts: `vscode.oneTimeReceipts` on entry `_meta`. - Existing-chat support: the `vscode.scheduledChatExistingConversation` initialize `_meta` flag. - `AutomationSessionOrigin` has no `_meta`, so `purpose` stays on the session origin as a typed VS Code extension member (`IAgentHostAutomationSessionOrigin`). - `expectedModifiedAt` is removed, per AHP review. The host still rejects edits once a one-time run has been admitted, and it now rejects updates that change scheduled-chat purpose or target through `_meta`. - Hosts migrate stored Automations and runs from the earlier top-level fields into `_meta` on load, so already-scheduled chats keep working. ### Testing - `pnpm run typecheck-client`: passed. - `pnpm run oxlint <changed files>`: passed. - `./scripts/test.sh --reporter dot` with `agentHostAutomationService`, `agentHostAutomationStore`, `localAgentHostSessionsProvider`, `automationTools`, `scheduledChatsService`, `automationRunner`, `cloudAutomationStore`, `protocolServerHandler`, `agentHostAutomationsMeta`, `agentHostCatalogProjection`, and `automationsView`: **1879 passing, 12 pending**. - Added tests for migrating legacy stored fields and for scheduled-chat purpose and target immutability. No manual UI validation was done.
Connor Peet (connor4312)
marked this pull request as draft
November 13, 2026 21:47
Keep dedicated annotations channels usable through discovery and metadata changes. - Include the channel summary in discovered-session notifications without database reads. - Notify catalogue observers after annotations change on an evicted session. - Rebind feedback subscriptions when the advertised resource changes. - Add focused regression coverage without changing annotation persistence. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
Keep the remote branch updates alongside the annotation review fixes. Co-authored-by: Copilot <[email protected]>
Preserve the protocol adoption and annotation fixes alongside current main. Co-authored-by: Copilot <[email protected]>
Use the negotiated protocol constant instead of a stale version literal in the multiple-provider capability test. Co-authored-by: Copilot <[email protected]>
Connor Peet (connor4312)
marked this pull request as ready for review
November 13, 2026 22:52
Connor Peet (connor4312)
enabled auto-merge
November 13, 2026 22:52
Anthony Kim (anthonykim1)
approved these changes
Nov 13, 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.


agent host: adopt AHP 1.1 with transition compatibility
Keep connections to pre-sync agent hosts working during the AHP 1.1 transition.
(Commit message generated by Copilot)
Co-authored-by: Copilot [email protected]
This PR also syncs the published AHP 1.1.0 definitions, moves annotations to their dedicated channel scheme, and preserves existing automation extensions through a reproducible generation patch. Automations already use their dedicated scheme. There is no linked issue.
Validation:
./node_modules/.bin/tsc --project ./src/tsconfig.json --noEmit --skipLibCheck --pretty false- passed.VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --reporter dot --run src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts --grep 'canvas'- passed, 1 test.