You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Z.AI just released GLM-5.2 — their latest and most capable reasoning model. It is available to all Z.AI Coding Plan subscribers (Max, Pro, Lite) and supports a 1M context window, reasoning with configurable effort levels, and tool calling.
Current state: GLM-5.2 is not listed on models.dev (the Z.AI provider page lists up to GLM-5.1, GLM-5-Turbo, GLM-5V-Turbo), and there are no existing PRs or issues mentioning GLM-5.2.
What needs to happen
Add GLM-5.2 to models.devzai provider TOML — this is the prerequisite for opencode to pick it up via its model catalog (fromModelsDevProvider() in provider.ts). I will file a separate issue/PR there.
Reasoning effort mapping for Z.AI API: GLM-5.2 supports high and max effort levels (Z.AI docs map Claude Code's /effort levels to these). PR feat(bedrock): add GLM-5 reasoning support on AWS Bedrock #28264 adds GLM-5 reasoning via variant: "high" on AWS Bedrock, but we need to confirm the Z.AI OpenAI-compatible API provider also maps effort/variant correctly.
1M context window handling: Z.AI docs use a [1m] suffix convention (e.g., glm-5.2[1m]) to enable 1M context. Opencode's model definition uses contextWindow directly — we should either define one model with contextWindow: 1000000, or investigate whether two variants are needed.
Coding Plan base URL: The Coding Plan uses https://api.z.ai/api/coding/paas/v4 which differs from the standard endpoint on models.dev (https://api.z.ai/api/paas/v4). Users on the Coding Plan need to configure the correct base URL.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Z.AI just released GLM-5.2 — their latest and most capable reasoning model. It is available to all Z.AI Coding Plan subscribers (Max, Pro, Lite) and supports a 1M context window, reasoning with configurable effort levels, and tool calling.
Specs (from Z.AI docs):
glm-5.2high(default) andmaxhttps://api.z.ai/api/coding/paas/v4Current state: GLM-5.2 is not listed on models.dev (the Z.AI provider page lists up to GLM-5.1, GLM-5-Turbo, GLM-5V-Turbo), and there are no existing PRs or issues mentioning GLM-5.2.
What needs to happen
Add GLM-5.2 to models.dev
zaiprovider TOML — this is the prerequisite for opencode to pick it up via its model catalog (fromModelsDevProvider()inprovider.ts). I will file a separate issue/PR there.Reasoning effort mapping for Z.AI API: GLM-5.2 supports
highandmaxeffort levels (Z.AI docs map Claude Code's/effortlevels to these). PR feat(bedrock): add GLM-5 reasoning support on AWS Bedrock #28264 adds GLM-5 reasoning viavariant: "high"on AWS Bedrock, but we need to confirm the Z.AI OpenAI-compatible API provider also maps effort/variant correctly.1M context window handling: Z.AI docs use a
[1m]suffix convention (e.g.,glm-5.2[1m]) to enable 1M context. Opencode's model definition usescontextWindowdirectly — we should either define one model withcontextWindow: 1000000, or investigate whether two variants are needed.Coding Plan base URL: The Coding Plan uses
https://api.z.ai/api/coding/paas/v4which differs from the standard endpoint on models.dev (https://api.z.ai/api/paas/v4). Users on the Coding Plan need to configure the correct base URL.Tool-call parsing: GLM-5 has known tool-call JSON parsing issues ([bug] GLM 5 keeps screwing up the json parsing of read tool calling #13982, fix(opencode): recover malformed GLM/NVIDIA tool calls #25971). GLM-5.2 should be verified against these to avoid regressions.
References