Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const PINNED_PROTECTED_COPY = [
'components.native-chat.composer.permissionAppliesNextMessage',
'components.native-chat.composer.permissionAsk',
'components.native-chat.composer.permissionAskDescription',
'components.native-chat.composer.permissionAskReadOnlyDescription',
'components.native-chat.composer.permissionReadOnly',
'components.native-chat.composer.permissionAskSharedDescription',
'components.native-chat.composer.permissionAuto',
'components.native-chat.composer.permissionAutoDescription',
Expand Down
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 @@ -65,6 +65,7 @@ If an agent's CLI is installed outside `PATH`, expand its row in **Settings →
| 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/) |
| DimAgent | Auto-setup via `dima` (`npm install -g dimcode-alpha`), status | [ArcShips](https://github.com/arcships/dim) |

## ZCode: pick a CLI that ships the TUI

Expand Down
4 changes: 2 additions & 2 deletions docs/site/content/docs/cli/orchestration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ orca orchestration task-create --spec "Audit billing settings for mobile layout"
orca orchestration worker-start --task <taskId> --worktree current --agent codex
# or new worktree:
orca orchestration worker-start --task <taskId> --worktree new-child --name billing-audit --agent codex --setup run
# optional per-worker model / effort (Claude, Codex, Cursor, Antigravity, Grok, Muse, Pi; not with --terminal):
# optional per-worker model / effort (Claude, Codex, Cursor, Antigravity, Grok, Muse, Pi, DimAgent; not with --terminal):
orca orchestration worker-start --task <taskId> --worktree current --agent claude --model <opaque-model-id> --effort high
```

`--agent` takes any Orca agent ID enabled on the worker server, for example `claude`, `codex`, `cursor`, `antigravity`, `muse`, `opencode`, or `opencode2`. `--model` accepts opaque provider model IDs for Claude, Codex, Cursor, Antigravity, Grok, Muse, and Pi (for example `--agent muse --model muse-spark-1.3`); Pi takes a `provider/id` selector and maps `--effort` to its own `--thinking` level (off, minimal, low, medium, high, xhigh, max); OpenCode accepts a per-launch model only in an existing worktree, when the execution host verifies its CLI version and model availability; OpenCode effort remains unsupported. Other agents run the model from their own config. `--effort` requires `--model` and only applies when that agent/model supports the level. Neither flag can combine with `--terminal` (reuse an existing pane). Overrides apply to that launch only and show as `model` / `effort` in the start receipt (`--full --json` shows `launch.requested` / `launch.effective`). Federated starts need a worker host that advertises launch-preference support.
`--agent` takes any Orca agent ID enabled on the worker server, for example `claude`, `codex`, `cursor`, `antigravity`, `muse`, `opencode`, or `opencode2`. `--model` accepts opaque provider model IDs for Claude, Codex, Cursor, Antigravity, Grok, Muse, Pi, and DimAgent (for example `--agent muse --model muse-spark-1.3`); Pi takes a `provider/id` selector and maps `--effort` to its own `--thinking` level (off, minimal, low, medium, high, xhigh, max); DimAgent takes a `provider/model` selector such as `openai-codex/gpt-5.5`, launched as `dima --provider openai-codex --model gpt-5.5`; Orca exposes the model choice for DimAgent; OpenCode accepts a per-launch model only in an existing worktree, when the execution host verifies its CLI version and model availability; OpenCode effort remains unsupported. Other agents run the model from their own config. `--effort` requires `--model` and only applies when that agent/model supports the level. Neither flag can combine with `--terminal` (reuse an existing pane). Overrides apply to that launch only and show as `model` / `effort` in the start receipt (`--full --json` shows `launch.requested` / `launch.effective`). Federated starts need a worker host that advertises launch-preference support.

After starting workers, end your turn. Orca wakes the coordinator when a worker reports, asks, or stops. In a chat, each message arrives whole: act on it. When the wake names a `check` command (a terminal, or a chat message too large to deliver whole), run it and handle every message it prints:

Expand Down
1 change: 1 addition & 0 deletions mobile/src/components/icons/mobile-agent-icon-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const MOBILE_AGENT_ICON_ASSETS: Partial<Record<TuiAgent, ImageSourcePropT
rovo: require('../../../../src/shared/agent-icons/rovo.png'),
hermes: require('../../../../src/shared/agent-icons/hermes.png'),
devin: require('../../../../src/shared/agent-icons/devin.png'),
dima: require('../../../../src/shared/agent-icons/dima.png'),
muse: require('../../../../src/shared/agent-icons/muse.png'),
dsh: require('../../../../src/shared/agent-icons/dsh.png'),
zcode: require('../../../../src/shared/agent-icons/zcode.png'),
Expand Down
3 changes: 2 additions & 1 deletion mobile/src/test-support/mobile-agent-icon-assets-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ export const MOBILE_AGENT_ICON_ASSETS: Partial<Record<TuiAgent, ImageSourcePropT
dsh: 36,
zcode: 37,
openclaw: 38,
jcode: 39
jcode: 39,
dima: 40
}
3 changes: 2 additions & 1 deletion src/cli/agents/agent-launch-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ export function readCliAgentLaunch(
agent: TuiAgent,
target: { createsWorktree: boolean }
): CliAgentLaunch {
const surface = readSurfaceFlag(flags)
const checked = checkAgentLaunchModelPreferences({
agent,
...(surface ? { surface } : {}),
model: getOptionalStringFlag(flags, 'model'),
effort: getOptionalStringFlag(flags, 'effort'),
createsWorktree: target.createsWorktree,
Expand All @@ -92,7 +94,6 @@ export function readCliAgentLaunch(
if (operationId !== undefined && parseAgentSessionOperationTimestamp(operationId) === null) {
throw new RuntimeClientError('invalid_argument', 'Malformed --retry-launch operation ID')
}
const surface = readSurfaceFlag(flags)
return {
agent,
...(surface ? { surface } : {}),
Expand Down
2 changes: 1 addition & 1 deletion src/cli/specs/agent-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const AGENT_LAUNCH_COMMAND_SPECS: CommandSpec[] = [
'Starts the agent the way a new agent tab does: as a chat when your Chat | CLI choice for the agent is Chat and the agent and host support it, otherwise as a terminal. The result says which (`outcome.kind`) and why (`receipt.detail`).',
'--surface chat|terminal picks for this launch instead of your setting. --surface terminal always runs the agent CLI; --surface chat is refused when Orca can establish before starting anything that this agent cannot open as a chat there. If support cannot be checked, the launch can fall back to a terminal. If chat becomes unavailable after creating a workspace, Orca keeps the workspace, setup and default tabs, then opens a terminal; the receipt explains the fallback.',
'--worktree defaults to the native folder workspace or worktree containing the current directory. For a new checkout with its agent, use `orca worktree create --agent`.',
'--model takes a provider model id (OMP also takes its model roles and selectors) and --effort a reasoning effort for that model; --effort requires --model. Pi takes a `provider/id` model and maps --effort to `--thinking` (off, minimal, low, medium, high, xhigh, max). They apply to either surface.',
"--model takes a provider model id (OMP also takes its model roles and selectors) and --effort a reasoning effort for that model; --effort requires --model. Pi takes a `provider/id` model and maps --effort to `--thinking` (off, minimal, low, medium, high, xhigh, max). They apply to either surface, except DimAgent, which takes no --effort: its terminal, and a launch without --surface, takes a `provider/model` selector such as `openai-codex/gpt-5.5`, while --surface chat takes the whole model id DimAgent's chats list, such as `gpt-5.5` or `vendor/chat-two`. A chat model DimAgent does not offer, including a selector or an id two providers share, fails the chat's first message instead of running another model.",
'The tab opens without switching focus; pass --focus to switch to it.',
'If the launch reply is lost, re-issue the same command from the same directory on the same host with --retry-launch <operationId> from the error. Never retry as a fresh launch; older hosts require inspecting the workspace first.'
],
Expand Down
2 changes: 1 addition & 1 deletion src/cli/specs/orchestration-worker-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const ORCHESTRATION_WORKER_COMMAND_SPECS: CommandSpec[] = [
"Reusing a settled worker's terminal with --terminal before its autoReleaseAt cancels that automatic release; after it, the start is refused while the release runs.",
'A terminal the user kept open takes --terminal work and stays kept open.',
'--agent takes an Orca agent id enabled on the worker server, such as claude, codex, cursor, antigravity, muse, zcode, opencode, or opencode2.',
'--model supports Claude, Codex, Cursor, Antigravity, Grok, and Muse opaque provider model ids; --effort requires --model. OMP also takes its model roles and selectors (such as @worker or provider/model:level), with --effort as its thinking level. Neither can combine with --terminal. OpenCode model selection requires an existing worktree, a verified execution-host CLI, and an available model; effort is unsupported. Pi takes a provider/id --model and maps --effort to its --thinking level (off, minimal, low, medium, high, xhigh, max). Other agents, including zcode, launch with the model from their own config.',
'--model supports Claude, Codex, Cursor, Antigravity, Grok, and Muse opaque provider model ids; --effort requires --model. OMP also takes its model roles and selectors (such as @worker or provider/model:level), with --effort as its thinking level. Neither can combine with --terminal. OpenCode model selection requires an existing worktree, a verified execution-host CLI, and an available model; effort is unsupported. Pi takes a provider/id --model and maps --effort to its --thinking level (off, minimal, low, medium, high, xhigh, max). DimAgent takes a provider/model --model, such as openai-codex/gpt-5.5, and no --effort. Other agents, including zcode, launch with the model from their own config.',
'Finished workers close on their own unless started with --keep-open; a worker started in a new worktree (new-child or new-top-level) is kept open when the receipt says keepOpenByDefault, so release it when no one will use its chat.',
'New worktrees use agent-first creation; without --setup, setup runs unless the project turns it off. Repository start-immediately runs setup beside the agent; wait-for-setup gates agent readiness and task input.',
'New worktrees without --name get the name Orca gives an unnamed workspace; the receipt names it. Servers older than this change still require --name.',
Expand Down
3 changes: 3 additions & 0 deletions src/main/acp/acp-dialects/acp-dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ export type AcpDialect = {
compactCommand?: string
/** Orca's catalog ids (the agent CLI's) its chat server names differently, as the server's ids. */
chatModelIds?: ReadonlyMap<string, string>
/** Its model option's id, which still sets a model it lists while it leaves the option out
* because its current model is not listed. */
unpublishedModelConfigId?: string
/** Resolves a CLI model id the chat server does not list to a listed model plus its effort,
* thinking and Fast; null if none. */
unlistedChatModel?(value: string, listed: readonly string[]): AcpListedChatModel | null
Expand Down
26 changes: 26 additions & 0 deletions src/main/acp/acp-dialects/dima-dialect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { z } from 'zod'
import { readAcpPermissionRequest } from '../protocol/acp-permission-requests'
import { acpPermissionPresentation } from '../requests/acp-timeline-requests'
import type { AcpDialect, AcpRequestPresentation } from './acp-dialect'

const approvalInputSchema = z.looseObject({
command: z.string().optional(),
path: z.string().optional(),
url: z.string().optional()
})
const ACTION_MAX_CHARS = 512

// An approval is titled with the preset's reason; what it would run or touch is only in its input.
function approvalRequest(method: string, params: unknown): AcpRequestPresentation | undefined {
const request =
method === 'session/request_permission' ? readAcpPermissionRequest(params, () => {}) : null
const input = approvalInputSchema.safeParse(request?.toolCall.rawInput).data
const action = input?.command ?? input?.path ?? input?.url
return action ? acpPermissionPresentation(params, action.slice(0, ACTION_MAX_CHARS)) : undefined
}

export const DIMA_ACP_DIALECT: AcpDialect = {
request: approvalRequest,
// A current model two providers share hides the option, so a requested one is written, not skipped.
unpublishedModelConfigId: 'model'
}
4 changes: 3 additions & 1 deletion src/main/acp/launch/acp-launch-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { QWEN_CODE_LAUNCH_SPEC } from '../../qwen-code/qwen-code-acp-launch-spec
import { CLINE_LAUNCH_SPEC } from '../../cline/cline-acp-launch-spec'
import { DEVIN_LAUNCH_SPEC } from '../../devin/devin-acp-launch-spec'
import { CODEBUDDY_LAUNCH_SPEC } from '../../codebuddy/codebuddy-acp-launch-spec'
import { DIMA_LAUNCH_SPEC } from '../../dima/dima-acp-launch-spec'
import type { AcpLaunchSpec } from './acp-launch-contract'
import { OPENCODE_MINIMUM_VERSIONS, OPENCODE2_MINIMUM_VERSIONS } from './acp-minimum-versions'

Expand Down Expand Up @@ -186,7 +187,8 @@ export const ACP_LAUNCH_SPECS: readonly AcpLaunchSpec[] = [
QWEN_CODE_LAUNCH_SPEC,
CLINE_LAUNCH_SPEC,
DEVIN_LAUNCH_SPEC,
CODEBUDDY_LAUNCH_SPEC
CODEBUDDY_LAUNCH_SPEC,
DIMA_LAUNCH_SPEC
]

export function acpLaunchSpecFor(agent: string): AcpLaunchSpec | null {
Expand Down
23 changes: 12 additions & 11 deletions src/main/acp/options/acp-structured-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function isSelect(option: SessionConfigOption): option is SelectOption {
return option.type === 'select'
}

function configWrite(configId: string | undefined, value: string): AcpOptionWrite | null {
return configId === undefined ? null : { method: 'config', configId, value }
}

export class AcpStructuredOptions {
constructor(
private readonly dialect: Pick<
Expand All @@ -38,6 +42,7 @@ export class AcpStructuredOptions {
| 'familyEfforts'
| 'withheldCommands'
| 'chatModelIds'
| 'unpublishedModelConfigId'
| 'effortChangesModel'
| 'clampsUnlistedEffort'
| 'builtinCommands'
Expand Down Expand Up @@ -224,27 +229,23 @@ export class AcpStructuredOptions {

write(key: string, value: string): AcpOptionWrite | null {
if (key === 'fastMode' || key === 'thinking') {
const option = this.idSelect(
key === 'fastMode' ? this.dialect.fastConfigId : this.dialect.thinkingConfigId
)
return option ? { method: 'config', configId: option.id, value } : null
const id = key === 'fastMode' ? this.dialect.fastConfigId : this.dialect.thinkingConfigId
return configWrite(this.idSelect(id)?.id, value)
}
if (key === 'model') {
const option = this.select('model')
const model = this.dialect.chatModelIds?.get(value) ?? value
if (option) {
return { method: 'config', configId: option.id, value: model }
}
return this.models ? { method: 'model', modelId: model } : null
return !option && this.models
? { method: 'model', modelId: model }
: configWrite(option?.id ?? this.dialect.unpublishedModelConfigId, model)
}
if (key === 'effort') {
const option = this.effortOption()
return option ? { method: 'config', configId: option.id, value } : null
return configWrite(this.effortOption()?.id, value)
}
if (key === 'interactionMode') {
const option = this.select('mode')
const native = acpInteractionModeValue(this.dialect.interactionModes, option, value)
return option && native ? { method: 'config', configId: option.id, value: native } : null
return native ? configWrite(option?.id, native) : null
}
return null
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/agent-launch/agent-launch-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from '../../shared/agent-launch/contracts/agent-launch-intent'
import {
combineLaunchWarnings,
ignoredStructuredLaunchInputsWarning
ignoredStructuredLaunchInputsWarning,
terminalLaunchWarning
} from './agent-launch-warnings'
import {
argvLaunchPrompt,
Expand Down Expand Up @@ -319,7 +320,7 @@ async function createTerminalSurface(
...(terminal.paneKey ? { paneKey: terminal.paneKey } : {})
},
terminalCreation: terminal.terminalCreation,
...(terminal.warning ? { warning: terminal.warning } : {}),
...terminalLaunchWarning(intent, terminal.warning),
...(startupPrompt && terminal.promptRodeLaunchCommand ? { promptRodeLaunchCommand: true } : {})
}
}
24 changes: 24 additions & 0 deletions src/main/agent-launch/agent-launch-surface-factories.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect, it } from 'vitest'
import { terminalLaunchInputs } from './agent-launch-surface-factories'

it("keeps a dima chat's model id out of a terminal, which would read it as a provider", () => {
const target = { kind: 'existing' as const, worktree: 'id:w' }
const terminalModel = (intent: Parameters<typeof terminalLaunchInputs>[0]) =>
terminalLaunchInputs(intent).options?.model
expect([
terminalModel({
agent: 'dima',
target,
surface: 'chat',
sessionOptions: { model: 'vendor/chat-two' }
}),
terminalModel({
agent: 'dima',
target,
surface: 'chat',
sessionOptions: { model: 'p2/vendor/chat-two' },
chatOptions: { model: 'vendor/chat-two' }
}),
terminalModel({ agent: 'dima', target, sessionOptions: { model: 'p2/vendor/chat-two' } })
]).toEqual([undefined, 'p2/vendor/chat-two', 'p2/vendor/chat-two'])
})
32 changes: 29 additions & 3 deletions src/main/agent-launch/agent-launch-surface-factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent'
import type { SetupTrustMismatch } from '../../shared/worktree/create-types'
import type { AgentLaunchParams } from '../../shared/rpc-contract/agent-launch/agent-launch-params'
import { toAgentLaunchPreferences } from '../../shared/agent-launch/choices/agent-launch-preferences'
import { getAgentSessionOptionCatalog } from '../../shared/agent-session/options/agent-session-option-catalog'
import { assertOpenCodeModelLaunchPreferencesAbsent } from '../opencode/model-launch/opencode-model-startup-plan'

/** Inject creation so orchestration can add subscriptions without duplicating launch sequencing. */
Expand Down Expand Up @@ -128,9 +129,34 @@ export type AgentLaunchWorkspaceFactory = {
createFolderWorkspace?: AgentLaunchWorkspaceFactory['createWorktree']
}

/** The options a terminal leg starts with: a caller's saved chat choice applies to it too. */
function terminalLaunchOptions(intent: Pick<AgentLaunchIntent, 'sessionOptions' | 'chatOptions'>) {
return intent.sessionOptions ?? intent.chatOptions
type TerminalOptionsIntent = Pick<
AgentLaunchIntent,
'agent' | 'surface' | 'sessionOptions' | 'chatOptions'
>

/** A model the launch names in its chat's own ids, which this agent's terminal would misread as a
* provider selector: the chat's options, or the only options of a launch that asked for a chat. */
export function terminalLaunchChatModel(intent: TerminalOptionsIntent): string | undefined {
const chatNamed =
intent.sessionOptions === undefined ||
(intent.surface === 'chat' && intent.chatOptions === undefined)
const model = (intent.sessionOptions ?? intent.chatOptions)?.model
return chatNamed &&
typeof model === 'string' &&
getAgentSessionOptionCatalog(intent.agent)?.chatModelId
? model
: undefined
}

/** The options a terminal leg starts with: a caller's saved chat choice applies to it too, except
* a chat model id the terminal can't take. */
function terminalLaunchOptions(intent: TerminalOptionsIntent) {
const options = intent.sessionOptions ?? intent.chatOptions
if (!options || terminalLaunchChatModel(intent) === undefined) {
return options
}
const { model: _chatModel, ...terminalOptions } = options
return terminalOptions
}

/** Refuses, before anything exists, an OpenCode terminal its host cannot verify, read as that
Expand Down
Loading