Repository navigation
copilot: preserve HTTP correlation for incomplete Responses streams - #345630
Merged
Dileep Yavanmandha (dileepyavan) merged 1 commit intoNov 2, 2026
Merged
Dileep Yavanmandha (dileepyavan) merged 1 commit into
Dileep Yavanmandha (dileepyavan) merged 1 commit into
Conversation
Retain HTTP request metadata independently of streamed completions so the no-choices failure retains diagnostic correlation. Keep completion-derived metadata and existing response classifications unchanged. Fixes #344706 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the correlation-metadata retention change.
No open issues 🎉
What changed in this PR
Preserves HTTP correlation metadata when Copilot Responses streams end without a terminal completion, addressing #344706 without treating incomplete streams as successful.
Changes:
- Retains HTTP request metadata independently of streamed completions.
- Uses retained metadata in the no-choices fallback while preserving completion-derived values and existing classifications.
- Adds six regression and control cases covering incomplete streams, valid completion, explicit errors, and absent correlation headers.
| File | Description |
|---|---|
extensions/copilot/src/platform/openai/node/fetch.ts |
Adds optional HTTP correlation metadata to ChatResults. |
extensions/copilot/src/extension/prompt/node/test/chatMLFetcherResponseApiTelemetry.spec.ts |
Tests correlation retention through the real Responses parser and final classifier. |
extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts |
Captures HTTP metadata and uses it when no completion supplies correlation. |
Review effort: Balanced
Federico Brancasi (federicobrancasi)
approved these changes
Nov 2, 2026
Ross Wollman (rwoll)
approved these changes
Nov 2, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
agents/fix-responses-request-id-344706
branch
November 2, 2026 20:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #344706
Problem
An HTTP Responses stream can end without emitting a terminal completion, for example after a reasoning item or with an unterminated completion frame. The final classifier correctly returns
unknownwithResponse contained no choices., but previously obtained correlation only from retained completions. With none available, it discarded the actual HTTP request ID, making service-side investigation harder.This fixes diagnostic correlation loss, not the underlying cause of an incomplete upstream stream.
Changes
X-Request-ID, Copilot service request ID, and rawX-GitHub-Copilot-Request-Tein the no-choices fallback.No truncated frame is accepted as a completion, and no incomplete response is converted into success.
Validation
The three incomplete-stream correlation cases were verified to fail when HTTP metadata retention was temporarily removed; the completed-response and explicit-error controls still passed. The fix was restored before final validation.
From
extensions\copilot:Passed: 118 tests across four files. The module-resolution options are needed for this worktree's existing dependency junctions; without them, Vitest fails during initialization, including in the existing parser suite.
From the repository root:
pnpm run eslint extensions\copilot\src\platform\openai\node\fetch.ts extensions\copilot\src\extension\prompt\node\chatMLFetcher.ts extensions\copilot\src\extension\prompt\node\test\chatMLFetcherResponseApiTelemetry.spec.ts git diff --checkPassed: targeted ESLint and whitespace checks.
From
extensions\copilot:Failed: the installed
@typescript/nativepackage does not export@typescript/native/astor@typescript/native/async, producing 16 resolution errors in the unchanged TypeScript-context code. The existing shared dependency installation was not modified.No standalone type-check, live provider request, integration suite, or smoke suite was run.