fix(github-copilot): sanitize unsafe reasoning replay ids#83221
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level: current main replays persisted reasoning items with IDs intact and the Copilot sanitizer skips reasoning items, while the linked report provides redacted runtime failures and a structural probe showing overlong reasoning IDs. I did not run a live Copilot replay in this read-only review. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the provider-boundary sanitizer after maintainer review and either redacted after-fix Copilot replay proof or an explicit proof override, then let the linked bug close on merge. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main replays persisted reasoning items with IDs intact and the Copilot sanitizer skips reasoning items, while the linked report provides redacted runtime failures and a structural probe showing overlong reasoning IDs. I did not run a live Copilot replay in this read-only review. Is this the best way to solve the issue? Yes. Sanitizing only GitHub Copilot replay IDs at the provider payload boundary is the narrowest maintainable fix and avoids changing shared OpenAI Responses replay behavior or session-file migration. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against bc4f27c89a3c. |
544e3dd to
6c89034
Compare
6c89034 to
b481eec
Compare
|
Maintainer verification for source head b481eec against base git diff --check upstream/main...HEAD
node scripts/check-changelog-attributions.mjs CHANGELOG.md
node scripts/run-vitest.mjs extensions/github-copilot/connection-bound-ids.test.ts extensions/github-copilot/stream.test.ts src/agents/openai-transport-stream.test.ts -- -t "github-copilot connection-bound response IDs|sanitizes reasoning replay|overlong Copilot Responses replay"Result: all commands passed. The focused Vitest command covered 4 files / 349 tests, including the Copilot connection-bound ID sanitizer, the Copilot Responses stream hook, and the core replay regression case. The Real behavior proof parser also passes for the PR body after the proof-field formatting fix, and the current PR head has no failed or pending GitHub checks. Known proof gap: I did not run a live GitHub Copilot replay against the original private affected session because that requires private session state and provider credentials. The landing proof is the redacted before evidence plus provider-boundary sanitizer coverage that reproduces and blocks the overlong reasoning replay item shape. |
Summary
reasoningreplay items with overlong/non-replayable IDs after tool-call replay IDs were repaired.invalid_request_bodyschema failures, so affected web chat and scheduled agent turns cannot continue.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
reasoning.idvalues after overlong replay tool IDs are normalized; unsafe Copilot reasoning replay items are removed at the Copilot adapter boundary.bug-019-copilot-replay-reasoning-ids, model route represented asgithub-copilot/gpt-5.5native Responses.node node_modules\vitest\vitest.mjs run extensions\github-copilot\connection-bound-ids.test.ts -t "github-copilot connection-bound response IDs" --reporter=verbose --pool=threads --maxWorkers=1 --testTimeout=30000; thennode node_modules\vitest\vitest.mjs run extensions\github-copilot\stream.test.ts -t "sanitizes reasoning replay" --reporter=verbose --pool=threads --maxWorkers=1 --testTimeout=30000; thennode node_modules\vitest\vitest.mjs run src\agents\openai-transport-stream.test.ts -t "overlong Copilot Responses replay" --reporter=verbose --pool=threads --maxWorkers=1 --testTimeout=30000; thengit diff --check.+,/, and=, drops overlong/missing/non-string reasoning replay items as whole items, and still rewrites message/function-call connection-bound IDs to stable Copilot-safe IDs.pnpm check:changedwas not run locally because this is a Codex worktree.oxfmt --writewas attempted on the touched files but failed in this worktree with Windowsspawn EPERM;git diff --checkpassed.400 {"message":"","code":"invalid_request_body"}withproviderRuntimeFailureKind="schema"and stable failure hashsha256:3c08634b4d9f. A sanitized structural probe of the affected replay showedfunctionCalls=114,functionOutputs=114,callIdsOver64=0,orphanOutputs=0, andduplicateIds=0, but still hadidsOver64=53, all onreasoningitems, withmaxIdLen=408. The first offending item was same-provider Copilot native Responsesreasoningwith keysencrypted_content,id,summary,typeand non-safe/overlong ID content.Root Cause (if applicable)
thinkingSignatureJSON, while the Copilot adapter's existing connection-bound ID sanitizer intentionally skipped reasoning items. After the prior tool-ID repair, overlong function-call IDs were fixed but overlong Copilot reasoning item IDs still reached the native Responses request body.invalid_request_body, so once tool IDs were repaired the remaining reasoning ID failures no longer named the exact offending field.Regression Test Plan (if applicable)
extensions/github-copilot/connection-bound-ids.test.ts;extensions/github-copilot/stream.test.ts; adjacent unchanged coverage insrc/agents/openai-transport-stream.test.ts.User-visible / Behavior Changes
Copilot-backed agent sessions with invalid persisted reasoning replay item IDs should resume instead of failing before generation with a schema/tool-payload rejection. Valid Copilot reasoning replay IDs are still preserved.
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
github-copilot/gpt-5.5native Responses.github-copilot+openai-responses; private agent/session identifiers omitted.Steps
Expected
reasoningreplay items with missing, non-string, or overlong IDs are dropped as whole items.reasoning.idvalues of length 1-64 are preserved, including base64-ish characters.Actual
reasoning.idvalues in the affected session structure after tool-call IDs had been normalized.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
git diff --check.encrypted_content; base64-ish valid IDs containing+,/, and=; overlong, missing, and non-string reasoning IDs; deterministic rewriting for message/function-call IDs.spawn EPERMblocker noted above.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations