Skip to content

Preserve xhigh reasoning effort by default - #3756

Merged
diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.24from
rdself:coder/xhigh-pass-through
Jun 13, 2026
Merged

diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.24from
rdself:coder/xhigh-pass-through

Conversation

@rdself

@rdself rdself commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make xhigh reasoning effort pass through by default unless a model explicitly sets supportsXHighEffort: false.
  • Keep the existing max normalization behavior separate from the xhigh pass-through policy.
  • Update sanitize and provider model tests for OpenRouter DeepSeek, explicit Claude opt-outs, and existing max behavior.

Validation

  • node --import tsx/esm --test tests/unit/provider-models-config.test.ts tests/unit/base-executor-sanitize-effort.test.ts tests/unit/executor-base-utils.test.ts
  • npm run typecheck:core
  • git diff --check

diegosouzapw and others added 3 commits June 13, 2026 00:07
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.28.0 to 0.28.1.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.28.0...v0.28.1)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.28.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@rdself
rdself requested a review from diegosouzapw as a code owner June 13, 2026 06:41
Copilot AI review requested due to automatic review settings June 13, 2026 06:41

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.

This PR updates “xhigh” reasoning-effort handling to be opt-out (pass-through by default), while preserving the older opt-in behavior specifically for max → xhigh normalization.

Changes:

  • Switch supportsXHighEffort to treat supportsXHighEffort: false as the only opt-out signal (otherwise pass-through).
  • Add supportsXHighEffortForMaxNormalization and update the sanitizer to use it when deciding whether to normalize max to xhigh.
  • Update unit tests to reflect the new pass-through-by-default behavior for xhigh.

Reviewed changes

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

Show a summary per file
File Description
tests/unit/provider-models-config.test.ts Adds coverage for new max-normalization gate and broader xhigh pass-through expectations.
tests/unit/executor-base-utils.test.ts Updates expectation that xhigh is preserved unless explicitly unsupported.
tests/unit/base-executor-sanitize-effort.test.ts Expands/updates sanitizer tests to match opt-out xhigh behavior and explicit downgrade cases.
open-sse/executors/base.ts Uses new max-normalization gate and updates sanitizer doc comment.
open-sse/config/providerModels.ts Implements opt-out xhigh logic and introduces new helper for max normalization.

Comment thread open-sse/config/providerModels.ts Outdated
Comment on lines 92 to 100
const alias = PROVIDER_ID_TO_ALIAS[aliasOrId] || aliasOrId;
const providerModels = PROVIDER_MODELS[alias] || PROVIDER_MODELS[aliasOrId];
if (!providerModels) return true;
const model = getProviderModel(alias, modelId);

if (alias === "cc") {
return model?.supportsXHighEffort !== false;
}

return model?.supportsXHighEffort === true;
Comment thread open-sse/executors/base.ts Outdated
Comment on lines +267 to +275
const supportsXHigh = supportsXHighEffort(provider, modelStr);
const shouldDowngradeXHigh = effortStr === "xhigh" && !supportsXHigh;
const supportsXHighForMax = supportsXHighEffortForMaxNormalization(provider, modelStr);
const shouldNormalizeMaxToXHigh =
effortStr === "max" && !supportsMaxEffortForProvider(provider, modelStr) && supportsXHigh;
effortStr === "max" && !supportsMaxEffortForProvider(provider, modelStr) && supportsXHighForMax;
const shouldDowngradeMax =
effortStr === "max" && !supportsMaxEffortForProvider(provider, modelStr) && !supportsXHigh;
effortStr === "max" &&
!supportsMaxEffortForProvider(provider, modelStr) &&
!supportsXHighForMax;

@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 changes the reasoning effort sanitization logic so that xhigh effort is allowed by default (pass-through) across providers unless a model explicitly opts out, while preserving the original opt-in behavior for max to xhigh normalization via a new helper supportsXHighEffortForMaxNormalization. Feedback on the changes highlights that dynamic or custom Anthropic-compatible providers (starting with anthropic-compatible-) will bypass safety checks because they lack a static mapping to the cc alias, and suggests resolving these prefixes to cc to ensure correct capability lookups.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +83 to 101
// Keep explicit false entries as the unsupported-model list. Unlisted models
// and models without an explicit flag pass through unchanged.
return model?.supportsXHighEffort !== false;
}

export function supportsXHighEffortForMaxNormalization(
aliasOrId: string,
modelId: string
): boolean {
const alias = PROVIDER_ID_TO_ALIAS[aliasOrId] || aliasOrId;
const providerModels = PROVIDER_MODELS[alias] || PROVIDER_MODELS[aliasOrId];
if (!providerModels) return true;
const model = getProviderModel(alias, modelId);

if (alias === "cc") {
return model?.supportsXHighEffort !== false;
}

return model?.supportsXHighEffort === true;
}

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.

high

For dynamic or custom Anthropic-compatible providers (whose IDs start with anthropic-compatible-), PROVIDER_ID_TO_ALIAS will not contain a static mapping, causing supportsXHighEffort and supportsXHighEffortForMaxNormalization to treat them as unknown providers. This defaults them to true (pass-through) for all models, bypassing safety checks and allowing unsupported effort levels (like xhigh or max) on models that explicitly opt out (e.g., claude-haiku-4-5-20251001).

Resolving any anthropic-compatible- prefix to "cc" (the alias for "claude") ensures we correctly look up the model's capabilities in the Claude registry.

  // Keep explicit false entries as the unsupported-model list. Unlisted models
  // and models without an explicit flag pass through unchanged.
  const resolvedId = aliasOrId.startsWith("anthropic-compatible-") ? "cc" : aliasOrId;
  const resolvedAlias = PROVIDER_ID_TO_ALIAS[resolvedId] || resolvedId;
  const resolvedModel = getProviderModel(resolvedAlias, modelId);
  return resolvedModel?.supportsXHighEffort !== false;
}

