Skip to content

fix(providers): bound reasoning-effort diagnostic analysis - #8983

Merged
lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:codex/bound-reasoning-diagnostic-analysis
Nov 21, 2026
Merged

lidge-jun merged 2 commits into
lidge-jun:devfrom
luvs01:codex/bound-reasoning-diagnostic-analysis

Conversation

@luvs01

@luvs01 luvs01 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • 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.

Verification

  • Moved the existing effort-diagnostic contract to its own architecture section on 27ed22ca so 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).
  • 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.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Changes: Reasoning-effort diagnostic handling

Layer / File(s) Summary
Bound and classify diagnostics
src/providers/reasoning-metadata.ts, tests/codex-integration/reasoning-metadata.test.ts, docs-site/src/content/docs/guides/providers.md, docs-site/src/content/docs/es/guides/providers.md, docs-site/src/content/docs/reference/configuration/providers.md, docs-site/src/content/docs/es/reference/configuration/providers.md, docs-site/src/content/docs/ko/reference/configuration/providers.md
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.
Bound exact-refusal fallback
src/combos/failover.ts, tests/routing/routing-policy-fallback.test.ts, structure/transports/responses-combo-boundaries.md, structure/providers-and-adapters.md, structure/INDEX.md, structure/manifest.json
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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • 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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed 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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c5f66e7 and 27ed22c.

Files selected for processing: 4

  • structure/INDEX.md
  • structure/manifest.json
  • structure/providers-and-adapters.md
  • structure/transports/responses-combo-boundaries.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
@luvs01
luvs01 marked this pull request as ready for review November 20, 2026 06:28
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (MAINTAINERS.md maintainer-integration exception; lane fb2101-queue-b).

  • Exact head: 27ed22cabd2256bb754011fcc9c54d6fece793d6
  • 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.

@lidge-jun
lidge-jun merged commit f81a735 into lidge-jun:dev Nov 21, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants