Skip to content

feat(provider): set temperature 1.0 for GLM-5.2#32173

Open
phalla-doll wants to merge 1 commit into
anomalyco:devfrom
phalla-doll:feat/glm-5.2-support
Open

feat(provider): set temperature 1.0 for GLM-5.2#32173
phalla-doll wants to merge 1 commit into
anomalyco:devfrom
phalla-doll:feat/glm-5.2-support

Conversation

@phalla-doll

Copy link
Copy Markdown

Issue

Closes #32172

Summary

Z.AI just released GLM-5.2 — their latest reasoning model with a 1M context window. The model definition is being added to models.dev in anomalyco/models.dev#2275. Once merged there, opencode will pick it up automatically through the model catalog.

This PR adds the only opencode source change needed: setting temperature: 1.0 for GLM-5.2, consistent with GLM-4.6 and GLM-4.7. Z.AI docs recommend temperature: 1.0 for all reasoning models (see Deep Thinking docs).

What already works without changes

Concern Why
Reasoning (thinking) transform.ts auto-enables thinking: { type: "enabled" } for all zai/zhipuai provider IDs
Variants (effort) GLM models return empty variants (toggle, reasoning always-on) — correct for the thinking.type: enabled/disabled API
Interleaved reasoning Set via models.dev interleaved.field = "reasoning_content"
Model metadata From models.dev PR #2275

Changes

  • packages/opencode/src/provider/transform.ts: Add if (id.includes("glm-5.2")) return 1.0 in temperature()
  • packages/opencode/test/provider/transform.test.ts: Add test block covering GLM-4.6, GLM-4.7, and GLM-5.2 temperature

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jun 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add GLM-5.2 model support for Z.AI provider

1 participant