Skip to content

fix: include "max" in supported thinking levels - #24

Merged
simonsmh merged 1 commit into
simonsmh:mainfrom
shyoldman:fix/thinking-level-max
Sep 8, 2026
Merged

simonsmh merged 1 commit into
simonsmh:mainfrom
shyoldman:fix/thinking-level-max

Conversation

@shyoldman

Copy link
Copy Markdown
Contributor

Problem

Qoder's live catalog gives several models a max thinking effort, usually marked as the default. GLM-5.3-Flash comes back with:

{ "high": {}, "max": { "is_default": true } }

PI_THINKING_LEVELS enumerates ["minimal", "low", "medium", "high", "xhigh"], so max never makes it into the map. pi's model picker then offers only high for that model, even though upstream defaults to max. I hit this on GLM-5.3 and GLM-5.3-Flash; Kimi-K3 has the same shape. Qwen Ultimate also advertises max — you just don't notice because it has xhigh too.

The ThinkingLevel type in pi-ai already contains "max", and pi core treats it as a first-class level. The array lags behind the SDK it targets.

Fix

Add "max" to PI_THINKING_LEVELS, so it maps max → max like the other identity mappings.

Verification

  • npm run lint, npm run check, npm test (138 tests) all pass.
  • On a locally patched build I ran /thinking max on GLM-5.3-Flash and captured the outgoing request body (before qoderEncodeBody, via a local echo endpoint):
{"model":"gfmodel","parameters":{"max_tokens":131072,"enable_thinking":true,"reasoning_effort":"max"}}

@shyoldman
shyoldman force-pushed the fix/thinking-level-max branch from cb42500 to 59ed3a1 Compare September 8, 2026 06:00
@shyoldman
shyoldman force-pushed the fix/thinking-level-max branch from 59ed3a1 to df9f9bf Compare September 8, 2026 06:02
@simonsmh
simonsmh merged commit fda9a04 into simonsmh:main Sep 8, 2026
1 check passed
OnlyTomInSecond pushed a commit to OnlyTomInSecond/pi-provider-qoder that referenced this pull request Oct 21, 2026
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