Skip to content

fix(proxy): clamp xhigh reasoning effort to high for o-series models - #7370

Open
SailingLoong wants to merge 1 commit into
farion1231:mainfrom
SailingLoong:fix/clamp-xhigh-reasoning-effort-for-o-series
Open

SailingLoong wants to merge 1 commit into
farion1231:mainfrom
SailingLoong:fix/clamp-xhigh-reasoning-effort-for-o-series

Conversation

@SailingLoong

@SailingLoong SailingLoong commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to the second suggestion in #7318's review, now extended with the grok-4.3 note from #7369's review.

Problem / 根因

Since #7318 passes xhigh through verbatim (and max / thinking: adaptive already mapped to it before), two model groups receive a reasoning_effort value they do not accept:

Fix

  1. Whitelist: accept the grok-4.3 family (grok-4.3, grok-4.3-*) in supports_reasoning_effort, alongside the merged grok-4.x (x ≥ 5) rule.
  2. Clamp: clamp_reasoning_effort(model, effort) downgrades xhigh to high when the target is an o-series model or grok-4.3 — the closest supported intent, mirroring how grok-4.5 documents a silent xhigh→high fallback. Applied at both injection sites (Chat Completions reasoning_effort, Responses reasoning.effort). Every other effort value and every other model is byte-identical to before; the new max tier (gpt-5.6/6 family, supports_max_reasoning_effort) never passes through the clamp.

Rebased onto current main (includes #7369's rule and the max-tier resolution).

Tests

  • Unit: whitelist accepts grok-4.3 / grok-4.3-something; clamp downgrades xhigh for o3-mini / o1 / grok-4.3 (incl. mixed case) and passes through for gpt-5.4 / grok-4.6 / grok-4.7 and non-xhigh efforts.
  • Chat path: explicit xhigh and thinking: adaptive against o3-mini emit high; xhigh against grok-4.3 emits high while high passes through.
  • Responses path: xhigh against o3-mini emits high; against gpt-5.4 stays xhigh.
  • cargo test --lib 2991 passed / 0 failed (one known local port-binding flake skipped, unrelated); cargo fmt --check clean.

Happy to adjust.

@github-actions github-actions Bot added backend Backend (Rust/Tauri) proxy Related to proxy/API forwarding labels Sep 13, 2026
@farion1231

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T02:06:56.512525Z 8d1f501 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 8d1f501d3a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SailingLoong

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (includes #7369) and folded in the grok-4.3 note from #7369's review, as suggested there: the grok-4.3 family is now whitelisted (low/medium/high) and xhigh is clamped to high for it alongside the o-series. 2991 tests pass locally, fmt/clippy clean.

@SailingLoong
SailingLoong force-pushed the fix/clamp-xhigh-reasoning-effort-for-o-series branch from 268b32a to 4224af6 Compare October 6, 2026 22:47
@SailingLoong

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (d35726e2) — it had gone conflicting again.

The only textual conflict was main's new test_responses_thinking_off_clamps_effort_to_low landing at the same test anchor; both sides are kept. Adapting to main's new absent-thinking → low rule, the xhigh test inputs now carry thinking: adaptive so they still represent thinking-on traffic — the clamp itself is unchanged. cargo test --lib (3392), fmt, and clippy are clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend (Rust/Tauri) proxy Related to proxy/API forwarding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants