Skip to content

fix: GLM 5.3 always-thinking (force-on) — fixes #162 - #166

Open
Fahad090NP wants to merge 5 commits into
ltmoerdani:mainfrom
Fahad090NP:fix/glm-5.3-thinking-162
Open

fix: GLM 5.3 always-thinking (force-on) — fixes #162#166
Fahad090NP wants to merge 5 commits into
ltmoerdani:mainfrom
Fahad090NP:fix/glm-5.3-thinking-162

Conversation

@Fahad090NP

Copy link
Copy Markdown
Contributor

Summary

Fixes #162 — GLM 5.3 (and later) rejects thinking: { type: "disabled" } with HTTP 400:

"This model always engages in thinking and cannot be disabled; please use low, high, or max"

Changes

  • src/thinking/glm.tsGlmThinking now detects GLM 5.3+ by version (/^glm-5[.\-](?:[3-9]|\d{2,})/i) and forces thinking on (default high). The model picker exposes only high/max and hides off, mirroring the existing Kimi K2.7-code force-on behavior. normalize() upgrades any stale off override to high so cached settings can't trigger the 400.
  • src/retry.ts — added a defensive recovery pattern: when the upstream reports it "cannot be disabled" / "always engages in thinking", the thinking field is stripped from the body so a retry succeeds instead of looping.
  • Testssrc/test/thinking.test.ts (version detection, forced-on resolution, payload shape, picker schema) and src/test/retry.test.ts (cannot-be-disabled recovery).

Verification

  • npm test — 333/333 pass
  • npm run lint — all 7 gates pass (Editorconfig, ESLint, Markdown, Prettier, Shell, TypeScript, Tests)

PEACE BE UPON YOU

GLM 5.3 and later reject thinking: { type: disabled } with 'This model always engages in thinking and cannot be disabled'. Detect 5.3+ by version and force thinking on (default high), mirroring the Kimi K2.7-code force-on fix. The picker now exposes only high/max and hides off.
…ani#162)

The retry safety-net had no pattern for the GLM 5.3 error 'This model always engages in thinking and cannot be disabled'. Add a pattern that strips the thinking field so a stale disabled payload is recovered automatically (the model thinks by default).
Add cases for version detection (dot/hyphen/free/suffix variants), forced-on resolution even with a stale 'off' override, payload shape (reasoning_effort high/max), and picker schema exposing only high/max. Confirms glm-5.2/5.1/5 still allow disabled.
Assert analyzeHttp400ForRetry strips the thinking field for the GLM 5.3 'cannot be disabled' error and recovers.
Add a Fixed entry to CHANGELOG and a note in the per-model thinking controls doc describing the GLM 5.3+ force-on behavior. Also fix pre-existing MD049 underscore emphasis and prettier formatting in both files.
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.

Encountered an error while using GLM 5.3.

1 participant