export function supportsXHighEffortForMaxNormalization(
  aliasOrId: string,
  modelId: string
): boolean {
  const resolvedId = aliasOrId.startsWith("anthropic-compatible-") ? "cc" : aliasOrId;
  const alias = PROVIDER_ID_TO_ALIAS[resolvedId] || resolvedId;
  if (alias === "cc") {
    return supportsXHighEffort(aliasOrId, modelId);
  }
  const providerModels = PROVIDER_MODELS[alias] || PROVIDER_MODELS[resolvedId];
  if (!providerModels) return true;
  const model = getProviderModel(alias, modelId);
  return model?.supportsXHighEffort === true;
}

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.24 June 13, 2026 11:01
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @rdself! Splitting the xhigh policy into opt-out pass-through (supportsXHighEffort) while keeping the conservative opt-in behavior isolated for max-normalization (supportsXHighEffortForMaxNormalization) is a clean separation, and the tests are stronger for it (the previous xhigh || high OR-assertions were masking). Validated 49/49 on the merged state + typecheck:core clean. Merging into release/v3.8.24 for the upcoming release. 🙌

@diegosouzapw
diegosouzapw merged commit c5924a7 into cheaper-inference:release/v3.8.24 Jun 13, 2026
2 checks passed
diegosouzapw added a commit that referenced this pull request Jun 13, 2026
… v3.8.24 merges

These 5 files exceeded the frozen baseline solely because of already-merged,
already-reviewed v3.8.24 PRs that landed after this branch froze its baseline:
  - src/lib/providers/validation.ts        4209→4302  (#3767 qwen-web fix)
  - src/shared/components/RequestLoggerV2.tsx 1232→1276 (#3760 logs light-mode)
  - open-sse/executors/antigravity.ts      1553→1572  (#3766 antigravity refresh)
  - open-sse/executors/base.ts             1199→1205  (#3756 xhigh effort)
  - open-sse/translator/response/openai-responses.ts 873→878 (#3762 tool-call integrity)

None are touched by this branch; the bump reflects current release reality.
diegosouzapw added a commit that referenced this pull request Jun 13, 2026
…contributor credits

- Restructure [3.8.24] into ✨ Features / 🔒 Security / 🐛 Fixed / 📝 Maintenance
- Add bullets for every PR landed since v3.8.23 that was missing:
  marketplace (#3656), strict-mode CC defaults (#3776), emergency-fallback flag (#3752),
  xhigh effort (#3756), Codex memory WS (#3749), IPv6 egress (#3777),
  marketplace SSRF (#3774), CodeQL/Dependabot (#3778), anthropic sampling (#3780),
  thinking passthrough (#3775), mcp dist entry (#3765), streamed tool args (#3762),
  logs light-mode (#3760), clean-history purge (#3751), quality-gates (#3757),
  docs gaps (#3453), file-size re-baseline (#3770), E415 publish guard, i18n prune
- Move misplaced #3775 bullet out of [Unreleased] into [3.8.24]
- Date [3.8.23] header (TBD -> 2026-06-12, the release tag date)
@diegosouzapw diegosouzapw mentioned this pull request Jun 13, 2026
diegosouzapw added a commit that referenced this pull request Jun 13, 2026
…n stale codex/plugins tests

- Date the [3.8.24] section (2026-06-13) and add the missing CHANGELOG bullet
  for the combo + quota-shared deep audit (#3779).
- Align two unit tests left stale by intentional behavior changes this cycle:
  executor-codex now asserts gpt-5.4-mini xhigh passthrough (#3756 default),
  and plugins-route-error-sanitization now covers the /api/plugins/marketplace
  route added by #3656 (verified Hard Rule #12 compliant). No production change.
@rdself
rdself deleted the coder/xhigh-pass-through branch June 24, 2026 03:25
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…contributor credits

- Restructure [3.8.24] into ✨ Features / 🔒 Security / 🐛 Fixed / 📝 Maintenance
- Add bullets for every PR landed since v3.8.23 that was missing:
  marketplace (cheaper-inference#3656), strict-mode CC defaults (cheaper-inference#3776), emergency-fallback flag (cheaper-inference#3752),
  xhigh effort (cheaper-inference#3756), Codex memory WS (cheaper-inference#3749), IPv6 egress (cheaper-inference#3777),
  marketplace SSRF (cheaper-inference#3774), CodeQL/Dependabot (cheaper-inference#3778), anthropic sampling (cheaper-inference#3780),
  thinking passthrough (cheaper-inference#3775), mcp dist entry (cheaper-inference#3765), streamed tool args (cheaper-inference#3762),
  logs light-mode (cheaper-inference#3760), clean-history purge (cheaper-inference#3751), quality-gates (cheaper-inference#3757),
  docs gaps (cheaper-inference#3453), file-size re-baseline (cheaper-inference#3770), E415 publish guard, i18n prune
- Move misplaced cheaper-inference#3775 bullet out of [Unreleased] into [3.8.24]
- Date [3.8.23] header (TBD -> 2026-06-12, the release tag date)
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…elog bullet, align stale codex/plugins tests

- Date the [3.8.24] section (2026-06-13) and add the missing CHANGELOG bullet
  for the combo + quota-shared deep audit (cheaper-inference#3779).
- Align two unit tests left stale by intentional behavior changes this cycle:
  executor-codex now asserts gpt-5.4-mini xhigh passthrough (cheaper-inference#3756 default),
  and plugins-route-error-sanitization now covers the /api/plugins/marketplace
  route added by cheaper-inference#3656 (verified Hard Rule cheaper-inference#12 compliant). No production change.
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