Skip to content

fix(providers): bound reasoning diagnostic analysis - #839

Closed
luvs01 wants to merge 7 commits into
devfrom
fix/reasoning-diagnostic-linear
Closed

luvs01 wants to merge 7 commits into
devfrom
fix/reasoning-diagnostic-linear

Conversation

@luvs01

@luvs01 luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reasoning-effort error recovery inspected complete upstream diagnostics with ambiguous whitespace separators. A bounded HTTP error could therefore hold up the synchronous classifier before a downgrade decision was made.

  • Effort repair analyzes at most 1,024 UTF-16 code units across the complete diagnostic, including its envelope. Longer input cannot authorize an effort downgrade or learned rejection.
  • Remove overlapping whitespace repetitions from the parameter and optional-field grammars while retaining their supported separators and quoting.
  • Preserve the original response for normal error handling, including ordinary Combo failover. A long legitimate effort diagnostic now deliberately declines automatic effort repair.
  • Exercise translated and passthrough Responses through synthetic transport and update the owning contract and English, Korean and Spanish guidance.

Addresses the Daybreak finding.

Verification

Current integration — 2026-11-19

Current head: e3cb862653a57e3807c5c86044358c2bc2e2790b. Actual target-repository dev: 0dc315b95a2493ed1fc6193a555f36d645ea186b, included by a normal merge (zero commits behind at publication). The published GitHub tree exactly matches the locally verified tree d56d5f794c4457180e3e2a6d0c772282ffd79a23.

Fixed the concrete Spanish literal-parity failure reported by the previous CI run. The existing detailed diagnostic paragraph now lives in the Spanish provider guide, matching the English guide; the old reference anchor remains and links directly to the new guide anchor. Before the fix, the exact parity testcase failed on cannot use parameter 'reasoning_effort'; after the fix, the two-file docs/size suite passed 51 tests / 3,348 assertions. This normal merge then brings the branch forward from 14 commits behind actual dev and keeps the 2,000-line limit intact.

  • bun test tests/ci-workflows/docs-spanish-localization.test.ts tests/ci-workflows/file-size-ratchet.test.ts: 57 passed / 0 failed / 3,388 assertions on this integration. The two runtime files and six previously focused runtime test files are byte-for-byte unchanged from 32292f7de61f21ec798cbb6168cdd76bc5b73c4e, so passing runtime tests were not repeated for this documentation-only integration.
  • Runs used the normal repository preload, its unmodified network-egress guard, isolated temporary filesystems and local fixtures. No live provider, live SSH endpoint or installed application was exercised.
  • bun run typecheck: 2,589 files, no errors. Structure validation, privacy scan, file-size ratchet and whitespace checks against actual dev passed.
  • Documentation build passed: 784 pages / 119,887 internal links, with per-process Astro/Vite caches. Dependency declarations and frozen lockfiles match the reused installation.

Independent read-only review checked the exact Spanish move, retained anchors, final guide/reference links, and unchanged runtime files. No concrete blocker was found.

The repository's focused-validation exception applies to this integration and concurrent worktrees. The full local suite and broad test:changed were not run; hosted CI provides broader PR coverage. Native macOS/Windows and live-provider acceptance are not claimed.

Hosted CI and review — 2026-11-19 03:25 UTC

Main CI completed successfully; Catalog async contracts completed successfully. These statuses refer to the exact current head above. A queued, running, skipped, cancelled or neutral check is not being represented as a passed test.

Current-head Devin Review completed successfully. CodeRabbit's current-head check is skipped because that app requires a manual review request; its earlier completed review remains historical coverage. All existing inline review threads remain resolved. No new external review comment or review-request message was posted.

The PR remains Ready for review. Successful required CI, maintainer security approval and applicable native-platform acceptance remain separate merge requirements.

Earlier evidence

Earlier runtime verification passed 618 focused tests / 2,649 assertions across reasoning metadata, diagnostics, downgrade, policy fallback, failover classification and credential masking. The prior integrated head also passed 219 focused tests / 933 assertions. The intermediate documentation-fix head 32292f7de61f21ec798cbb6168cdd76bc5b73c4e passed its docs/build/package gates and Catalog checks while its main run was still running when this required dev integration was published; it is not claimed as a successful completed main run. The logged Link transport closures were intentional fixtures; their isolated tests had passed without a runtime change.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The security checkbox records implementation and independent source review; it does not claim maintainer approval.


Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Automatic retries at a lower reasoning effort and learning of unsupported effort levels now require a complete diagnostic of no more than 1,024 UTF-16 code units. Oversized diagnostics or errors that identify a conflicting field do not trigger these actions.
    • The original error remains available to normal error handling, including Combo failover. Existing client error-display limits are unchanged.
  • Documentation
    • Updated provider guides in multiple languages to explain diagnostic limits and which errors qualify.

