Skip to content

feat(config): accept STRIX_REASONING_EFFORT=max for providers that support it - #956

Merged
0xallam merged 3 commits into
mainfrom
devin/1785628268-reasoning-effort-max
Aug 2, 2026
Merged

feat(config): accept STRIX_REASONING_EFFORT=max for providers that support it#956
0xallam merged 3 commits into
mainfrom
devin/1785628268-reasoning-effort-max

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

STRIX_REASONING_EFFORT=max failed config validation, so DeepSeek V4's top reasoning tier was unreachable — ReasoningEffort mirrored the OpenAI SDK's enum, which stops at xhigh.

Adding "max" to the literal is not enough: Reasoning(effort="max") is itself rejected by the OpenAI SDK, and on the native deepseek/ route LiteLLM's DeepSeek transform pops reasoning_effort and substitutes thinking: {"type": "enabled"}, collapsing every level to the provider default. So max skips the SDK field and rides along as a raw body field, passed through verbatim — whether the model supports it is the user's responsibility (unsupported providers reject the request):

if effort != "max":
    return ModelSettings(reasoning=Reasoning(effort=effort))
return ModelSettings(extra_args={..., "extra_body": {"reasoning_effort": "max"}})

Verified on the wire:

STRIX_LLM effort request body
openrouter/deepseek/deepseek-v4-flash max "reasoning_effort": "max" (live completion succeeded)
deepseek/deepseek-v4-flash max "reasoning_effort": "max" (was "thinking": {"type": "enabled"})

The Codex/ChatGPT-subscription clamp gains a maxhigh case alongside the existing xhighhigh one, since that backend only accepts low/medium/high.

Link to Devin session: https://app.devin.ai/sessions/1e2f7b6ab4de438ea9d6e516b57eb96c
Requested by: @0xallam

@0xallam 0xallam self-assigned this Aug 1, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds max as a reasoning-effort configuration value and serializes it according to the selected backend.

  • Sends max as a raw request-body field for LiteLLM-routed providers.
  • Clamps max to xhigh for OpenAI routes and to high for ChatGPT subscription models.
  • Updates validation guidance, documentation, and focused model-settings tests.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code failure identified.

The new value is translated before reaching SDK enums that reject it, provider-route handling is explicit, subscription models use a complete clamp map, and focused tests cover the principal LiteLLM and OpenAI paths.

Important Files Changed

Filename Overview
strix/core/inputs.py Adds backend-aware serialization for maximum reasoning effort while preserving timeout and prompt-cache settings.
strix/config/models.py Adds LiteLLM route detection and a total reasoning-effort translation map for subscription-backed Codex requests.
strix/config/settings.py Extends validated reasoning-effort configuration with the new max value.
tests/test_inputs.py Covers raw max forwarding on DeepSeek and clamping on OpenAI routes.
docs/advanced/configuration.mdx Documents the new effort level and its provider-dependent behavior.

Reviews (1): Last reviewed commit: "feat(config): accept STRIX_REASONING_EFF..." | Re-trigger Greptile

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Tested end-to-end on the real LLM request path (StrixProvider → LiteLLM, wire bodies captured via a CustomLogger printing complete_input_dict).

openrouter/deepseek/deepseek-v4-flash + STRIX_REASONING_EFFORT=max — live completion succeeded (OpenRouter 400s invalid efforts, so success is server-side validation):

WIRE: {"model": "deepseek/deepseek-v4-flash", ..., "reasoning_effort": "max"}
OUTPUT: ...ResponseOutputText(text='OK')...   # response_id gen-1785628516-jp3zZQvTjn5VQ2yDKywR

high and xhigh also pass through verbatim and complete.

Native deepseek/ route: fix vs main

This branch, max (dummy key, expected 401 after send):

WIRE: {"model": "deepseek-v4-flash", ..., "reasoning_effort": "max"}   # no "thinking" key

origin/main, high — the reported bug (LiteLLM pops the effort and substitutes thinking):

WIRE: {"model": "deepseek-v4-flash", ..., "thinking": {"type": "enabled"}}
Other checks
  • STRIX_REASONING_EFFORT=max loads cleanly; bogus still raises the pydantic literal error; on main, max is rejected.
  • openai/gpt-5.4 + maxReasoning(effort='xhigh'), no extra_body.
  • uv run pytest: 1 failed / 653 passed — sole failure is the pre-existing test_finish_scan_bypasses_active_agent_guard_after_reserve. make check-all fails only on the pre-existing PLC0415 in strix/interface/viewer/transcript.py (both confirmed on clean main).

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Re-tested after the simplification (384c5aa — route detection dropped, max always sent as raw body field) with live OpenRouter completions on the real StrixProvider path:

STRIX_REASONING_EFFORT=max → WIRE: {"model": "deepseek/deepseek-v4-flash", ..., "reasoning_effort": "max"}
→ completion succeeded (gen-1785629260-SZtWPzKXuEUD3VIC51z7)

xhigh and high also pass through verbatim and complete (no regression). OpenRouter rejects invalid efforts with a 400, so success is server-side validation. tests/test_inputs.py: 32 passed; ruff check/format clean on changed files.

@0xallam
0xallam merged commit 2e70402 into main Aug 2, 2026
@0xallam
0xallam deleted the devin/1785628268-reasoning-effort-max branch August 2, 2026 00:10
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.

2 participants