feat(agents): add ZCode CLI as a supported TUI agent - #21756
sunganhao8-lgtm wants to merge 1 commit into
Conversation
Add Z.ai's ZCode CLI to the built-in agent roster, following the same shape as the Trae addition: launch config, telemetry kind, skills CLI mapping, display names, bundled icon, mobile assets, i18n labels, docs. Detection runs on the standard `zcode` command. ZCode has no argv or prefill prompt form (unknown positionals exit with `Unknown command`), so prompts inject via the stdin-after-start path like Kimi/Aider. Usage/rate-limit tracking is intentionally out of scope: Z.ai does not publish a usage API for the coding plan yet, unlike Kimi's documented managed-usage endpoint.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (23)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAdds ZCode as a supported TUI agent. Shared configuration covers detection, startup prompt injection, permissions, telemetry, labels, selection, and headless command matching. Renderer code adds catalog, favicon, localization, and status support with tests. Mobile code adds icon and domain mappings. Documentation lists ZCode as supported with auto-setup. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The ZCode integration has no confirmed correctness or localization defect requiring a merge block and is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the implementation and verification, but it does not follow the repository template. It omits required sections such as ELI5, What Changed, Why, Visual Proof, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It also does not provide the required issue reference in a Resolution Update the description to include all template sections. Add the required Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 17 files. (6 skipped: 6 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Important
Two things to settle before merge: the zcode binary is an unofficial third-party client, not a Z.ai first-party CLI, and the headless matcher is incomplete for the CLI's --print / --target one-shot forms.
Reviewed changes
- New
TuiAgentmemberzcodewired through the full registration surface (tui-agent.ts,tui-agent-config.ts, display names, auto-pick order,agent-kind.ts,agent-type-label.ts, skills key, telemetry enum,ICONABLE_AGENT_TYPES) plus bundled icon, favicon assets, mobile assets, catalog entry, and locale labels. - Prompt injection uses
stdin-after-start(bare TUI + paste after composer), matching the comment that positionals are parsed as commands. - Yolo launch appends
--mode yoloviaYUI_AGENT_PERMISSIONS/YOLO_TUI_AGENT_ARGS. - Headless one-shot matching maps
zcodeto the Ante matcher. - Docs + tests: a row in
supported.mdx, aformatAgentTypeLabel/icon test, and atui-agent-startuplaunch-plan test.
⚠️ The zcode command comes from an unofficial community client, not Z.ai
ZCode itself is a desktop Electron ADE — the Z.ai docs (zcode.z.ai/en/docs/install, docs.z.ai/devpack/tool/zcode) only document a desktop download with no CLI, zcode on PATH, or --mode flag. The zcode npm bin is published by the unofficial package zcode-app-cli (repo kingsword09/zcode-cli, "Unofficial terminal client for the official agent runtime shipped with ZCode Desktop"). That project's HOST_INTEGRATION.md explicitly names Orca as a supported host, so this is very likely the intended target — but the PR titles it "Z.ai's ZCode CLI" and points the catalog homepageUrl and the docs row at the desktop app, which misattributes an unaffiliated MIT client to Z.ai.
Technical details
# Third-party vs first-party provenance
## Affected sites
- `src/renderer/src/lib/agent-catalog.tsx:128` — `homepageUrl: 'https://zcode.z.ai'` (desktop app)
- `docs/site/content/docs/agents/supported.mdx:62` — row says "Auto-setup" linking Z.ai
- `src/shared/tui-agent-config.ts:125-129` — `detectCmd: 'zcode'`
## Required outcome
- Confirm the intended target with maintainers. If it is `zcode-app-cli`, label it as a
community/unofficial client in the PR title/body, docs row, and ideally the catalog label or
a homepage that identifies the actual package (`https://github.com/kingsword09/zcode-cli` or
the npm page).
- If a first-party ZCode CLI exists that this targets instead, cite it; the linked docs don't
describe one.
## Open questions for the human
- Is adding an unofficial, unaffiliated terminal client to the built-in "Auto-setup" roster
acceptable? Existing entries are first-party CLIs.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| 'prime-agent': isPrimeAgentHeadlessOneShotCommand, | ||
| ante: isAnteHeadlessOneShotCommand | ||
| ante: isAnteHeadlessOneShotCommand, | ||
| zcode: isAnteHeadlessOneShotCommand |
There was a problem hiding this comment.
This matcher is incomplete for ZCode. The community CLI's launcher treats --prompt/-p, --print, and --target as non-TUI invocations, but isAnteHeadlessOneShotCommand only matches --prompt/-p (and -p*), so zcode --print … and zcode --target … escape filterHeadlessOneShotAgentCommand and get treated as interactive agent invocations. Since ZCode's headless surface differs from Ante's, it likely needs its own matcher (as Prime Agent has) covering all four forms.
Technical details
# zcode headless one-shot matcher is incomplete
## Affected sites
- `src/shared/agent-headless-command.ts:16` — reuses `isAnteHeadlessOneShotCommand`
- `src/shared/ante-headless-command.ts:3` — flags are only `--prompt`, `-p`
- `src/shared/agent-process-recognition.ts:301,318` — the filter's only call sites
## Evidence
- `zcode-app-cli` `src/launcher.ts` marks `--prompt`, `--target`, `--print`, and `-p` as
`agentInvocation` (non-TUI), while `isTuiRuntimeInvocation` returns false for all of them.
## Required outcome
- Every non-TUI `zcode` invocation is filtered so Orca does not host it as a TUI agent.
## Suggested approach
- Add a `zcode-headless-command.ts` matcher covering `--prompt`/`-p`, `--print`, and `--target`,
and add a recognition test mirroring the existing one-shot cases.
ZCode harness is green — please try it and comment on #22464Test instructions: #22464 (comment) Build: https://github.com/stablyai/orca-adhoc/releases/tag/v1.4.210-adhoc.20260923230858 CI is now fully green (31/31). Please comment on #22464 with what you find — whether it works or breaks. Include your OS and The two gaps I can't close myself:
|

Summary
Adds Z.ai's ZCode CLI to the built-in agent roster, following the same shape as the Trae addition (#10763):
zcodejoins theTuiAgentunion,TUI_AGENT_CONFIG(detect on the standardzcodecommand), the telemetryAgentKindenum,TUI_AGENT_DISPLAY_NAMES,TUI_AGENT_AUTO_PICK_ORDER,agent-type-label, the headless one-shot matchers, and theskillsCLI key mapping (zcode, already a valid key in the skills CLI namespace).--mode yolo, ZCode's documented permission-bypass flag.src/shared/agent-icons/zcode.png), renderer favicon assets, mobile icon assets + favicon domain, agent catalog entry, and the en/es/ja/ko/zh locale labels.docs/site/content/docs/agents/supported.mdx.Prompt injection
ZCode has no argv prompt form — unknown positionals exit with
Unknown command: …— and no prefill flag or env seeding, so the entry usesstdin-after-start(launch the bare TUI, paste once the composer is up), the same path Kimi/Aider/Qwen use. The newtui-agent-startuptest pins this contract.Out of scope: usage / rate-limit tracking
Unlike Kimi (documented managed-usage endpoint) or MiniMax, Z.ai does not publish a usage API for the coding plan, so no usage provider is included in this PR. Happy to follow up once there's a stable path (also filed an issue to discuss).
Verification
pnpm run typecheck(node/cli/web/e2e projects) — cleanvitestfortui-agent-config,agent-kind,skills-cli-agent-keys,agent-process-recognition,require-tui-agent-config,agent-status,tui-agent-startup— 202 tests passingverify:localization-catalog/verify:localization-coverage— passingoxfmtapplied to all touched files