You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Limit the complete diagnostic used for reasoning-effort repair and rejection learning to 1,024 UTF-16 code units. A longer diagnostic leaves the original provider error available for ordinary error handling.
Preserve supported parameter labels and quoted effort values. Cover translated and passthrough Responses, routing, and the provider metadata helper.
Update the provider contract and operator guidance to describe when automatic effort repair is available.
The combined runtime passed 22 focused cases (465 assertions) covering ordinary effort repair, terminal refusals, context-window classification and diagnostic limits. The final tree passed the structure check and its 51 regression tests. The last revision changes architecture documentation and its source map only.
On Windows x64 with Bun 1.4.4, bun run typecheck checked 2,681 files. bun run structure:check, bun run privacy:scan, and git diff --check passed.
The documentation build passed and checked 126,229 internal links across 820 pages.
bun test tests/codex-integration/reasoning-metadata.test.ts tests/responses/responses-reasoning-effort-diagnostics.test.ts tests/responses/responses-reasoning-effort-downgrade.test.ts tests/routing/routing-policy-fallback.test.ts passed all 333 tests. The Windows test worker was shared with another suite, so local validation focused on these four files. The full local suite was not run for this head.
The author-side diff review covered credential handling, logging, authorization and defaults. The 1,024-code-unit limit applies to effort repair and learning. Existing exact HTTP 400 next-candidate handling retains its separate 16,384-code-unit envelope limit and refusal checks.
Checklist
Scope stays focused and avoids unrelated cleanup.
Docs or release notes were updated when needed.
Reviewed the change for secrets, authentication, and unsafe defaults. Maintainer review is pending.
Summary by CodeRabbit
Behavior Updates
Automatic reasoning-effort retries and unsupported-effort learning require a complete diagnostic of up to 1,024 UTF-16 code units. Longer or conflicting diagnostics do not trigger these actions.
Original error responses remain available to normal error handling, including standard Combo failover. Exact-refusal fallback can inspect envelopes up to 16,384 code units, while conflicting fields still prevent fallback.
Documentation
Updated provider guidance and configuration references in English, Spanish, and Korean to describe diagnostic limits and handling.
No actionable comments were generated in the recent review.
Walkthrough
Reasoning-effort rejection analysis now uses complete diagnostics up to 1,024 UTF-16 code units. Exact-refusal fallback checks can inspect envelopes up to 16,384 characters. Tests and documentation cover diagnostic classification, retries, learning, and fallback.
Diagnostic analysis rejects inputs over 1,024 UTF-16 code units and adjusts parameter-label and prefix matching. Tests cover boundary and classification cases. Provider guides and references document the limits and behavior.
Validate downgrade and learning behavior tests/responses/responses-reasoning-effort-diagnostics.test.ts, tests/responses/responses-reasoning-effort-downgrade.test.ts, tests/codex-integration/reasoning-metadata.test.ts
Tests verify that oversized diagnostics do not trigger downgrade attempts or unsupported-effort learning. They also check that upstream error responses remain available.
Combo exact-refusal checks use a 16,384-character envelope limit. Routing tests cover exact-limit, over-limit, and conflicting diagnostic cases. Structure documentation records the limits and matching rules.
lidge-jun/opencodex#8257: The changes update reasoning-effort rejection analysis and learning. They do not add replay to the native Chat lane described in the issue.
Suggested reviewers:omar391
Merge Risk: Minimal · up to 27ed2
This change limits reasoning-effort diagnostic analysis to 1,024 code units and keeps the larger envelope for exact-refusal fallback. No actionable merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(providers): bound reasoning-effort diagnostic analysis" matches the main change. The PR caps the complete reasoning-effort diagnostic used for effort repair and rejection learning at 1,…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "fix(providers): bound reasoning-effort diagnostic analysis" matches the main change. The PR caps the complete reasoning-effort diagnostic used for effort repair and rejection learning at 1,024 UTF-16 code units, and the changed files (reasoning-metadata.ts, failover.ts, tests, docs) implement and document that bound. The title is specific and concise, and it follows the conventional commit style. It does not cover the preserved 16,384-unit exact-refusal envelope, but the title does not need to cover every detail.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Checks on this head: all completed checks pass (ci aggregate with gates and test changed, CodeRabbit, enforce-target, hygiene); none pending or failing.
Review: terra review APPROVE-WITH-NITS, no defect; reasoning-metadata/diagnostics/downgrade/policy-fallback suites 333 pass and typecheck exit 0; maintainer check: the new tests fail against origin/dev src/providers/reasoning-metadata.ts + src/combos/failover.ts (320 pass / 13 fail) and pass on this head.
Review threads: 0 unresolved.
Scope: bounded diagnostic analysis in src/providers/reasoning-metadata.ts and src/combos/failover.ts plus docs; no auth, workflow, release, dependency or provider-preset surface.
This is maintainer integration, not an independent approval.
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
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
Verification
27ed22caso that fix(combos): preserve moderation category boundaries in a single scan #8978 can edit its separate refusal grammar independently. All six local squash orders of fix(combos): preserve moderation category boundaries in a single scan #8978 (6fc8e0ff), fix(retry): bound context-overflow negation matching #8980 (5b2c7f3e), and this PR produced the same tree (20a0f0f34d8c667711a41e5f27b203c1b51f1713).bun run typecheckchecked 2,681 files.bun run structure:check,bun run privacy:scan, andgit diff --checkpassed.bun test tests/codex-integration/reasoning-metadata.test.ts tests/responses/responses-reasoning-effort-diagnostics.test.ts tests/responses/responses-reasoning-effort-downgrade.test.ts tests/routing/routing-policy-fallback.test.tspassed all 333 tests. The Windows test worker was shared with another suite, so local validation focused on these four files. The full local suite was not run for this head.Checklist
Summary by CodeRabbit
Behavior Updates
Documentation