anomalyco / anomalyco/opencode
[FEATURE]: Expose low/high/max reasoning effort for z-ai/glm-5.3(-flash) (parity with glm-5.2 and xAI fix #42160)
@neriousy is already working on this.
Since Aug 30, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
feat(provider): expose low/high/max reasoning effort for z-ai/glm-5.3(-flash)
Context
z-ai/glm-5.3 and glm-5.3-flash support reasoning_effort: low / high / max (default max, thinking.type=disabled returns 400). This is documented in docs.z.ai/guides/llm/glm-5.3.md and zai-org/GLM-5.3-Flash on Hugging Face. glm-5.2 already exposes variants in OpenCode, so 5.3 is the natural follow-up. This would bring it in line with the recent xAI fix for grok-3-mini (#42160), but with its own value set.
Current behavior
packages/opencode/src/provider/transform.ts:730-790 (v1 1.18.25) defines variants for glm-5.2 (high/xhigh via @openrouter, high/max via openai-compatible):
const glm52 = ["glm-5.2", ...].some(...)
if (glm52 && npm === "@openrouter/ai-sdk-provider") return {high, xhigh}
...
if (id.includes("glm") && !glm52) return {}
As a result z-ai/glm-5.3(-flash) via any provider (openrouter, openai-compatible, ...) currently has no variants — the TUI shows no options and agent.options.reasoningEffort has no effect. The model always runs at the default max.
Expected
Expose the three levels for glm-5.3(-flash) on the same providers as 5.2, for example:
const glm53 = ["glm-5.3", "glm-5-3", "glm-5p3", "glm-5.3-flash"].some(...)
if (glm53 && npm === "@openrouter/ai-sdk-provider")
return { low: { reasoning: { effort: "low" } }, high: { reasoning: { effort: "high" } }, max: { reasoning: { effort: "max" } } }
if (glm53 && npm === "@ai-sdk/openai-compatible")
return { low: { reasoningEffort: "low" }, high: { reasoningEffort: "high" }, max: { reasoningEffort: "max" } }
if (glm53 && npm === "@ai-sdk/anthropic")
return { low: { effort: "low" }, high: { effort: "high" }, max: { effort: "max" } }
This matches the Z.ai spec (low lightweight, high enhanced, max deep) and allows mid-session changes to affect the next turn, similar to how muse-spark (minimal→xhigh) already works. It would also keep v2 in sync, where the same early return currently covers all glm models.
Repro
- Configure
provider.openrouter.models["z-ai/glm-5.3-flash"]inopencode.jsonc. - Open the model picker — variants are listed but changing them has no real effect.
- Setting
reasoningEffort: "low"(or any level) still runs atmax;usage.completion_tokens_details.reasoning_tokensstays at themaxlevel.
References
docs.z.ai/guides/llm/glm-5.3.md— tablereasoning_effort: low/high/max, default maxzai-org/GLM-5.3-Flashon Hugging Face — reasoning_effort defaults to max if not passed1120d070stats aliasox-alpha → glm-5.3-flash(shows the model is already recognized)fix(xai): pass through reasoning effort (#42160)— prior art for exposing reasoning effort
Happy to adjust the value mapping if you prefer a different naming (e.g. high/xhigh alias for max). Thanks for considering it!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.