Skip to content

fix(executor): normalize max effort for OpenAI-shape providers - #2916

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.7from
rdself:coder/openai-compatible-max-effort-xhigh
May 29, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.7from
rdself:coder/openai-compatible-max-effort-xhigh

Conversation

@rdself

@rdself rdself commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Normalize reasoning_effort: "max" to xhigh for OpenAI-shape providers when the target supports the top effort tier.
  • Preserve the existing downgrade path to high for providers/models that do not support xhigh.
  • Add regression coverage for OpenAI-compatible Gemini-style routes using both top-level reasoning_effort and nested reasoning.effort.

Tests

  • node --import tsx/esm --test tests/unit/base-executor-sanitize-effort.test.ts tests/unit/translator-claude-to-openai.test.ts tests/unit/translator-openai-responses-req.test.ts
  • npm run typecheck:core
  • npm run lint (passes with existing warnings)

@rdself
rdself requested a review from diegosouzapw as a code owner May 29, 2026 19:40
Copilot AI review requested due to automatic review settings May 29, 2026 19:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds normalization of reasoning_effort: "max" to "xhigh" for OpenAI-shape providers that support the xhigh tier but not the Claude-specific max tier, instead of unconditionally downgrading to high.

Changes:

  • Introduce shouldNormalizeMaxToXHigh branch in sanitizeReasoningEffortForProvider to map max → xhigh when supported.
  • Restrict existing max → high downgrade to providers that also do not support xhigh.
  • Add unit tests for both top-level and nested reasoning.effort normalization paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
open-sse/executors/base.ts New normalization branch + doc comment update; minor formatting of effort allowlist condition.
tests/unit/base-executor-sanitize-effort.test.ts Adds two tests covering top-level and nested max → xhigh normalization.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces normalization logic for OpenAI-compatible providers, mapping the "max" reasoning effort to "xhigh" when that top tier is supported, and otherwise downgrading it to "high". It updates the sanitizeReasoningEffortForProvider function in open-sse/executors/base.ts to handle this normalization for both top-level and nested reasoning configurations, and adds corresponding unit tests in tests/unit/base-executor-sanitize-effort.test.ts. I have no feedback to provide as there are no review comments to address.

@diegosouzapw diegosouzapw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after local verification, quality checks and merging into release/v3.8.7.

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.7 May 29, 2026 20:42
@diegosouzapw
diegosouzapw merged commit 2ae278f into diegosouzapw:release/v3.8.7 May 29, 2026
3 checks passed
@rdself
rdself deleted the coder/openai-compatible-max-effort-xhigh branch May 29, 2026 21:07
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…ble-max-effort-xhigh

fix(executor): normalize max effort for OpenAI-shape providers
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.

3 participants