Skip to content

Adopt message attachment URI protocol#312553

Merged
roblourens merged 2 commits intomainfrom
roblou/message-attachment-uri-vscode
Apr 25, 2026
Merged

Adopt message attachment URI protocol#312553
roblourens merged 2 commits intomainfrom
roblou/message-attachment-uri-vscode

Conversation

@roblourens
Copy link
Copy Markdown
Member

Adopts the Agent Host Protocol message attachment rename from path to uri in VS Code.

Summary:

  • Updates generated Agent Host Protocol files to the synced AHP revision.
  • Carries protocol attachment URIs through VS Code as serialized protocol uri values and internal URI objects.
  • Keeps file-scheme filtering and working-directory rebasing for chat attachments.
  • Converts internal attachment URIs to Copilot SDK path / filePath values at the SDK boundary.
  • Adds focused tests for protocol-to-agent and agent-to-SDK attachment conversion.

Related protocol PR: https://github.com/microsoft/agent-host-protocol/pull/84

Validation:

  • Core - Typecheck: 0 errors
  • Core - Transpile: latest run 0 errors
  • Focused attachment tests: 70 passed, 0 failed
  • Hygiene: passed

(Written by Copilot)

Copilot AI review requested due to automatic review settings April 25, 2026 19:00
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

Adopts the Agent Host Protocol attachment field rename from pathuri and threads attachment URIs through VS Code using serialized protocol URI strings and internal URI objects, converting back to Copilot SDK path/filePath at the boundary.

Changes:

  • Update chat → agent-host protocol dispatch to emit MessageAttachment.uri (string) and keep file-scheme filtering + working-dir rebasing.
  • Update node side effects to parse protocol attachment URI strings into URI objects before calling agents.
  • Update Copilot SDK boundary to map internal URI attachments back to SDK path / filePath, with focused unit tests for both conversion directions.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Updates expectations to assert attachment uri strings and refines a skip-case test for non-file URIs.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Emits protocol MessageAttachment objects with uri strings (post-rebase) instead of filesystem path.
src/vs/platform/agentHost/test/node/mockAgent.ts Extends mock agent to record optional attachments passed to sendMessage.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Adds test ensuring internal URI attachments map to Copilot SDK path/filePath.
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts Adds coverage for parsing protocol attachment URI strings into URI objects (turn + queued messages).
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Converts internal URI attachments to Copilot SDK path/filePath fields at the SDK boundary.
src/vs/platform/agentHost/node/agentSideEffects.ts Parses action.userMessage.attachments[].uri strings via URI.parse before calling the agent.
src/vs/platform/agentHost/common/state/protocol/version/registry.ts Updates action version registry for newly synced protocol actions.
src/vs/platform/agentHost/common/state/protocol/state.ts Syncs generated protocol types including MessageAttachment.uri and additional session fields from the newer AHP revision.
src/vs/platform/agentHost/common/state/protocol/reducers.ts Adds reducers for newly synced protocol actions (activity/meta).
src/vs/platform/agentHost/common/state/protocol/actions.ts Adds newly synced protocol actions/types and updates unions accordingly.
src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts Regenerates action origin/unions and dispatchability map to include the new actions.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Bumps the pinned agent-host-protocol revision hash.
src/vs/platform/agentHost/common/agentService.ts Updates IAgentAttachment to carry a URI instead of a filesystem path.

Copilot's findings

  • Files reviewed: 14/14 changed files
  • Comments generated: 0

@roblourens roblourens marked this pull request as ready for review April 25, 2026 19:48
@roblourens roblourens enabled auto-merge (squash) April 25, 2026 19:48
@roblourens roblourens merged commit 8950ba5 into main Apr 25, 2026
26 checks passed
@roblourens roblourens deleted the roblou/message-attachment-uri-vscode branch April 25, 2026 21:37
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 25, 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