Preserve Responses API output item order#326410
Draft
dileepyavan wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Preserves Responses API output ordering when replaying stateless tool-call history.
Changes:
- Propagates message and reasoning output indices.
- Serializes assistant, reasoning, and compaction content in rendered order.
- Adds stream, serialization, and prompt-rendering regression tests.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/platform/thinking/common/thinking.ts |
Adds reasoning output-index metadata. |
extensions/copilot/src/platform/networking/common/fetch.ts |
Exposes message output indices in response deltas. |
extensions/copilot/src/platform/endpoint/node/test/responsesApi.spec.ts |
Tests serialization and streamed indices. |
extensions/copilot/src/platform/endpoint/node/responsesApi.ts |
Preserves content order and emits indices. |
extensions/copilot/src/extension/prompts/node/panel/toolCalling.tsx |
Reorders replayed response and reasoning content. |
extensions/copilot/src/extension/prompts/node/panel/test/toolCalling.spec.ts |
Tests commentary-before-reasoning rendering. |
extensions/copilot/src/extension/prompt/common/toolCallRound.ts |
Stores output-index metadata. |
extensions/copilot/src/extension/prompt/common/intents.ts |
Extends the tool-round contract. |
extensions/copilot/src/extension/intents/node/toolCallingLoop.ts |
Accumulates and propagates message indices. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Medium
Comment on lines
+142
to
+144
| const responsePrecedesThinking = round.responseOutputIndex !== undefined | ||
| && round.thinking?.outputIndex !== undefined | ||
| && round.responseOutputIndex < round.thinking.outputIndex; |
| <AssistantMessage toolCalls={assistantToolCalls}> | ||
| {statefulMarker} | ||
| {responsePrecedesThinking ? phase : undefined} | ||
| {responsePrecedesThinking ? round.response : undefined} |
dileepyavan
marked this pull request as draft
July 18, 2026 00:43
Contributor
|
❌ Failed to queue vscode build for The federated identity Fix: in Azure DevOps, open the pipeline → ⋮ → Security, and grant az pipelines run output |
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.
Summary
output_indexmetadata through tool-call roundsfixes #318813