Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/site/content/docs/agents/supported.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ To restore prompts for one agent only, edit that agent's default arguments or en
| Hermes | Auto-setup | [Nous](https://hermes-agent.nousresearch.com/docs/) |
| OpenClaw | Auto-setup | [OpenClaw](https://github.com/openclaw/openclaw) |
| Trae | Auto-setup via `traecli` (TRAE CN CLI) | [Trae](https://www.trae.ai/) |
| ZCode | Auto-setup | [Z.ai](https://zcode.z.ai) |
1 change: 1 addition & 0 deletions mobile/src/components/mobile-agent-icon-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const MOBILE_AGENT_ICON_ASSETS: Partial<Record<TuiAgent, ImageSourcePropT
'mimo-code': require('../../../src/shared/agent-icons/mimo-code.png'),
ante: require('../../../src/shared/agent-icons/ante.png'),
trae: require('../../../src/shared/agent-icons/trae.png'),
zcode: require('../../../src/shared/agent-icons/zcode.png'),
'prime-agent': require('../../../src/shared/agent-icons/prime-agent.png'),
gemini: require('../../../src/shared/agent-icons/gemini.png'),
antigravity: require('../../../src/shared/agent-icons/antigravity.png'),
Expand Down
1 change: 1 addition & 0 deletions mobile/src/tasks/mobile-tui-agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const MOBILE_TUI_AGENT_FAVICON_DOMAINS: Partial<Record<TuiAgent, string>>
'mimo-code': 'mimo.xiaomi.com',
ante: 'antigma.ai',
trae: 'www.trae.cn',
zcode: 'z.ai',
omp: 'omp.sh',
'prime-agent': 'primeintellect.ai',
gemini: 'gemini.google.com',
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@
"fc80296033": "Devin",
"da41abbdd4": "Ante",
"060d152fb5": "Trae",
"e6fdf4b9e0": "ZCode",
"d443a47995": "Prime Agent",
"mimo_code_label": "MiMo Code",
"opencode2_label": "OpenCode 2"
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
"fc80296033": "Devin",
"da41abbdd4": "Ante",
"060d152fb5": "Trae",
"e6fdf4b9e0": "ZCode",
"d443a47995": "Prime Agent",
"mimo_code_label": "MiMo Code"
},
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
"fc80296033": "Devin",
"da41abbdd4": "Ante",
"060d152fb5": "Trae",
"e6fdf4b9e0": "ZCode",
"d443a47995": "Prime Agent",
"mimo_code_label": "MiMo Code"
},
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
"fc80296033": "Devin",
"da41abbdd4": "Ante",
"060d152fb5": "Trae",
"e6fdf4b9e0": "ZCode",
"d443a47995": "Prime Agent",
"mimo_code_label": "MiMo Code"
},
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
"fc80296033": "Devin",
"da41abbdd4": "Ante",
"060d152fb5": "Trae",
"e6fdf4b9e0": "ZCode",
"d443a47995": "Prime Agent",
"mimo_code_label": "MiMo Code"
},
Expand Down
7 changes: 7 additions & 0 deletions src/renderer/src/lib/agent-catalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ export const getAgentCatalog = createLocalizedCatalog((): AgentCatalogEntry[] =>
faviconDomain: 'www.trae.cn',
homepageUrl: 'https://docs.trae.cn/cli_get-started-with-trae-cli'
},
{
id: 'zcode',
label: translate('auto.lib.agent.catalog.e6fdf4b9e0', 'ZCode'),
cmd: 'zcode',
faviconDomain: 'z.ai',
homepageUrl: 'https://zcode.z.ai'
},
{
id: 'pi',
label: translate('auto.lib.agent.catalog.302934c5d9', 'Pi'),
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/lib/agent-favicon-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import grokUrl from '../../../shared/agent-icons/grok.png?url'
import mimoCodeUrl from '../../../shared/agent-icons/mimo-code.png?url'
import anteUrl from '../../../shared/agent-icons/ante.png?url'
import traeUrl from '../../../shared/agent-icons/trae.png?url'
import zcodeUrl from '../../../shared/agent-icons/zcode.png?url'
import primeAgentUrl from '../../../shared/agent-icons/prime-agent.png?url'
import geminiUrl from '../../../shared/agent-icons/gemini.png?url'
import antigravityUrl from '../../../shared/agent-icons/antigravity.png?url'
Expand Down Expand Up @@ -37,6 +38,7 @@ export const AGENT_FAVICON_ASSETS: Partial<Record<TuiAgent, string>> = {
'mimo-code': mimoCodeUrl,
ante: anteUrl,
trae: traeUrl,
zcode: zcodeUrl,
'prime-agent': primeAgentUrl,
gemini: geminiUrl,
antigravity: antigravityUrl,
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/src/lib/agent-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,10 @@ describe('formatAgentTypeLabel', () => {
expect(formatAgentTypeLabel('trae')).toBe('Trae')
})

it("maps 'zcode' to 'ZCode'", () => {
expect(formatAgentTypeLabel('zcode')).toBe('ZCode')
})

it("maps 'prime-agent' to 'Prime Agent'", () => {
expect(formatAgentTypeLabel('prime-agent')).toBe('Prime Agent')
})
Expand Down Expand Up @@ -895,6 +899,7 @@ describe('agentTypeToIconAgent', () => {
expect(agentTypeToIconAgent('command-code')).toBe('command-code')
expect(agentTypeToIconAgent('ante')).toBe('ante')
expect(agentTypeToIconAgent('trae')).toBe('trae')
expect(agentTypeToIconAgent('zcode')).toBe('zcode')
expect(agentTypeToIconAgent('prime-agent')).toBe('prime-agent')
})

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/lib/agent-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ const ICONABLE_AGENT_TYPES: Record<TuiAgent, true> = {
grok: true,
devin: true,
ante: true,
trae: true
trae: true,
zcode: true
}

// Why: return null (not a 'claude' fallback) for unknown so Codex panes don't flash the Claude icon before the hook fires.
Expand Down
17 changes: 17 additions & 0 deletions src/renderer/src/lib/tui-agent-startup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,23 @@ describe('buildAgentStartupPlan', () => {
).toBe("traecli -- 'help me name this config'")
})

it('launches ZCode bare and injects the draft prompt after startup', () => {
expect(
buildAgentStartupPlan({
agent: 'zcode',
prompt: 'Summarize the failing tests',
cmdOverrides: {},
platform: 'linux'
})
).toEqual({
agent: 'zcode',
launchCommand: 'zcode',
expectedProcess: 'zcode',
followupPrompt: 'Summarize the failing tests',
launchConfig: emptyLaunchConfig('zcode')
})
})

it('passes the prompt to Prime Agent as a positional argv behind a `--` separator', () => {
expect(
buildAgentStartupPlan({
Expand Down
7 changes: 4 additions & 3 deletions src/shared/agent-headless-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import { isPrintModeHeadlessOneShotCommand } from './print-mode-headless-command
import type { TuiAgent } from './tui-agent'

// Why: a table (not an if-chain) so adding an agent is one entry; Claude and Trae share
// the same `--print` one-shot contract, Ante's `--prompt` form and Prime Agent's
// `--mode` forms need their own matchers.
// the same `--print` one-shot contract, Ante's and ZCode's `--prompt` form and Prime
// Agent's `--mode` forms need their own matchers.
const HEADLESS_ONE_SHOT_MATCHERS: Partial<
Record<TuiAgent, (tokens: readonly string[]) => boolean>
> = {
claude: isPrintModeHeadlessOneShotCommand,
trae: isPrintModeHeadlessOneShotCommand,
'prime-agent': isPrimeAgentHeadlessOneShotCommand,
ante: isAnteHeadlessOneShotCommand
ante: isAnteHeadlessOneShotCommand,
zcode: isAnteHeadlessOneShotCommand

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

}

export function isHeadlessOneShotAgentCommand(agent: TuiAgent, tokens: readonly string[]): boolean {
Expand Down
Binary file added src/shared/agent-icons/zcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/shared/agent-kind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const TUI_AGENT_KIND_BY_AGENT = {
grok: 'grok',
devin: 'devin',
ante: 'ante',
trae: 'trae'
trae: 'trae',
zcode: 'zcode'
} satisfies Record<TuiAgent, ConcreteAgentKind>

// Why: `satisfies Record<TuiAgent, …>` makes the lookup exhaustive at compile
Expand Down
1 change: 1 addition & 0 deletions src/shared/agent-type-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const WELL_KNOWN_LABELS: Record<string, string> = {
devin: 'Devin',
ante: 'Ante',
trae: 'Trae',
zcode: 'ZCode',
kimi: 'Kimi'
}

Expand Down
3 changes: 2 additions & 1 deletion src/shared/skills-cli-agent-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export const SKILLS_CLI_AGENT_KEY_BY_TUI_AGENT = {
devin: 'devin',
ante: null,
// Why: Orca detects trae by `traecli`, an alias only TRAE CN ships.
trae: 'trae-cn'
trae: 'trae-cn',
zcode: 'zcode'
} satisfies Record<TuiAgent, string | null>

/**
Expand Down
1 change: 1 addition & 0 deletions src/shared/telemetry-property-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const AGENT_KIND_VALUES = [
'devin',
'ante',
'trae',
'zcode',
'other'
] as const
export const agentKindSchema = z.enum(AGENT_KIND_VALUES)
Expand Down
6 changes: 6 additions & 0 deletions src/shared/tui-agent-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ const TUI_AGENT_CONFIG_SOURCE: Record<TuiAgent, TuiAgentConfigSource> = {
// Trae subcommand or flag — `--` stops both in its Cobra parser.
argvPromptSeparator: '--'
},
zcode: {
detectCmd: 'zcode',
// Why: unknown positionals exit with `Unknown command` (no argv prompt form), so
// launch the bare TUI and paste the prompt once the composer is up.
promptInjectionMode: 'stdin-after-start'
},
opencode: {
detectCmd: 'opencode',
promptInjectionMode: 'flag-prompt',
Expand Down
1 change: 1 addition & 0 deletions src/shared/tui-agent-display-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const TUI_AGENT_DISPLAY_NAMES: Record<TuiAgent, string> = {
devin: 'Devin',
ante: 'Ante',
trae: 'Trae',
zcode: 'ZCode',
autohand: 'Autohand Code',
opencode: 'OpenCode',
opencode2: 'OpenCode 2',
Expand Down
2 changes: 2 additions & 0 deletions src/shared/tui-agent-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const YOLO_TUI_AGENT_ARGS: Partial<Record<TuiAgent, string>> = {
devin: '--permission-mode bypass',
ante: '--yolo',
trae: '--yolo',
// Why: `--mode yolo` is ZCode's permission-bypass flag (`zcode --help`).
zcode: '--mode yolo',
droid: '--auto high'
}

Expand Down
1 change: 1 addition & 0 deletions src/shared/tui-agent-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const TUI_AGENT_AUTO_PICK_ORDER = [
'mimo-code',
'ante',
'trae',
'zcode',
'pi',
'omp',
'prime-agent',
Expand Down
1 change: 1 addition & 0 deletions src/shared/tui-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export type TuiAgent =
| 'devin' // Devin CLI
| 'ante' // Ante (Antigma Labs)
| 'trae' // Trae CLI
| 'zcode' // ZCode CLI
| 'prime-agent' // Prime Agent (Prime Intellect)
Loading