Skip to content

fix(apicompat): emit rs-prefixed Responses reasoning item IDs - #4848

Open
r266-tech wants to merge 1 commit into
Wei-Shaw:mainfrom
r266-tech:codex/fix-responses-item-id-prefix
Open

r266-tech wants to merge 1 commit into
Wei-Shaw:mainfrom
r266-tech:codex/fix-responses-item-id-prefix

Conversation

@r266-tech

@r266-tech r266-tech commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Responses compatibility bridges emit generic item_* IDs for reasoning output, and the Chat Completions stream generates a different reasoning ID in response.completed from the one announced earlier. This breaks replay into strict Responses upstreams and changes item identity within a stream.

Generate rs_* reasoning IDs in the Anthropic and Chat Completions conversions, and reuse the announced ID throughout the Chat Completions stream lifecycle. Non-compact OAuth passthrough clears invalid reasoning input ID prefixes while preserving valid native rs_* IDs, encrypted content, summaries, other fields, and non-reasoning IDs. Compact requests retain their existing ID behavior.

Rebased onto upstream main at 15871f904056f548dd874a1d069ffc6cdf777b78, preserving current signed/redacted-thinking handling, including Fable 5.2 and Mythos 5.2. The existing OAuthAdditionalToolsDeclarationID forwarding regression passes all eight passthrough/lite/stream combinations without changing its assertions.

Validation on macOS arm64 with Go 1.27.4:

  • Against unchanged current-main production files, 11 of 12 targeted leaf scenarios fail; the compact-ID preservation control passes. All 12 pass with the fix.
  • go test -p 1 -tags=unit ./...: passed across the backend (60 packages with tests).
  • go test -p 1 -tags=integration ./...: passed across the backend (54 packages with tests).
  • Targeted race checks for reasoning ID lifecycle, OAuth normalization, and actual OAuth forwarding passed: 31 test/subtest pass events.
  • CI-pinned golangci-lint v2.14.0 across the backend: 0 issues.
  • govulncheck ./...: no reachable or imported-package vulnerabilities; six module advisories concern code that this application does not appear to call.
  • gofmt and git diff --check passed.

Existing conditional test gates remain in place. No live-provider reproduction or deployment validation was run. Hosted CI is tracked separately.

AI disclosure: this update was authored and validated by an autonomous AI agent.

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@r266-tech

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 25, 2026
@r266-tech

Copy link
Copy Markdown
Contributor Author

recheck

@r266-tech
r266-tech force-pushed the codex/fix-responses-item-id-prefix branch from b96ff6e to 5ead8d6 Compare November 17, 2026 14:33
@r266-tech
r266-tech marked this pull request as ready for review November 18, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant