[PR #12450] feat: add specialised GLM system prompt with prioritised GLM MCP tools #14219

Open
opened 2026-02-16 18:19:01 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12450

State: open
Merged: No


What does this PR do?

Closes #11730

Added GLM-specific system prompt to optimize responses when using GLM models with their MCP tools. The implementation prioritizes GLM's native MCP servers (vision, web search, web reader) while maintaining fallback to OpenCode's default tools when GLM MCPs are unavailable or failed to complete.

Changes Made

  • Created packages/opencode/src/session/prompt/glm.txt with optimized system prompt for GLM models
  • Modified packages/opencode/src/session/system.ts to detect GLM models and load the GLM-specific prompt

How did you verify your code works?

Manually ran test sessions and verified:

  • Security checks execute correctly
  • Glob tool properly detects current directory and AGENTS.md presence
  • Skill loading works as expected
  • Todo tool functions effectively
  • GLM MCP tools (vision, web search, web reader) are correctly prioritized when available
  • Fallback to OpenCode's default tools (Exa, web-fetch) works when GLM MCPs fail or are not configured
  • Verified tool calls in interface show correct tool selection based on availability
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12450 **State:** open **Merged:** No --- ### What does this PR do? Closes #11730 Added GLM-specific system prompt to optimize responses when using GLM models with their MCP tools. The implementation prioritizes GLM's native MCP servers (vision, web search, web reader) while maintaining fallback to OpenCode's default tools when GLM MCPs are unavailable or failed to complete. ## Changes Made - Created `packages/opencode/src/session/prompt/glm.txt` with optimized system prompt for GLM models - Modified `packages/opencode/src/session/system.ts` to detect GLM models and load the GLM-specific prompt ### How did you verify your code works? Manually ran test sessions and verified: - Security checks execute correctly - Glob tool properly detects current directory and AGENTS.md presence - Skill loading works as expected - Todo tool functions effectively - GLM MCP tools (vision, web search, web reader) are correctly prioritized when available - Fallback to OpenCode's default tools (Exa, web-fetch) works when GLM MCPs fail or are not configured - Verified tool calls in interface show correct tool selection based on availability
yindo added the pull-request label 2026-02-16 18:19:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14219