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. |
/sessions |
/sessions/resume/continue |
Opens the session picker. Use arrow keys to switch between current-project and all-project sessions. |
/task-policy |
/task-policy/task-policy compaction/task-policy extra-on/task-policy extra-off/task-policy extra-status |
Opens the local TUI task-route table. extra-on/extra-off toggles the extra task router; extra-status shows current state. Does not call the model or inject the table into conversation. |
/permissions |
/permissions |
Opens the project permission policy panel. Choose Trust All, Safe, Ask Everything, Readonly, or Reset. Writes to ./.openchinacode/openchinacode.jsonc and applies a runtime override immediately. |
/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. |
/media-auth |
/media-auth/media-auth <ARK_API_KEY> |
Saves the Volcengine Ark API key for native image and video generation. |
/image-generate |
/image-generate/image-generate a cyberpunk cat mascot |
Opens the ByteDance Seedream 5.0 Pro image generation wizard with optional inline prompt. |
/video-generate |
/video-generate/video-generate a 5s product promo |
Opens the ByteDance Seedance 2.0 Mini video generation wizard with optional inline prompt. |
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.
When enabled, ordinary prompts pass through a fast LLM judge that can automatically insert a routed subtask — no explicit /task call needed. Disabled by default.
Explicit task/subagent calls trigger the built-in route table — GLM for planning, Kimi for speed, DeepSeek for debug.
A fast judge (DeepSeek V4 Flash) inspects each ordinary prompt and inserts a subtask with task_kind + complexity when delegation is appropriate.
Use /task-policy extra-on / extra-off / extra-status, or set task_policy.extra_router.enabled in 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.
Open the session picker with /sessions (aliases /resume, /continue). Use arrow keys to switch scope.
Press ← / → to toggle between Current Project (with pin/unpin) and All Projects (global session list).
Selecting another project's session offers: open the original project, or fork the session into the current directory.
Delete (with confirmation) and rename are available for any session in either scope.
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.
OpenChinaCode can generate images and videos through Volcengine Ark, powered by ByteDance Seedream 5.0 Pro and Seedance 2.0 Mini.
Run /media-auth in the TUI, or set the ARK_API_KEY environment variable. The key is stored in ~/.local/share/openchinacode/auth.json under provider volcengine-ark.
Up to 2K resolution, 1:1 to 21:9 aspect ratios, up to 10 reference images (local paths, URLs, or data URIs), PNG or JPEG output.
4–15 second clips, 480p or 720p, adaptive to 21:9 ratios, up to 9 reference images, 3 reference video URLs, strict first/last frame control, and generated audio.
Describe what you want in plain language, or run /image-generate / /video-generate with an optional prompt. When key parameters are missing, the agent asks follow-up questions instead of guessing. Generated files are downloaded immediately to /tmp/openchinacode/media/images and /tmp/openchinacode/media/videos with matching metadata JSON.
Subagent rows in the TUI show the selected provider, model, variant, task classification, and route source.