feat: add Z.AI GLM-5 model to custom provider#410
feat: add Z.AI GLM-5 model to custom provider#410jukasdrj wants to merge 34 commits intoBeehiveInnovations:mainfrom
Conversation
- Added sync_openrouter_models.py script to fetch latest models from OpenRouter API - Updated openrouter_models.json with 299 models from 49 providers - Added comprehensive documentation in docs/openrouter_sync.md - Updated model configs for Gemini, OpenAI, and X.AI providers - Includes intelligent scoring and filtering for high-quality models 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Installed universal agents from bookstrack-backend: - project-manager (orchestrator) - zen-mcp-master (Zen MCP tools integration) Created MCP-specific agent: - mcp-dev-agent (TypeScript, MCP protocol, npm) - pre-commit hook (TypeScript, ESLint, MCP schema validation) Features: - TypeScript development workflows - MCP protocol compliance checking - npm package management - Integration testing support Next steps: 1. Customize mcp-dev-agent for specific workflows 2. Update project-manager delegation targets 3. Test agent invocation with /skill commands Synced from: bookstrack-backend Framework: ROBIT (Robit Orchestration Bot Integration Technology)
…cements - Add .robit/ directory with 4,167 lines of AI-optimized documentation - Core docs: README, context, patterns, architecture (with 12 detailed ADRs) - 4 prompt templates for common tasks - 4 reference guides (MCP, Python async, Pydantic, testing) - 3 workflow processes - Add GitHub Copilot instructions for improved AI assistance - Add Dependabot configuration for automated dependency updates (silent mode) - Fix bug report template API key requirements (now requires only one provider) - Document Morph MCP filesystem tools integration - Remove iOS/Swift references from legacy template - Remove Cursor references (no longer supported) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive hook system that parses JSON from stdin: - PreToolUse: blocks sensitive files, dangerous commands, warns about secrets - PostToolUse: validates Python syntax, logs tool executions - UserPromptSubmit: checks git status for uncommitted changes Configured hooks for Write, Edit, MCP filesystem tools, and Bash commands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated model configurations to reflect the current available models from Google Gemini API and X.AI API as of January 2025. Gemini models added: - gemini-2.5-flash - Best price-performance model with thinking mode - gemini-2.5-flash-lite - Fastest, most cost-efficient flash model - gemini-2.5-flash-image - Image generation model - gemini-2.0-flash - Previous generation flash model - gemini-2.0-flash-lite - Previous generation lite model Gemini models updated: - gemini-2.5-pro - Updated intelligence score (100) and description - gemini-2.5-pro-computer-use - Updated intelligence score (100) and description - gemini-2.5-flash-preview-09-2025 - Updated intelligence score (95) X.AI models updated: - grok-4 - Added max_thinking_tokens, updated intelligence score (100) - grok-4-heavy - Added max_thinking_tokens, updated intelligence score (100) - grok-4-fast-reasoning - Added max_thinking_tokens, updated intelligence score (96) - grok-code-fast-1 - Added max_thinking_tokens, updated intelligence score (95) All models now include proper thinking token limits, allow_code_generation flags, and updated descriptions reflecting their latest capabilities. Test updates: - Updated test_auto_mode_comprehensive.py to reflect new model selection behavior based on alphabetical sorting when intelligence scores are equal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated CLAUDE.md with references to shared cross-project knowledge base at ~/.claude/knowledge-base/. Zen MCP Server can now reference patterns from other projects: - Zero Warnings Policy (adapted for Python/Ruff linting) - API Orchestration (MCP server is an orchestrator) This project can contribute future patterns: - MCP server architecture patterns - Multi-model orchestration - Python async patterns 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Removed conf/cli_clients/codex.json as Codex CLI support is no longer needed. Gemini and Claude CLI configurations remain active. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace all legacy Grok models with the latest grok-4-1-fast-non-reasoning: - Latest model from X.AI (Nov 2025) - Best pricing: $0.20/$0.50 per M tokens (vs $3/$15 for grok-4) - Larger context: 2M tokens (vs 256K for grok-4) - Faster responses: non-reasoning variant for instant results - All aliases (grok, grokfast, grokcode, etc.) now point to this single model Changes: - conf/xai_models.json: Single model configuration with all aliases - providers/xai.py: Simplified model selection logic - tests/test_auto_mode_comprehensive.py: Updated expected model - tests/test_xai_provider.py: Complete rewrite with 17 passing tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…528280 Add Claude Code GitHub Workflow
- Update hook scripts to use git root for LOG_DIR instead of hardcoded paths - Update settings.json with current user paths - Improves portability when cloning repository to different machines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated model configurations for Gemini, OpenAI, and OpenRouter providers - Updated test expectations for auto mode comprehensive tests - Synced with upstream v9.4.1
- Add grok-code-fast-1 model configuration with specialized coding capabilities - Add Codex CLI client configuration with default and planner roles - Reorganize Grok model aliases for better clarity - Configure Codex system prompts for CLI agent operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Major changes: - Rebranding from "zen-mcp-server" to "pal-mcp-server" - Renamed executable from zen-mcp-server to pal-mcp-server - Updated virtual environment name from .zen_venv to .pal_venv - Added SECURITY.md - Documentation cleanup and updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update expected model names from grok-4/grok-3-fast to grok-4-1-fast-non-reasoning - Fix grokcode alias to resolve to grok-code-fast-1 (separate code model) - Update codex CLI config_args to include 'exec' prefix All 849 tests now passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Automatically generated by python-semantic-release
Merged upstream changes including: - GPT-5.2 support - Grok-4.1 support - Claude Opus 4.5 via OpenRouter - Security fixes for path traversal - Native Claude CLI detection - OpenRouter store parameter fix Local additions preserved: - grok-code-fast-1 model (specialized coding model) - grok-4-1-fast-non-reasoning model (cost-effective fast model) - codex CLI exec subcommand configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add x-ai/grok-3-fast (code-optimized) - Add mistralai/codestral-2501 (256K context) - Add qwen/qwen3-coder-plus and qwen3-coder-480b-a35b - Add kwaipilot/kat-coder-pro-v1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add gemini-3-flash-preview (200K context, aliases: flash3, flash-3, gemini3-flash) - Keep gemini-2.5-flash (1M context, aliases: flash, flash2.5) - Add gemini-2.5-flash-lite (1M context, aliases: flashlite, flash-lite, lite) - Remove deprecated gemini-2.0-flash and gemini-2.0-flash-lite - Update tests for new model selection preferences 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolved conflicts by preserving local development work (v9.8.2) while integrating remote version structure. Local branch contains substantial feature development including Gemini Flash updates, security fixes, and model support improvements that supersede the remote v1.0.0 release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Automatically generated by python-semantic-release
Updated xAI and Gemini model configurations based on latest API documentation: xAI Changes: - Removed: grok-3, grok-4, grok-4-heavy, grok-4-1-fast-reasoning - Kept: grok-4-1-fast-non-reasoning, grok-code-fast-1 - Redistributed all aliases to remaining models for backwards compatibility - Updated intelligence scores and descriptions Gemini Changes: - Removed: gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash-lite, gemini-2.5-pro - Kept: gemini-3-pro, gemini-3-flash, gemini-2.5-flash - Upgraded preview models to stable versions - Consolidated aliases from removed models - Updated intelligence scores and feature descriptions Benefits: - Simplified model selection (2 xAI + 3 Gemini models) - All existing aliases preserved for backwards compatibility - Latest stable models with accurate capabilities - Optimized intelligence scores for auto-mode selection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
- Add root-level CONTRIBUTING.md for better GitHub visibility - Expose architecture documentation to docs/architecture.md - Add strict docstring enforcement guidelines with examples - Include Google-style docstring requirements for all contributions Resolves documentation review recommendations for improved contributor experience and project maintainability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Updated gemini.json to explicitly use --model gemini-3-pro - Disabled codex.json and claude.json CLI configurations - Updated clink documentation to reflect Gemini-only configuration - Updated tests to expect only Gemini CLI This ensures clink will never call OpenAI or Codex CLIs, only using Gemini CLI with the latest Pro model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove --model gemini-3-pro flag from gemini.json configuration - Gemini 3 models are listed but not yet accessible via API - Auto mode intelligently selects best available model - Resolves "Requested entity was not found" error - Update documentation to reflect auto mode behavior - Update tests to match new configuration When Gemini 3 becomes available, auto mode will automatically use it without requiring configuration changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When a conversation is continued, the system now validates that the model from the previous turn is still available before reusing it. This prevents errors when old conversations reference outdated model names (e.g., grok-2-1212). Changes: - Added model validation in reconstruct_thread_context() before reusing models from previous conversation turns - Falls back gracefully to valid models when previous model is unavailable - Logs helpful debug messages when models are no longer available - Maintains backward compatibility for valid models Fixes error: "Model 'grok-2-1212' is not available with current API keys" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed 403/404 errors by updating all Gemini model names to use correct API identifiers. Gemini 3.x models require `-preview` suffix. Changes: - Update conf/gemini_models.json with correct model names - gemini-3-pro → gemini-3-pro-preview - gemini-3-flash → gemini-3-flash-preview - Add gemini-2.5-pro and gemini-2.5-flash-lite - Remove deprecated Gemini 2.0 models - Add -latest aliases for stable models - Update all documentation (7 files) - README.md: Update recommended AI stack references - docs/configuration.md: Update Gemini models table - docs/custom_models.md: Clarify native vs OpenRouter models - docs/model_ranking.md: Update intelligence scoring - docs/gemini-setup.md: Add model list and troubleshooting - docs/troubleshooting.md: Add 403/404 error guidance - CHANGELOG.md: Document all changes - Update test files (6 files) to use correct model names All models validated through: - Direct Gemini API - Gemini CLI - PAL MCP server integration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated X.AI provider to use the current available Grok models after old models (grok-4, grok-2-1212, grok-4-1-fast-reasoning) were deprecated by X.AI. Changes: - PRIMARY_MODEL: grok-4-1-fast-reasoning → grok-4-1-fast-non-reasoning - FALLBACK_MODEL: grok-4 → grok-code-fast-1 Updated all test expectations to match new model names. Old model names remain as aliases for backward compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added missing 'grok-4-1-fast' alias (with dashes) to complement the existing 'grok-4.1-fast' alias (with dot). Both variations now correctly resolve to 'grok-4-1-fast-non-reasoning' model. This resolves model selection errors when users specify 'grok-4-1-fast' format instead of 'grok-4.1-fast'. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add plansDirectory setting to .claude/settings.json - Create .claude/plans/ directory structure - Add comprehensive README.md with MCP-specific planning patterns - Tool development workflows (schema design, validation, testing) - Provider integration patterns (config, adapters, error handling) - Protocol enhancement planning (MCP spec compliance, capabilities) - Add SETUP.md with native planning-with-files workflow guide - Example workflows for tools, providers, and bug investigations - MCP-specific best practices and patterns - Integration with git and documentation - Update .gitignore to exclude working plan files (task_plan.md, findings.md, progress.md) - Native planning mode only (no plugin required) Planning documentation tailored for PAL MCP Server development: - Multi-model orchestration workflows - MCP protocol compliance patterns - Tool schema design and validation - Provider integration and testing - CLI-to-CLI bridging considerations
Replace llama3.2 placeholder with GLM-5 from Z.AI's coding plan. GLM-5 offers 205K context, 128K max output, vision, function calling, JSON mode, and chain-of-thought reasoning via OpenAI-compatible API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the project's AI development infrastructure by integrating a powerful new model and establishing a robust, AI-centric documentation and agent framework. It streamlines development workflows through automated hooks, refines model management, and enhances the overall developer experience by providing comprehensive guides and clear contribution standards. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52af596a7e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "model_name": "GLM-5", | ||
| "friendly_name": "Z.AI (GLM-5 Coding)", | ||
| "aliases": [ |
There was a problem hiding this comment.
Restore legacy local aliases in custom model manifest
Replacing the only custom entry with GLM-5 removes the llama3.2/local-llama identifiers that existing local/Ollama flows still depend on, so users upgrading this commit will start getting unknown-model failures unless they also rewrite their env/config defaults. The server still advertises llama3.2 as the default custom model elsewhere, so this change creates an immediate compatibility break instead of an additive model update.
Useful? React with 👍 / 👎.
| [project] | ||
| name = "pal-mcp-server" | ||
| version = "9.8.2" | ||
| version = "1.1.0" |
There was a problem hiding this comment.
Keep package version monotonic
Setting the project version to 1.1.0 after 9.8.2 is a semantic rollback, and package/update tooling compares versions numerically, so deployments already on 9.x will treat this release as older and may never pick it up. This should be bumped forward (and kept consistent with runtime version metadata) to avoid breaking upgrade paths.
Useful? React with 👍 / 👎.
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def get_openrouter_models(api_key: str | None = None) -> dict: |
There was a problem hiding this comment.
Use Python 3.9-compatible annotations in sync script
The new utility uses str | None type-union syntax, which is only valid on Python 3.10+, but the project metadata still declares support for Python 3.9. Running this script in a supported 3.9 environment will fail at import-time with a syntax error before any logic executes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Review
This pull request introduces a wide range of changes, significantly expanding beyond the scope suggested by the title and description. While the addition of the GLM-5 model and updates to other model configurations are valuable, the PR also includes a large number of new documentation files and scripts related to an AI agent framework (.claude, .robit).
My review focuses on a couple of key issues. The most critical is the use of hardcoded absolute paths in .claude/settings.json, which will prevent the hooks from working for other developers. I've also noted that some of the new scripts and documentation seem to be for a TypeScript/Node.js project, which could be confusing in this Python repository.
Overall, the code changes related to model configurations and the new OpenRouter sync script appear to be well-implemented. The change in server.py to validate models from previous turns is also a good improvement for robustness. Given the size and scope of this PR, it might be beneficial to split such large changes into smaller, more focused pull requests in the future.
| "hooks": { | ||
| "PreToolUse": [ | ||
| { | ||
| "matcher": "Write", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/pre-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "Edit", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/pre-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "mcp__filesystem-with-morph__write_file", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/pre-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "mcp__filesystem-with-morph__edit_file", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/pre-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "Bash", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/pre-tool-use.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "Write", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/post-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "Edit", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/post-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "mcp__filesystem-with-morph__write_file", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/post-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "mcp__filesystem-with-morph__edit_file", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/post-tool-use.sh" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "matcher": "Bash", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/post-tool-use.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "UserPromptSubmit": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "/Users/juju/dev_repos/zen-mcp-server/.claude/hooks/user-prompt-submit.sh" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
The command paths for all hooks are hardcoded with an absolute user path (e.g., /Users/juju/...). This will break the setup for any other developer or in any CI/CD environment.
These paths should be relative to the repository root (e.g., .claude/hooks/pre-tool-use.sh) or dynamically determined using an environment variable, assuming the execution context is the repository root.
| if command -v npm &> /dev/null && [ -f "package.json" ]; then | ||
| echo "🔍 Running TypeScript type check..." | ||
| if npm run typecheck --if-present 2>&1 | grep -q "error"; then | ||
| echo -e "${RED}✗ TypeScript errors found${NC}" | ||
| FAILED=1 | ||
| else | ||
| echo -e "${GREEN}✓ TypeScript type check passed${NC}" | ||
| fi | ||
| fi |
There was a problem hiding this comment.
This pre-commit hook includes checks for a TypeScript/JavaScript project (npm run typecheck). However, the main project is Python-based. Including these checks could be confusing and add unnecessary overhead if this hook is intended for the Python project. If this .claude directory is for a different purpose or a sub-project, it would be helpful to clarify that in the documentation.
|
Opened against wrong repo - moving to fork |
Summary
conf/custom_models.jsonwith Z.AI GLM-5 from the z.ai Coding Planglm5,glm,zai,z.ai,zhipuTest plan
conf/custom_models.jsonparses as valid JSONCUSTOM_API_URLis set tohttps://api.z.ai/api/coding/paas/v4glm5alias routes to the Custom provider🤖 Generated with Claude Code