Skip to content

fix: correct telemetry response for Responses API output#3733

Merged
roblourens merged 3 commits intomicrosoft:mainfrom
zelinms:zelinms/response_assistant_telemetry
Feb 17, 2026
Merged

fix: correct telemetry response for Responses API output#3733
roblourens merged 3 commits intomicrosoft:mainfrom
zelinms:zelinms/response_assistant_telemetry

Conversation

@zelinms
Copy link
Contributor

@zelinms zelinms commented Feb 13, 2026

No description provided.

The test was asserting messagesJson[0].content[0].text but rawMessageToCAPI
converts single text content parts to a plain string, so content is a string
not an array. Updated assertion to check messagesJson[0].content directly.

Also added telemetry emission (sendEngineMessagesTelemetry) to
processResponseFromChatEndpoint so engine.messages events are sent for
Responses API completions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
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

Adds telemetry emission coverage for the OpenAI Responses API stream handling, ensuring assistant output is logged via the existing engine.messages telemetry pathway.

Changes:

  • Emit engine.messages telemetry when a Responses API stream yields a completed assistant message.
  • Add a unit test that validates engine.messages is emitted and contains the assistant’s final text output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/platform/endpoint/node/test/responsesApi.spec.ts Adds a unit test asserting engine.messages telemetry contains the Responses API assistant output.
src/platform/endpoint/node/responsesApi.ts Sends engine.messages telemetry for the final response.completed assistant message (including token usage measurements when available).

@zelinms zelinms changed the title fix: correct telemetry test assertion for Responses API output fix: correct telemetry response for Responses API output Feb 13, 2026
@zelinms zelinms force-pushed the zelinms/response_assistant_telemetry branch from 607e5e1 to 107088f Compare February 13, 2026 21:01
roblourens
roblourens previously approved these changes Feb 13, 2026
@roblourens roblourens enabled auto-merge February 13, 2026 21:43
…stant_telemetry

# Conflicts:
#	src/platform/endpoint/node/responsesApi.ts
auto-merge was automatically disabled February 17, 2026 18:06

Head branch was pushed to by a user without write access

@zelinms zelinms force-pushed the zelinms/response_assistant_telemetry branch from e8ab62e to b4a28b4 Compare February 17, 2026 18:06
@roblourens roblourens enabled auto-merge February 17, 2026 18:26
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
@roblourens roblourens added this pull request to the merge queue Feb 17, 2026
Merged via the queue into microsoft:main with commit 1af66f4 Feb 17, 2026
9 checks passed
karthiknadig pushed a commit that referenced this pull request Feb 24, 2026
karthiknadig added a commit that referenced this pull request Feb 24, 2026
fix: correct telemetry response for Responses API output (cherry-pick #3733)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants