This page covers the OpenChinaCode-specific workflow: GLM/Kimi/DeepSeek provider setup, custom slash commands, task policy routing, smart compaction, LSP diagnostics, and Playwright testing.
OpenChinaCode installs as a separate command, so it can coexist with upstream opencode.
OpenChinaCode uses independent config and data paths. Do not put API keys in the repository.
Use this for personal defaults: model, task policy overrides, LSP, compaction, and MCP.
Written by openchinacode providers login. File mode is restricted when written by the CLI.
Use this when one codebase needs a different task policy or testing setup.
| Provider | Purpose | Protocol | Notes |
|---|---|---|---|
zhipuai-pay2go |
GLM / BigModel pay-as-you-go | OpenAI compatible | Base URL is fixed to https://open.bigmodel.cn/api/paas/v4. |
moonshotai-cn |
Kimi / Moonshot China | OpenAI compatible | Used for fast implementation, review, summarize, and quick routes. |
deepseek |
DeepSeek official API | OpenAI compatible | Used for debug/test-fix loops and low-cost judge paths. |
OpenChinaCode-specific commands are grouped under OpenChinaCode in the TUI command palette.
| Command | Usage | Effect |
|---|---|---|
/auto-maxtokens |
/auto-maxtokens heuristic/auto-maxtokens llm deepseek/deepseek-v4-flash |
Controls sliding output-token budgeting. Heuristic is the recommended daily mode; LLM mode uses a low-cost judge for ambiguous turns. |
/compact |
/compact/compact keep 3/compact keep auto |
Runs smart compaction. keep N also preserves the latest N raw user turns and follow-up assistant/tool messages. |
/lsp |
/lsp status/lsp on/lsp off |
Enables language-server diagnostics so the model can see and fix type, syntax, and reference errors. |
/task-policy |
/task-policy/task-policy compaction |
Opens the local TUI task-route table. It does not call the current model and does not inject the table into the conversation. |
/task-classify |
/task-classify do a full code review |
Asks the current model to explain task kind, complexity, route, and classification signals. |
/test-mcp |
/test-mcp on/test-mcp headed/test-mcp off |
Writes Playwright MCP config and hot-connects or disconnects it from inside the TUI. |
/browser-check |
/browser-check http://127.0.0.1:5173 |
Prompts the agent to run browser-level checks, preferably through Playwright MCP. |
/integration-test |
/integration-test check login flow |
Prompts the agent to use the OpenChinaCode integration-test workflow: run, inspect report, define bug, fix, rerun. |
Subagents are routed by task kind and complexity. General tasks inherit the parent model; specialized tasks use opinionated GLM/Kimi/DeepSeek defaults.
| Task kind | Quick | Medium | Complex |
|---|---|---|---|
general | inherit | inherit | inherit |
plan | GLM-5.2 high | GLM-5.2 high | GLM-5.2 max |
architecture | GLM-5.2 high | GLM-5.2 high | GLM-5.2 max |
refactor | GLM-5.2 high | GLM-5.2 high | GLM-5.2 max |
review | Kimi K2.7 highspeed | Kimi K2.7 highspeed | GLM-5.2 high |
implement | Kimi K2.7 highspeed | Kimi K2.7 highspeed | GLM-5.2 high |
explore | Kimi K2.7 highspeed | GLM-5.2 high | GLM-5.2 max |
visual_check | GLM-5V Turbo | GLM-5V Turbo | GLM-5V Turbo |
debug | DeepSeek V4 Pro | DeepSeek V4 Pro | DeepSeek V4 Pro |
test_fix | DeepSeek V4 Pro | DeepSeek V4 Pro | DeepSeek V4 Pro |
summarize | Kimi K2.7 highspeed | Kimi K2.7 highspeed | GLM-5.2 high |
compaction | GLM-5.2 high | GLM-5.2 high | GLM-5.2 high |
Put this in ~/.config/openchinacode/openchinacode.jsonc or in a project-level OpenChinaCode config.
OpenChinaCode compaction is routed through task policy and defaults to zhipuai-pay2go/glm-5.2#high. It uses three layers: general summary, active-task extraction, and minimal raw recent tail.
A judge model first emits a stable JSON profile, then OpenChinaCode builds a fixed Markdown compaction prompt from that profile.
The recent active task is extracted at higher granularity than the general summary, so long debugging or refactor context survives.
/compact keep N asks OpenChinaCode to keep the latest N raw user turns and their following assistant/tool messages.
Use /lsp on. When enabled, language-server diagnostics can be fed into the model during code edits.
Use /test-mcp on. This writes Playwright MCP config and hot-connects it without leaving OpenChinaCode.
Visual checks route to zhipuai-pay2go/glm-5v-turbo. Animation checks should prefer DOM/CSS telemetry and pixel diffs.
Subagent rows in the TUI show the selected provider, model, variant, task classification, and route source.