Commit graph

1 commit

Author SHA1 Message Date
Roo Code
d010015905 feat: add strategic GLM model family detection for LM Studio and OpenAI-compatible providers
This PR addresses Issue #11071 by implementing a comprehensive GLM model detection system:

1. Created glm-model-detection.ts utility that:
   - Detects GLM family models (GLM-4.5, 4.6, 4.7 and variants)
   - Supports various model ID formats (standard, MLX, GGUF, ChatGLM)
   - Identifies version (4.5, 4.6, 4.7) and variant (base, air, flash, v, etc.)
   - Returns appropriate configuration for each model

2. Updated LmStudioHandler to:
   - Detect GLM models and log detection results to console
   - Use convertToZAiFormat with mergeToolResultText for GLM models
   - Disable parallel_tool_calls for GLM models
   - Handle reasoning_content for GLM-4.7 models

3. Updated BaseOpenAiCompatibleProvider similarly

4. Added 33 comprehensive tests for the detection utility

The detection uses flexible regex patterns to match model IDs like:
- mlx-community/GLM-4.5-4bit
- GLM-4.5-UD-Q8_K_XL-00001-of-00008.gguf
- glm-4.5, glm-4.7-flash, etc.
2026-01-30 00:41:05 +00:00