Repository navigation
Preserve xhigh reasoning effort by default - #3756
diegosouzapw merged 4 commits into
Conversation
…prevent E415 hard-link tarball rejection
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>
There was a problem hiding this comment.
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
supportsXHighEffortto treatsupportsXHighEffort: falseas the only opt-out signal (otherwise pass-through). - Add
supportsXHighEffortForMaxNormalizationand update the sanitizer to use it when deciding whether to normalizemaxtoxhigh. - 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. |
| 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; |
| 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; |
There was a problem hiding this comment.
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.
| // 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; | ||
| } |
There was a problem hiding this comment.
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;
}|
Thanks @rdself! Splitting the xhigh policy into opt-out pass-through ( |
c5924a7
into
cheaper-inference:release/v3.8.24
… 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.
…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)
…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.
Integrated into release/v3.8.24
…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)
…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.
Summary
supportsXHighEffort: false.maxnormalization behavior separate from the xhigh pass-through policy.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.tsnpm run typecheck:coregit diff --check