Skip to content

agentHost: revert reserved integration id change; tag Codex proxy with vscode_codex UA#322600

Merged
TylerLeonhardt merged 5 commits into
mainfrom
revert-pr-321964
Jun 23, 2026
Merged

agentHost: revert reserved integration id change; tag Codex proxy with vscode_codex UA#322600
TylerLeonhardt merged 5 commits into
mainfrom
revert-pr-321964

Conversation

@TylerLeonhardt

Copy link
Copy Markdown
Member

Summary

Reverts #321964 ("agentHost: stop sending an explicit Copilot integration id to CAPI"), then re-applies the part we want to keep and adds a vscode_codex user-agent to the Codex proxy.

Commits

  1. Revert of agentHost: stop sending an explicit Copilot integration id to CAPI #321964 — restores the per-request suppressIntegrationId mechanism on CopilotApiService (Claude/Codex/Copilot agent-host surfaces).
  2. agentHost: do not pass an integration id into CAPIClient — stops passing the reserved code-oss integration id into @vscode/copilot-api's CAPIClient constructor (it throws on the reserved id). The Copilot-Integration-Id header still defaults via the library, and the per-request suppressIntegrationId opt-in is unchanged. Drops the now-unnecessary getIntegrationId() test overrides.
  3. agentHost: tag Codex proxy requests with a vscode_codex user-agent — mirrors the Claude proxy and oaiLanguageModelServer.ts: transforms the inbound codex user-agent (replacing the client-name portion with the vscode_codex prefix) and forwards it to CAPI on /v1/responses requests. Adds focused tests.

Validation

  • npm run typecheck-client: clean
  • Full node unit suite passing, including new CodexProxyService user-agent tests
  • Manually verified end-to-end in the Agents window: Claude, Codex, and Copilot CLI all send messages and receive responses through the agent host

TylerLeonhardt and others added 3 commits June 23, 2026 11:21
…ved-integration-id"

This reverts commit b82871d, reversing
changes made to 18ab318.
The 'code-oss' integration id is reserved and rejected by
@vscode/copilot-api's CAPIClient constructor. Stop passing it in and
drop the now-unnecessary getIntegrationId() test overrides; the
Copilot-Integration-Id header still defaults via the library and the
per-request suppressIntegrationId opt-in is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirror the Claude proxy and oaiLanguageModelServer.ts by transforming the
inbound codex user-agent (replacing the client-name portion with the
vscode_codex prefix) and forwarding it to CAPI on /v1/responses requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adjusts the agent host’s Copilot/CAPI plumbing by removing the explicit (reserved) integration-id passed into @vscode/copilot-api’s CAPIClient, while keeping the per-request suppressIntegrationId escape hatch and tagging Codex proxy traffic with a vscode_codex user-agent for server-side identification.

Changes:

  • Stop passing the reserved code-oss integration id into CAPIClient construction; rely on the library’s derived default behavior instead.
  • Re-introduce / preserve per-request suppressIntegrationId threading through the agent host’s Copilot API wrapper and call sites (Claude/Codex agents + proxies).
  • Add Codex proxy user-agent transformation/forwarding plus focused unit tests.
Show a summary per file
File Description
src/vs/platform/agentHost/node/shared/copilotApiService.ts Reintroduces suppressIntegrationId request option and threads it through CAPI requests (models/messages/responses).
src/typings/copilot-api.d.ts Extends ambient @vscode/copilot-api typings to include suppressIntegrationId on fetch options.
src/vs/platform/agentHost/node/codex/codexProxyService.ts Builds/forwards a transformed User-Agent (vscode_codex/...) to CAPI for /v1/responses proxying.
src/vs/platform/agentHost/test/node/codex/codexProxyService.test.ts Adds unit tests asserting Codex proxy user-agent transformation/forwarding behavior.
src/vs/platform/agentHost/node/codex/codexAgent.ts Opts Codex model refresh into suppressIntegrationId.
src/vs/platform/agentHost/node/claude/claudeProxyService.ts Opts Claude proxy model/messages calls into suppressIntegrationId.
src/vs/platform/agentHost/node/claude/claudeAgent.ts Opts Claude agent model refresh into suppressIntegrationId.
src/vs/platform/agentHost/test/node/shared/copilotApiService.test.ts Updates tests to validate suppressIntegrationId behavior for integration-id header emission.
src/vs/platform/agentHost/test/node/shared/copilotApiService.integrationTest.ts Updates integration test harness construction pattern for CopilotApiService.

Copilot's findings

  • Files reviewed: 8/9 changed files
  • Comments generated: 2

Comment thread src/vs/platform/agentHost/test/node/shared/copilotApiService.test.ts Outdated
Comment thread src/vs/platform/agentHost/test/node/shared/copilotApiService.integrationTest.ts Outdated
…agent

The Codex agent's _refreshModels() call to ICopilotApiService.models() did
not set a User-Agent, unlike the Claude agent (which sends
vscode_claude_code/<version>). Add a matching vscode_codex/<version> header
so the model-list fetch is identifiable server-side, consistent with the
Codex proxy's responses requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address PR review: the anonymous CopilotApiService subclasses no longer
override anything after the getIntegrationId() removal, so replace them with
direct construction for readability and cleaner stack traces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review June 23, 2026 21:00
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) June 23, 2026 21:00
@TylerLeonhardt TylerLeonhardt merged commit cebc749 into main Jun 23, 2026
45 of 46 checks passed
@TylerLeonhardt TylerLeonhardt deleted the revert-pr-321964 branch June 23, 2026 21:28
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 23, 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