chat: preserve conversation ID for Agent Host BYOK requests by wycats · Pull Request #341450 · microsoft/vscode · GitHub
Skip to content

chat: preserve conversation ID for Agent Host BYOK requests - #341450

Merged
Vritant Bhardwaj (vritant24) merged 1 commit into
microsoft:mainfrom
wycats:wycats/agent-host-byok-conversation-id
Oct 14, 2026
Merged

Vritant Bhardwaj (vritant24) merged 1 commit into
microsoft:mainfrom
wycats:wycats/agent-host-byok-conversation-id

Conversation

@wycats

Copy link
Copy Markdown
Contributor

Why

43f74c4 fixed #332031 by passing _conversationId to extension-provided models for prompt caching. The Agent Host BYOK proxy already has the SDK session ID, but drops it before reaching the provider.

This forwards that ID through the existing modelOptions._conversationId, preserving the other model options. Regression tests cover repeated requests, separate sessions, tool continuations, and forwarding to the language model service.

Related: #337203 proposes a public session-ID API alongside request middleware. This patch uses the existing private field.

Testing

The proxy, Responses translation, and renderer handler suites pass (56 tests), as does lint on the changed files. Run them with ./scripts/test.sh --runGlob '**/{byokLmProxyService,byokResponsesTranslation,agentHostByokLmHandler}.test.js' after building client output.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 02:43

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.

🟢 Approval recommended

The focused implementation preserves existing options and is covered across the affected proxy and renderer boundaries.

0 open findings

What changed in this PR

Preserves Agent Host BYOK session identity through the language-model bridge so Responses providers can generate stable prompt-cache keys.

Changes:

  • Adds _conversationId while retaining existing model options.
  • Tests repeated requests, distinct sessions, continuations, and renderer forwarding.
File Description
src/​vs/​platform/​agentHost/​node/​copilot/​byokLmProxyService.ts Forwards the authenticated session ID.
src/​vs/​platform/​agentHost/​test/​node/​byokLmProxyService.test.ts Covers session and continuation forwarding.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostByokLmHandler.test.ts Verifies renderer-side model-option forwarding.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vritant24
Vritant Bhardwaj (vritant24) merged commit 0d01f15 into microsoft:main Oct 14, 2026
35 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 14, 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.

BYOK Responses custom endpoints drop conversationId, preventing prompt_cache_key from being sent

5 participants