feat(think-mode): add GLM-4.7 thinking mode support

Add thinking mode support for Z.AI's GLM-4.7 model via the zai-coding-plan provider.

Changes:
- Add zai-coding-plan to THINKING_CONFIGS with extra_body.thinking config
- Add glm pattern to THINKING_CAPABLE_MODELS
- Add comprehensive tests for GLM thinking mode

GLM-4.7 uses OpenAI-compatible API with extra_body wrapper for thinking:
- thinking.type: 'enabled' or 'disabled'
- thinking.clear_thinking: false (Preserved Thinking mode)

Closes #1030
This commit is contained in:
sisyphus-dev-ai
2026-01-24 07:20:46 +00:00
committed by justsisyphus
parent 0e1d4e52e1
commit de6f4b2c91
2 changed files with 80 additions and 0 deletions
+13
View File
@@ -149,6 +149,18 @@ export const THINKING_CONFIGS = {
openai: {
reasoning_effort: "high",
},
"zai-coding-plan": {
providerOptions: {
"zai-coding-plan": {
extra_body: {
thinking: {
type: "enabled",
clear_thinking: false,
},
},
},
},
},
} as const satisfies Record<string, Record<string, unknown>>
const THINKING_CAPABLE_MODELS = {
@@ -157,6 +169,7 @@ const THINKING_CAPABLE_MODELS = {
google: ["gemini-2", "gemini-3"],
"google-vertex": ["gemini-2", "gemini-3"],
openai: ["gpt-5", "o1", "o3"],
"zai-coding-plan": ["glm"],
} as const satisfies Record<string, readonly string[]>
export function getHighVariant(modelID: string): string | null {