Skip to content

feat(reasoning): expose GLM-5.3 thinking effort levels - #1726

Open
DreamFate wants to merge 1 commit into
proma-ai:mainfrom
DreamFate:feat/glm53-thinking-effort
Open

feat(reasoning): expose GLM-5.3 thinking effort levels#1726
DreamFate wants to merge 1 commit into
proma-ai:mainfrom
DreamFate:feat/glm53-thinking-effort

Conversation

@DreamFate

Copy link
Copy Markdown
Contributor

Summary

GLM-5.3 currently exposes only an off/high toggle (zai-toggle / anthropic-manual), based on the conclusion in #1708 that official endpoints only accept a thinking switch. That conclusion is now outdated — Zhipu endpoints have since added effort support.

Verified against open.bigmodel.cn with real keys on 2026-08-17:

Endpoint Thinking levels Evidence
/api/anthropic thinking:{type:'adaptive',effort} — low/medium/high/max all 200 with thinking blocks adaptive+high already in production use
/api/paas/v4 reasoning_effort accepts low/high/max only invalid medium returns 400: "请使用 low、high 或 max"
/api/v1 (OpenAI Responses) reasoning.effort — minimal/low/medium/high/max all natively supported output length grows monotonically with effort

Changes

Follows the existing GLM-5.2 profile template — no new mechanisms, no UI changes:

  • GLM_53_LEVELS: ['off','high']['off','low','medium','high','max']
  • Encodings now reuse the three existing generic kinds:
    • anthropic-messages: adaptive-effort (native mapping)
    • openai-completions: zai-thinking-effort (medium degrades to high, same pattern GLM-5.2 uses for level compression)
    • openai-responses: openai-reasoning-effort (native mapping, fixes the profile not matching at all for Responses-mode channels)
  • normalizeGlm53Level widened; existing sessions (off/high) migrate losslessly
  • Dropped the now-unused zai-toggle / anthropic-manual encoding kinds and their compile branches

Notes

  • All three zai channel types are covered automatically: API (zhipu) uses openai-completions; Plan (zhipu-coding) and Team (zhipu-coding-team) share the anthropic-messages path (their default base URL is /api/anthropic, see channel.ts)
  • No new channel provider options; /api/v1 users can use the existing generic openai-responses channel type

Verification

  • bun run typecheck clean; 489 tests pass (1 pre-existing planning-db failure also on main)
  • Runtime check of all three transports: level → normalize → effort mapping matches the table above; glm-5.2 / gpt-5.6 profiles unaffected
  • E2E on dev via Plan channel (/api/anthropic): slider "low" produced thinking:{type:'adaptive',effort:'low'} in the request body (captured through a local pass-through proxy); responses normal

GLM-5.3 endpoints now accept effort levels (verified 2026-08-17):
- /api/anthropic: adaptive thinking effort low/medium/high/max
- /api/v1 (OpenAI Responses): all five levels natively
- /api/paas/v4: reasoning_effort low/high/max (medium degrades to high)

Replace the off/high-only toggle with a full profile following the
GLM-5.2 template: adaptive-effort (anthropic), zai-thinking-effort
(openai-completions) and openai-reasoning-effort (openai-responses).
Drop the now-unused zai-toggle and anthropic-manual encodings.
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