Skip to content

Conversation

@sisyphus-dev-ai
Copy link
Collaborator

@sisyphus-dev-ai sisyphus-dev-ai commented Jan 24, 2026

Summary

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 format
  • Add glm pattern to THINKING_CAPABLE_MODELS for model detection
  • Add comprehensive tests for GLM thinking mode functionality

Technical Details

GLM-4.7 uses OpenAI-compatible API format with extra_body wrapper:

"zai-coding-plan": {
  providerOptions: {
    "zai-coding-plan": {
      extra_body: {
        thinking: {
          type: "enabled",
          clear_thinking: false,  // Preserved Thinking mode
        },
      },
    },
  },
}

Key points:

  • thinking.type: "enabled" - Activates thinking mode
  • thinking.clear_thinking: false - Preserves reasoning content in response (like Claude's <thinking> block)
  • No HIGH_VARIANT_MAP entries needed since GLM-4.7 has thinking enabled by default

Testing

  • All 54 switcher tests pass (including 7 new GLM tests)
  • All 71 think-mode tests pass
  • TypeScript type check passes
  • Build succeeds

Closes #1030


Summary by cubic

Adds thinking mode support for Z.AI’s GLM-4.7 via the zai-coding-plan provider, preserving reasoning content in responses. Completes Linear #1030 by enabling GLM detection and configuration.

  • New Features
    • Added zai-coding-plan entry to THINKING_CONFIGS with extra_body.thinking { type: "enabled", clear_thinking: false }.
    • Updated THINKING_CAPABLE_MODELS to detect GLM models via the "glm" pattern.
    • No high variant needed for GLM; getHighVariant returns null.
    • Added tests for GLM-4.7 and GLM-4.6v behavior and config structure.

Written for commit de6f4b2. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@code-yeongyu
Copy link
Owner

@sisyphus-dev-ai i dont think you have references on the pr description - please investigate and update to have them on the description. ulw and if not you must update the code

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
@justsisyphus justsisyphus force-pushed the feat/glm-4.7-thinking-mode branch from bb971db to de6f4b2 Compare January 24, 2026 07:45
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.

[Feature]: GLM-4.7 thinking mode support

3 participants