豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Attach response output message IDs only to phased assistant messages#4785

Merged
dileepyavan merged 11 commits intomainfrom
DileepY/remove_id_redundant
Mar 30, 2026
Merged

Attach response output message IDs only to phased assistant messages#4785
dileepyavan merged 11 commits intomainfrom
DileepY/remove_id_redundant

Conversation

@dileepyavan
Copy link
Copy Markdown
Member

Fixes microsoft/vscode#305838.

This change removes the redundant standalone response-output-message-id prompt path for OpenAI Responses API round-tripping and keeps that identifier attached only to phased assistant messages.

What changed:

  • Moved responseOutputMessageId into phase metadata so phased assistant messages carry the phase and id together.
  • Stopped attaching/sending a response output message id for non-phased assistant messages.
  • Kept non-phased assistant history in the Responses API request body as plain assistant input messages.
  • Simplified assistant prompt reconstruction to read the id from phase metadata instead of a separate opaque payload.
  • Added regression coverage for the Responses API request body conversion.

Why:

  • The output message id is only meaningful for assistant messages that are emitted with a phase.
  • Keeping it separate added extra serialization and prompt plumbing for OpenAI model requests.
  • Collapsing it into phase metadata reduces metadata overhead and simplifies the round-trip path.

Validation:

  • npm run test:unit -- src/platform/endpoint/node/test/responsesApi.spec.ts
  • TypeScript watch compile reported 0 errors

Notes:

  • The generic streaming delta still exposes phase and responseOutputMessageId separately so provider-agnostic response handling remains unchanged.
  • The simplification is applied in the persisted prompt metadata and resend path, which is where the redundant payload previously affected OpenAI Responses requests.

Copilot AI review requested due to automatic review settings March 27, 2026 22: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

This PR simplifies OpenAI Responses API round-tripping by attaching the responseOutputMessageId only to phased assistant messages (stored alongside phase metadata), and stops emitting/sending that ID for non-phased assistant history.

Changes:

  • Added responseOutputMessageId plumbing to streamed deltas and tool-calling round persistence.
  • Moved Responses API request-body reconstruction to read the ID from phase metadata and emit IDs only for phased assistant messages.
  • Added unit regression coverage for the Responses API request body conversion.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/platform/networking/common/fetch.ts Extends IResponseDelta with responseOutputMessageId for round-tripping support.
src/platform/endpoint/node/responsesApi.ts Emits message IDs only for phased assistant messages; non-phased assistant history becomes plain assistant input messages.
src/platform/endpoint/node/test/responsesApi.spec.ts Adds regression test asserting IDs are only sent for phased assistant messages.
src/platform/endpoint/common/phaseDataContainer.tsx Expands phase opaque payload to include responseOutputMessageId; adds encode/decode helpers for LM DataParts.
src/extension/prompts/node/panel/toolCalling.tsx Includes responseOutputMessageId in PhaseDataContainer when rendering historical phased rounds.
src/extension/prompt/common/toolCallRound.ts Persists responseOutputMessageId on ToolCallRound.
src/extension/prompt/common/intents.ts Adds responseOutputMessageId to IToolCallRound.
src/extension/intents/node/toolCallingLoop.ts Captures responseOutputMessageId from streaming deltas and stores it on the round.
src/extension/conversation/vscode-node/languageModelAccessPrompt.tsx Decodes phase metadata from LM DataParts and re-embeds via PhaseDataContainer.
src/extension/conversation/vscode-node/languageModelAccess.ts Encodes phase metadata (including output message id) into LM progress DataParts.

Comment thread src/platform/endpoint/node/test/responsesApi.spec.ts
Comment thread src/platform/endpoint/node/test/responsesApi.spec.ts
Comment thread src/extension/prompt/common/toolCallRound.ts
roblourens
roblourens previously approved these changes Mar 27, 2026
DonJayamanne
DonJayamanne previously approved these changes Mar 28, 2026
Comment thread __probe3__ Outdated
Copy link
Copy Markdown

@hyperare80-pixel hyperare80-pixel Mar 28, 2026

Choose a reason for hiding this comment

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

remove-

DonJayamanne
DonJayamanne previously approved these changes Mar 30, 2026
@dileepyavan dileepyavan enabled auto-merge March 30, 2026 05:48
@dileepyavan dileepyavan added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit 36da428 Mar 30, 2026
19 checks passed
@dileepyavan dileepyavan deleted the DileepY/remove_id_redundant branch March 30, 2026 06:10
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.

Redundant id property for phase type messages is causing added latency for OpenAI models

6 participants