Full parity with the Claude Code edition. Copilot (VS Code) has agent hooks too — including a PreToolUse event — so this release adds the third and final primitive: an auto-routing hook.
New — PreToolUse auto-routing hook
glm_router_hook.mjs— the Copilot analog of the Claudeglm_subagent_routerhook. Before the default model does work itself, it injects advisory context nudging delegation toglm_agent(~10× cheaper), then lets the tool run.- Non-blocking — always returns
permissionDecision: "allow"; it only advises, never denies. - VS Code ignores hook matchers, so the hook fires on every tool call and filters by
tool_nameinternally — it skipsglm_*and read-only tools and advises at most once per session (so it never spams you on every edit). - Installed to
.github/hooks/glm.hooks.jsonper-project, or~/.copilot/hooks/glm.hooks.jsonwith--global.
The Copilot edition now has all three primitives
glm_*MCP tools in agent mode (same server as the Claude edition)GLMcustom agent (subagent) locked to theglmtoolsPreToolUseauto-routing hook (this release)
Remaining differences: VS Code hooks ignore the matcher (handled by internal filtering); hooks are a VS Code preview feature (enable in Copilot settings if hidden); and there's no separate glm-code full-GLM launcher. Everything downstream is the same server.
Install / upgrade
```bash
npx glm-mcp-copilot --key YOUR_ZAI_KEY # this workspace
npx glm-mcp-copilot --global --key YOUR_ZAI_KEY # all workspaces (server + subagent + hook + policy)
```