From 99b5de6e3dd64bbdc8b9b697e2ac2c82396c7179 Mon Sep 17 00:00:00 2001 From: leofoo <147456583+leo-foo@users.noreply.github.com> Date: Thu, 18 Jun 2026 03:12:45 +0900 Subject: [PATCH] Add Ante as a supported CLI agent (#5193) Co-authored-by: Claude Fable 5 Co-authored-by: Orca Co-authored-by: brennanb2025 --- mobile/src/tasks/mobile-tui-agents.ts | 4 ++ src/renderer/src/i18n/locales/en.json | 3 +- src/renderer/src/i18n/locales/es.json | 3 +- src/renderer/src/i18n/locales/ja.json | 3 +- src/renderer/src/i18n/locales/ko.json | 3 +- src/renderer/src/i18n/locales/zh.json | 3 +- src/renderer/src/lib/agent-catalog.tsx | 7 +++ src/renderer/src/lib/agent-status.test.ts | 5 ++ src/renderer/src/lib/agent-status.ts | 6 ++- .../src/lib/tui-agent-startup.test.ts | 16 +++++++ src/shared/agent-headless-command.ts | 22 +++++++++ src/shared/agent-kind.ts | 3 +- src/shared/agent-process-recognition.test.ts | 48 +++++++++++++++++++ src/shared/agent-process-recognition.ts | 22 ++++----- src/shared/agent-status-types.ts | 1 + src/shared/ante-headless-command.ts | 20 ++++++++ src/shared/telemetry-events.ts | 1 + src/shared/tui-agent-config.ts | 9 ++++ src/shared/tui-agent-display-names.ts | 1 + src/shared/tui-agent-permissions.ts | 3 +- src/shared/tui-agent-selection.ts | 1 + src/shared/types.ts | 1 + 22 files changed, 163 insertions(+), 22 deletions(-) create mode 100644 src/shared/agent-headless-command.ts create mode 100644 src/shared/ante-headless-command.ts diff --git a/mobile/src/tasks/mobile-tui-agents.ts b/mobile/src/tasks/mobile-tui-agents.ts index d2470e011..50e586120 100644 --- a/mobile/src/tasks/mobile-tui-agents.ts +++ b/mobile/src/tasks/mobile-tui-agents.ts @@ -11,6 +11,7 @@ export const MOBILE_TUI_AGENT_AUTO_PICK_ORDER = [ 'grok', 'copilot', 'opencode', + 'ante', 'pi', 'omp', 'gemini', @@ -46,6 +47,7 @@ export const MOBILE_TUI_AGENT_LABELS: Record = { grok: 'Grok', copilot: 'GitHub Copilot', opencode: 'OpenCode', + ante: 'Ante', pi: 'Pi', omp: 'OMP', gemini: 'Gemini', @@ -78,6 +80,7 @@ export const MOBILE_TUI_AGENT_FAVICON_DOMAINS: Partial> grok: 'x.ai', copilot: 'github.com', opencode: 'opencode.ai', + ante: 'antigma.ai', omp: 'omp.sh', gemini: 'gemini.google.com', antigravity: 'antigravity.google', @@ -111,6 +114,7 @@ export const MOBILE_TUI_AGENT_LAUNCH_COMMANDS: Record = { grok: 'grok', copilot: 'copilot', opencode: 'opencode', + ante: 'ante', pi: 'pi', omp: 'omp', gemini: 'gemini', diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 37bfc336c..5a947695b 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -276,7 +276,8 @@ "a5fc0cb622": "OpenClaude", "bf53f09bf8": "Claude Agent Teams", "0708ed89f1": "Claude", - "fc80296033": "Devin" + "fc80296033": "Devin", + "da41abbdd4": "Ante" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 737986711..3fbaf706c 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -276,7 +276,8 @@ "a5fc0cb622": "OpenClaude", "bf53f09bf8": "Claude Agent Teams", "0708ed89f1": "Claude", - "fc80296033": "Devin" + "fc80296033": "Devin", + "da41abbdd4": "Ante" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index a29963a87..332b6ed62 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -276,7 +276,8 @@ "a5fc0cb622": "OpenClaude", "bf53f09bf8": "Claude Agent Teams", "0708ed89f1": "Claude", - "fc80296033": "Devin" + "fc80296033": "Devin", + "da41abbdd4": "Ante" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index a98456065..fa5f5fd1e 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -276,7 +276,8 @@ "a5fc0cb622": "OpenClaude", "bf53f09bf8": "Claude Agent Teams", "0708ed89f1": "Claude", - "fc80296033": "Devin" + "fc80296033": "Devin", + "da41abbdd4": "Ante" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index dea97ec9d..11dcd94b5 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -276,7 +276,8 @@ "a5fc0cb622": "OpenClaude", "bf53f09bf8": "Claude Agent Teams", "0708ed89f1": "Claude", - "fc80296033": "Devin" + "fc80296033": "Devin", + "da41abbdd4": "Ante" }, "skill": { "cli": { diff --git a/src/renderer/src/lib/agent-catalog.tsx b/src/renderer/src/lib/agent-catalog.tsx index 5ea3eb59c..2088b834b 100644 --- a/src/renderer/src/lib/agent-catalog.tsx +++ b/src/renderer/src/lib/agent-catalog.tsx @@ -74,6 +74,13 @@ export const getAgentCatalog = createLocalizedCatalog((): AgentCatalogEntry[] => faviconDomain: 'opencode.ai', homepageUrl: 'https://opencode.ai/docs/cli/' }, + { + id: 'ante', + label: translate('auto.lib.agent.catalog.da41abbdd4', 'Ante'), + cmd: 'ante', + faviconDomain: 'antigma.ai', + homepageUrl: 'https://github.com/AntigmaLabs/ante-preview' + }, { id: 'pi', label: translate('auto.lib.agent.catalog.302934c5d9', 'Pi'), diff --git a/src/renderer/src/lib/agent-status.test.ts b/src/renderer/src/lib/agent-status.test.ts index bbbac3973..62e026465 100644 --- a/src/renderer/src/lib/agent-status.test.ts +++ b/src/renderer/src/lib/agent-status.test.ts @@ -812,6 +812,10 @@ describe('formatAgentTypeLabel', () => { expect(formatAgentTypeLabel('command-code')).toBe('Command Code') }) + it("maps 'ante' to 'Ante'", () => { + expect(formatAgentTypeLabel('ante')).toBe('Ante') + }) + it('passes through arbitrary custom agent names as-is', () => { expect(formatAgentTypeLabel('weirdo')).toBe('weirdo') }) @@ -835,6 +839,7 @@ describe('agentTypeToIconAgent', () => { expect(agentTypeToIconAgent('openclaude')).toBe('openclaude') expect(agentTypeToIconAgent('antigravity')).toBe('antigravity') expect(agentTypeToIconAgent('command-code')).toBe('command-code') + expect(agentTypeToIconAgent('ante')).toBe('ante') }) it('returns null for arbitrary non-iconable strings', () => { diff --git a/src/renderer/src/lib/agent-status.ts b/src/renderer/src/lib/agent-status.ts index fa6691364..3addb6235 100644 --- a/src/renderer/src/lib/agent-status.ts +++ b/src/renderer/src/lib/agent-status.ts @@ -127,7 +127,8 @@ const WELL_KNOWN_LABELS: Record = { 'command-code': 'Command Code', grok: 'Grok', hermes: 'Hermes', - devin: 'Devin' + devin: 'Devin', + ante: 'Ante' } export function formatAgentTypeLabel(agentType: AgentType | null | undefined): string { @@ -183,7 +184,8 @@ const ICONABLE_AGENT_TYPES: Record = { openclaw: true, copilot: true, grok: true, - devin: true + devin: true, + ante: true } export function agentTypeToIconAgent(agentType: AgentType | null | undefined): TuiAgent | null { diff --git a/src/renderer/src/lib/tui-agent-startup.test.ts b/src/renderer/src/lib/tui-agent-startup.test.ts index 7fcb743d7..97d6aa1d2 100644 --- a/src/renderer/src/lib/tui-agent-startup.test.ts +++ b/src/renderer/src/lib/tui-agent-startup.test.ts @@ -87,6 +87,22 @@ describe('buildAgentStartupPlan', () => { }) }) + it('launches Ante first and injects the draft prompt after startup', () => { + expect( + buildAgentStartupPlan({ + agent: 'ante', + prompt: 'Summarize the failing tests', + cmdOverrides: {}, + platform: 'linux' + }) + ).toEqual({ + agent: 'ante', + launchCommand: 'ante', + expectedProcess: 'ante', + followupPrompt: 'Summarize the failing tests' + }) + }) + it('uses cursor-agent as the actual launch binary', () => { expect( buildAgentStartupPlan({ diff --git a/src/shared/agent-headless-command.ts b/src/shared/agent-headless-command.ts new file mode 100644 index 000000000..5823f727e --- /dev/null +++ b/src/shared/agent-headless-command.ts @@ -0,0 +1,22 @@ +import { isAnteHeadlessOneShotCommand } from './ante-headless-command' +import { isClaudeHeadlessOneShotCommand } from './claude-headless-command' +import type { TuiAgent } from './types' + +export function isHeadlessOneShotAgentCommand(agent: TuiAgent, tokens: readonly string[]): boolean { + if (agent === 'claude') { + return isClaudeHeadlessOneShotCommand(tokens) + } + return agent === 'ante' && isAnteHeadlessOneShotCommand(tokens) +} + +type AgentCommandRecognition = { agent: TuiAgent } | null + +export function filterHeadlessOneShotAgentCommand( + recognition: T, + tokens: readonly string[] +): T | null { + if (recognition && isHeadlessOneShotAgentCommand(recognition.agent, tokens)) { + return null + } + return recognition +} diff --git a/src/shared/agent-kind.ts b/src/shared/agent-kind.ts index 99eac0522..fa933dbe3 100644 --- a/src/shared/agent-kind.ts +++ b/src/shared/agent-kind.ts @@ -45,7 +45,8 @@ const TUI_AGENT_KIND_BY_AGENT = { openclaw: 'openclaw', copilot: 'copilot', grok: 'grok', - devin: 'devin' + devin: 'devin', + ante: 'ante' } satisfies Record // Why: `satisfies Record` makes the lookup exhaustive at compile diff --git a/src/shared/agent-process-recognition.test.ts b/src/shared/agent-process-recognition.test.ts index c142aa259..fedaa4881 100644 --- a/src/shared/agent-process-recognition.test.ts +++ b/src/shared/agent-process-recognition.test.ts @@ -75,6 +75,54 @@ describe('agent process recognition', () => { expect(recognizeAgentProcess('cmd.exe')).toBeNull() }) + it('recognizes Ante without classifying ante-prefixed path fragments as the agent', () => { + expect(recognizeAgentProcess('ante')).toEqual({ + agent: 'ante', + processName: 'ante' + }) + expect(recognizeAgentProcess('/Users/dev/.ante/bin/ante')).toEqual({ + agent: 'ante', + processName: 'ante' + }) + expect(isExpectedAgentProcess('/Users/dev/.ante/bin/ante', 'ante')).toBe(true) + expect(isRecognizedAgentType('ante')).toBe(true) + // Why: 'ante' is a common token in directory and binary names; only the + // exact normalized basename may classify as the agent. + expect(recognizeAgentProcess('ante-obsidian')).toBeNull() + expect(recognizeAgentProcess('antechamber')).toBeNull() + expect(isExpectedAgentProcess('ante-obsidian', 'ante')).toBe(false) + }) + + it('does not recognize Ante headless one-shot commands as interactive agents', () => { + expect(recognizeAgentProcessFromCommandLine('ante -p "summarize this diff"')).toBeNull() + expect(recognizeAgentProcessFromCommandLine('ante -psummarize')).toBeNull() + expect( + recognizeAgentProcessFromCommandLine('ante --prompt "review this for security issues"') + ).toBeNull() + expect( + recognizeAgentProcessFromCommandLine('ante --prompt=review --output-format minimal') + ).toBeNull() + expect(recognizeAgentProcessFromCommandLine('ante --resume ses_123')).toEqual({ + agent: 'ante', + processName: 'ante' + }) + }) + + it('does not recognize wrapped Ante headless one-shot commands as interactive agents', () => { + expect( + recognizeAgentProcessFromCommandLine('node /Users/dev/.ante/bin/ante --prompt "review"') + ).toBeNull() + expect( + recognizeAgentProcessFromCommandLine( + String.raw`node C:\Users\dev\.ante\bin\ante.cmd -p review` + ) + ).toBeNull() + expect(recognizeAgentProcessFromCommandLine('node /Users/dev/.ante/bin/ante')).toEqual({ + agent: 'ante', + processName: 'ante' + }) + }) + it('recognizes Mistral Vibe by its installed executable and legacy alias', () => { expect(recognizeAgentProcess('/home/dev/.local/bin/vibe')).toEqual({ agent: 'mistral-vibe', diff --git a/src/shared/agent-process-recognition.ts b/src/shared/agent-process-recognition.ts index 7b1f3427e..b0464d916 100644 --- a/src/shared/agent-process-recognition.ts +++ b/src/shared/agent-process-recognition.ts @@ -1,7 +1,7 @@ import { getTuiAgentDetectCommands, TUI_AGENT_CONFIG } from './tui-agent-config' import type { AgentType } from './agent-status-types' import type { TuiAgent } from './types' -import { isClaudeHeadlessOneShotCommand } from './claude-headless-command' +import { filterHeadlessOneShotAgentCommand } from './agent-headless-command' export type RecognizedAgentProcess = { agent: TuiAgent; processName: string } @@ -288,7 +288,6 @@ export function recognizeAgentProcess( } return { agent, processName: normalized } } - export function recognizeAgentProcessFromCommandLine( commandLine: string | null | undefined ): RecognizedAgentProcess | null { @@ -297,12 +296,10 @@ export function recognizeAgentProcessFromCommandLine( } const tokens = tokenizeCommandLine(commandLine) const firstNormalized = normalizeProcessName(tokens[0]) - const directRecognition = recognizeAgentProcess(tokens[0]) - // Why: Claude Code plugin hooks spawn `claude --print`/JSON one-shots for - // internal analysis; those should not surface as long-running agent sessions. - if (directRecognition?.agent === 'claude' && isClaudeHeadlessOneShotCommand(tokens)) { - return null - } + const directRecognition = filterHeadlessOneShotAgentCommand( + recognizeAgentProcess(tokens[0]), + tokens + ) if (directRecognition) { return directRecognition } @@ -310,12 +307,11 @@ export function recognizeAgentProcessFromCommandLine( if (!entrypoint) { return null } - if (isPythonProcessName(firstNormalized)) { - return recognizePythonEntrypoint(tokens, entrypoint) - } - return recognizeAgentProcess(entrypoint) ?? recognizeNodeScriptEntrypoint(entrypoint) + const entrypointRecognition = isPythonProcessName(firstNormalized) + ? recognizePythonEntrypoint(tokens, entrypoint) + : (recognizeAgentProcess(entrypoint) ?? recognizeNodeScriptEntrypoint(entrypoint)) + return filterHeadlessOneShotAgentCommand(entrypointRecognition, tokens) } - export function isAgentForegroundWrapperProcess(processName: string | null | undefined): boolean { const normalized = normalizeProcessName(processName) return ( diff --git a/src/shared/agent-status-types.ts b/src/shared/agent-status-types.ts index 25bb50a0f..93297933c 100644 --- a/src/shared/agent-status-types.ts +++ b/src/shared/agent-status-types.ts @@ -31,6 +31,7 @@ export type WellKnownAgentType = | 'grok' | 'hermes' | 'devin' + | 'ante' | 'unknown' export type AgentType = WellKnownAgentType | (string & {}) diff --git a/src/shared/ante-headless-command.ts b/src/shared/ante-headless-command.ts new file mode 100644 index 000000000..c777b2f80 --- /dev/null +++ b/src/shared/ante-headless-command.ts @@ -0,0 +1,20 @@ +const ANTE_HEADLESS_PROMPT_FLAGS = new Set(['--prompt', '-p']) + +function optionName(token: string): string { + const eq = token.indexOf('=') + return eq === -1 ? token : token.slice(0, eq) +} + +function isAnteHeadlessPromptFlag(token: string): boolean { + const name = optionName(token) + return ANTE_HEADLESS_PROMPT_FLAGS.has(name) || /^-p[^-]/.test(name) +} + +export function isAnteHeadlessOneShotCommand(tokens: readonly string[]): boolean { + for (let index = 1; index < tokens.length; index += 1) { + if (isAnteHeadlessPromptFlag(tokens[index])) { + return true + } + } + return false +} diff --git a/src/shared/telemetry-events.ts b/src/shared/telemetry-events.ts index cfc3f1ce5..e2083eaf2 100644 --- a/src/shared/telemetry-events.ts +++ b/src/shared/telemetry-events.ts @@ -101,6 +101,7 @@ export const AGENT_KIND_VALUES = [ 'copilot', 'grok', 'devin', + 'ante', 'other' ] as const export const agentKindSchema = z.enum(AGENT_KIND_VALUES) diff --git a/src/shared/tui-agent-config.ts b/src/shared/tui-agent-config.ts index aaacad5eb..8eed86db1 100644 --- a/src/shared/tui-agent-config.ts +++ b/src/shared/tui-agent-config.ts @@ -94,6 +94,15 @@ export const TUI_AGENT_CONFIG: Record = { expectedProcess: 'autohand', promptInjectionMode: 'stdin-after-start' }, + ante: { + detectCmd: 'ante', + launchCmd: 'ante', + expectedProcess: 'ante', + // Why: `ante --prompt` is Ante's documented headless mode (runs the task + // once and exits), so Orca launches the bare interactive TUI and injects + // the composed prompt after startup to keep the hosted session alive. + promptInjectionMode: 'stdin-after-start' + }, opencode: { detectCmd: 'opencode', launchCmd: 'opencode', diff --git a/src/shared/tui-agent-display-names.ts b/src/shared/tui-agent-display-names.ts index cd56e4c26..8d16ae926 100644 --- a/src/shared/tui-agent-display-names.ts +++ b/src/shared/tui-agent-display-names.ts @@ -11,6 +11,7 @@ export const TUI_AGENT_DISPLAY_NAMES: Record = { openclaude: 'OpenClaude', codex: 'Codex', devin: 'Devin', + ante: 'Ante', autohand: 'Autohand Code', opencode: 'OpenCode', pi: 'Pi', diff --git a/src/shared/tui-agent-permissions.ts b/src/shared/tui-agent-permissions.ts index e5716e962..09b2902bb 100644 --- a/src/shared/tui-agent-permissions.ts +++ b/src/shared/tui-agent-permissions.ts @@ -26,7 +26,8 @@ export const YOLO_TUI_AGENT_ARGS: Partial> = { hermes: '--yolo', copilot: '--yolo', grok: '--permission-mode bypassPermissions', - devin: '--permission-mode bypass' + devin: '--permission-mode bypass', + ante: '--yolo' } export const YOLO_TUI_AGENT_ENV: Partial>> = { diff --git a/src/shared/tui-agent-selection.ts b/src/shared/tui-agent-selection.ts index 487a81910..caedd8a03 100644 --- a/src/shared/tui-agent-selection.ts +++ b/src/shared/tui-agent-selection.ts @@ -11,6 +11,7 @@ export const TUI_AGENT_AUTO_PICK_ORDER = [ 'grok', 'copilot', 'opencode', + 'ante', 'pi', 'omp', 'gemini', diff --git a/src/shared/types.ts b/src/shared/types.ts index e2bb744c5..7268e1608 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -2194,6 +2194,7 @@ export type TuiAgent = | 'copilot' // GitHub Copilot CLI | 'grok' // xAI Grok CLI | 'devin' // Devin CLI + | 'ante' // Ante (Antigma Labs) export type TaskViewPresetId = 'all' | 'issues' | 'review' | 'my-issues' | 'my-prs' | 'prs'