fix(copilot): strip replayed thinking blocks#92830
Merged
Merged
Conversation
Co-authored-by: Gio Della-Libera <[email protected]>
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(copilot): strip replayed thinking blocks This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Contributor
Author
|
Land-ready proof for SHA
Known proof gaps: no live account access to other Copilot Claude model ids; no native cross-OS app flow. The exact affected Copilot Anthropic transport and both official provider tool paths were exercised live. |
This was referenced Jun 14, 2026
This was referenced Jun 14, 2026
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
thinkingandredacted_thinkingblocks from every GitHub Copilot Claude replay turn through the provider-owned sanitizer[assistant reasoning omitted]This is a smaller current-main replacement for #87060 and #81534, based on Gio Della-Libera's provider-owned fix direction.
Fixes #81520
Real behavior proof
Behavior addressed: GitHub Copilot Claude rejects follow-up requests when prior assistant thinking blocks are replayed.
Real environment tested: macOS checkout on commit
19bd9a205d; authenticated GitHub Copilot Anthropic Messages request againstapi.individual.githubcopilot.com; official OpenAI and Anthropic gateway agent/tool probes.Exact steps or command run after this patch: focused GitHub Copilot tests; production/test typing; touched-file format/lint; live Copilot replay harness with an intentionally invalid prior thinking signature; gateway live model suite narrowed to
openai/gpt-5.5andanthropic/claude-sonnet-4-6.Evidence after fix: Copilot
claude-haiku-4.5sent a three-message follow-up payload withpayloadContainsThinking: falseand returned exactlyCOPILOT_REPLAY_OK. The GitHub Copilot suite passed 10 files / 106 tests. Official Anthropic passed prompt,read,exec+read, image, and refusal/tool-continuation probes. Official OpenAI passed prompt,read,exec+read, and image probes.Observed result after fix: Copilot receives no replayed thinking content, while visible assistant text, tool calls/results, and turn structure remain intact.
What was not tested: other account-gated Copilot Claude models were not available. The existing OpenAI tool-call-only edge probe timed out and was skipped after the normal OpenAI tool probes passed; that current-main behavior is separate from this Copilot-only diff and will be investigated independently.
Verification
pnpm test extensions/github-copilot-> 10 files, 106 tests passedpnpm tsgopnpm check:test-typesoxfmtand type-awareoxlintgit diff --checkCo-authored-by: Gio Della-Libera [email protected]