fix(providers): normalize GitHub Copilot Responses streams (#1110) - #1141
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
Summary
Codex clients talking to GitHub Copilot now receive a valid Responses stream.
The
github-copilotprovider entry declaresadapter: "openai-chat"but pins every model to Responses throughmodelWireDefaults, because those models reject/chat/completionsfor real Codex-agent traffic. Those responses reach the Responses relay, which composed only the generic image/id/snapshot repairs — nothing Copilot-specific. Clients therefore saw non-canonical ids, provider-only encrypted/obfuscation fields, and tool-call frames that never formed a valid Responses lifecycle.A provider-scoped, client-facing normalizer now stabilizes response/item ids, strips Copilot-only fields, and reconstructs tool calls from the authoritative
.donepayloads.Raw upstream frames stay untouched. Eager inspection runs before the block rewrite, and on the tee path the raw branch is consumed separately while only the client branch is rewritten — so diagnostics, request logs, and continuation still see exactly what Copilot sent.
Closes #1110.
Attribution
This is @Simon-Opopeee's work from #1111, cherry-picked with their authorship intact on both commits. The design decision that made it adoptable is keeping the repair strictly client-facing rather than mutating the upstream stream — that is what lets it coexist with inspection and continuation.
Dropped: commit
6247d3932, which edited an unrelated CI permission assertion intests/ci-workflows.test.tsand was the sole merge conflict. That file has zero diff in this PR, verified.Reconciled with earlier stack phases: stack 1's bounded
createSseInspectorwork is preserved (the +37 lines of id-pinning coverage were added on top, not reverted), and stack 6's response-model rewrite is composed with the Copilot and snapshot rewrites rather than replaced.#1111 is left open for the author. Planning unit:
devlog/_plan/260806_stacked_bug_campaign/060_phase7_copilot_responses_normalization.md.Stack 8 of the 260806 attribution campaign, stacked on #1139.
Verification
bun test tests/github-copilot-sse-rewrite.test.ts tests/github-copilot-stream-contract.test.ts tests/sse-inspector-bounds.test.ts tests/sse-payload-rewrite.test.ts tests/passthrough-abort.test.ts— 50 pass, 0 failbun run typecheck— exit 0bun run privacy:scan— passedgit diff --stat -- tests/ci-workflows.test.ts— emptyLive Copilot traffic is not available here, so the coverage is fixture-driven rather than a live provider run.
Checklist