Keep complete diagnostic inference within 1024 UTF-16 units and remove
ambiguous whitespace separators. Oversized upstream errors stay available
to normal error handling without effort retry or learned rejection.

Cover translated and passthrough Responses with synthetic transport and
carry the reviewed excerpt-mask timing correction used by related fixes.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Reasoning-effort diagnostic checks now enforce input limits and recognize additional parameter forms. Retry, unsupported-effort learning, and Combo fallback paths apply the limits. Tests and documentation describe the resulting behavior.

Changes: Reasoning Diagnostic Handling

Layer / File(s) Summary
Bound diagnostic classification
src/providers/reasoning-metadata.ts, tests/codex-integration/reasoning-metadata.test.ts, structure/providers-and-adapters.md
Reasoning-effort classification and conflict checks limit diagnostic input and recognize additional parameter-name and separator forms. Tests cover size boundaries, conflicting details, and refusal classification.
Apply bounds to retry and fallback paths
src/combos/failover.ts, tests/routing/routing-policy-fallback.test.ts, tests/responses/responses-reasoning-effort-*.test.ts, docs-site/src/content/docs/guides/providers.md, docs-site/src/content/docs/es/guides/providers.md, docs-site/src/content/docs/es/reference/configuration/providers.md, docs-site/src/content/docs/ko/reference/configuration/providers.md, docs-site/src/content/docs/reference/configuration/providers.md
Combo exact-refusal checks use a 16,384-character envelope limit. Tests cover retry and unsupported-effort learning behavior, including preservation of the original response. Provider documentation describes the limits and handling.

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

Change: Bug fix

Suggested reviewers: lidge-jun

Merge Risk: Minimal · up to e3cb8

This change limits how much of an upstream error message is analyzed before a reasoning-effort downgrade or learned rejection. Oversized diagnostics now fall back to normal error handling. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(providers): bound reasoning diagnostic analysis" matches the main change. The PR caps reasoning-effort diagnostic analysis at 1,024 UTF-16 code units (16,384 for the exact-refusal envel…
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.
Full details: Title check

Explanation

The title "fix(providers): bound reasoning diagnostic analysis" matches the main change. The PR caps reasoning-effort diagnostic analysis at 1,024 UTF-16 code units (16,384 for the exact-refusal envelope budget), so oversized diagnostics cannot trigger effort downgrade or learned rejection. The raw summary confirms changes in src/providers/reasoning-metadata.ts, src/combos/failover.ts, the tests, and the docs that describe these limits. The title is short, specific, and follows the conventional-commit style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 cefb567 and e3cb862.

Files selected for processing: 3

  • docs-site/src/content/docs/es/guides/providers.md
  • docs-site/src/content/docs/es/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/providers.md

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Preserve the reviewed security fix while integrating dev c36793a.
Focused regressions, typecheck, structure, privacy, size, documentation and independent integration review passed.
@luvs01
luvs01 marked this pull request as ready for review November 18, 2026 00:21
@luvs01

luvs01 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner Author

No description provided.

coderabbitai[bot]

This comment was marked as resolved.

@luvs01

luvs01 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@luvs01

luvs01 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@luvs01

luvs01 commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

luvs01 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Continued upstream in lidge-jun/opencodex#8983 at c5f66e72cd51f5fc81ad9f0346f919bf5beb41f0, based on dev at d61cca122. The published diff contains all 12 files from this branch. For each file I verified its GitHub blob against the integration commit and compared the added and removed lines against the original change at e3cb862653a57e3807c5c86044358c2bc2e2790b. The runtime bound, routing behavior, regression tests, and operator documentation are all carried upstream.

The integration passed type checking, structure and privacy checks, and the documentation build. Closing this duplicate so review and the remaining test results can be followed on the upstream draft.

@luvs01 luvs01 closed this Nov 20, 2026
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.

1 participant