Skip to content

fix(providers): strip reasoning_effort/reasoning from grok-cli requests (#6288) - #6503

Merged
diegosouzapw merged 4 commits into
release/v3.8.47from
fix/6288-grok-cli-reasoning-effort
Jul 7, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.47from
fix/6288-grok-cli-reasoning-effort

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Closes #6288

Root cause

open-sse/executors/grok-cli.ts::transformRequest() strips a fixed UNSUPPORTED list of sampling params (presencePenalty, frequencyPenalty, logprobs, topLogprobs — added for #5273) before forwarding the request body to Grok Build's upstream chat-proxy endpoint (https://cli-chat-proxy.grok.com/v1/chat/completions). It never stripped reasoning_effort or a nested reasoning object. Claude Code (routing the Opus slot) sends reasoning_effort on every request, so every grok-build request 400s upstream. The sibling open-sse/executors/xai.ts already solves this class of problem for the separate xai provider — grok-cli is a different executor and was missing the same guard.

Fix

Added "reasoning_effort" and "reasoning" to the UNSUPPORTED strip list in grok-cli.ts::transformRequest().

TDD evidence (Hard Rule #18)

New file tests/unit/grok-cli-reasoning-strip-6288.test.ts:

  • RED before the fix: reasoning key assertion failed (true !== false — key was present) and the combined-params test failed on reasoning_effort must be stripped.
  • GREEN after the fix: all 3 new tests pass, plus the existing tests/unit/grok-cli-strip-params.test.ts (fix(grok-cli): strip unsupported params (presencePenalty, etc.) before sending #5273) still passes (2/2) — no regression in the original stripping behavior.
  • Combined run: node --import tsx/esm --test tests/unit/grok-cli*.test.ts → 20/20 pass.

Gates run green

  • file-size (check-file-size.mjs) — no flag on grok-cli.ts or the new test file
  • complexity (check-complexity.mjs) — no flag
  • typecheck (npm run typecheck:core) — exit 0
  • lint (eslint --suppressions-location config/quality/eslint-suppressions.json) — exit 0 on both changed files
  • test — new regression file + existing sibling grok-cli-strip-params.test.ts, 20/20 pass

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.46 to release/v3.8.47 July 7, 2026 11:03
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Merged — synced onto the v3.8.47 tip (CONFLICTING was base-drift). CHANGELOG guard applied. All checks green. Fixes #6288.

@diegosouzapw
diegosouzapw merged commit 359fc03 into release/v3.8.47 Jul 7, 2026
9 checks passed
@diegosouzapw
diegosouzapw deleted the fix/6288-grok-cli-reasoning-effort branch July 10, 2026 17:08
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…ts (diegosouzapw#6288) (diegosouzapw#6503)

fix(providers): strip reasoning_effort/reasoning from grok-cli requests (diegosouzapw#6288). Integrated into release/v3.8.47.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ts (diegosouzapw#6288) (diegosouzapw#6503)

fix(providers): strip reasoning_effort/reasoning from grok-cli requests (diegosouzapw#6288). Integrated into release/v3.8.47.
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.

1 participant