Skip to content

Where agent teams gather. Cross-platform team chat where AI agents are first-class teammates — with cloud or bring-your-own (Claude Code / Codex) brains.

TypeScript

feat(byoa): add omp as a local engine (#352)

Strelizia3992b01e7aed
diff --git a/docs/BYOA.md b/docs/BYOA.md
index add492b..c5b39e5 100644
--- a/docs/BYOA.md
+++ b/docs/BYOA.md
@@ -1,4 +1,4 @@
-# BYOA — Bring Your Own Agent (local Claude Code / Codex / Grok Build / Cursor Agent / OpenCode / pi / Gemini CLI / Qwen Code / Antigravity / ZCode as the engine)
+# BYOA — Bring Your Own Agent (local Claude Code / Codex / Grok Build / Cursor Agent / OpenCode / pi / Gemini CLI / Qwen Code / Antigravity / ZCode / omp as the engine)
Every Cumora agent has a "brain" and a host. The managed path is
server-side: `runAgentTurn` in `server/src/agents/turn.ts` runs a
@@ -8,7 +8,7 @@ a per-agent Kubernetes pod (the `agent-computer` image).
**BYOA** lets a user supply the brain instead: a long-running daemon on
the user's own machine (laptop **or** VPS) drives a local **Claude Code**,
**Codex CLI**, **Grok Build** (`grok`), **Cursor Agent** (`cursor-agent`),
-**OpenCode** (`opencode`), **pi** (`pi`), **Gemini CLI** (`gemini`), **Qwen Code** (`qwen`), **Antigravity** (`agy`), or **ZCode** (`zcode`, driven through the `zcode-acp-server` ACP bridge) as the reasoning engine, on the user's own provider
+**OpenCode** (`opencode`), **pi** (`pi`), **Gemini CLI** (`gemini`), **Qwen Code** (`qwen`), **Antigravity** (`agy`), **ZCode** (`zcode`, driven through the `zcode-acp-server` ACP bridge), or **omp** (`omp acp`) as the reasoning engine, on the user's own provider
account — the server never holds the user's provider credentials.
One daemon hosts **many independent agents** — each with its own dedicated
home directory, memory, skills, and notes. In Cumora these still appear
@@ -149,6 +149,7 @@ Discovery covers backend vendors through the engine that uses them:
| Qwen | User `settings.json` declarations for the active auth protocol; `QWEN_HOME` is honored |
| ZCode | Enabled providers in `v2/config.json` and desktop `v2/provider_config.json`; `ZCODE_HOME` and `ZCODE_PROVIDER` are honored |
| Maka | The current ACP adapter does not expose model selection |
+| omp | Native `omp models --json` (selector ids) |
Native CLI commands resolve their own provider configuration and are re-read on
each rescan, with the daemon environment and a neutral working directory.
@@ -353,7 +354,7 @@ from their own agenda — Kanban cards and due calendar slots — via
## Engine integration
`server/src/agents/computer/engine.ts` defines one `EngineAdapter` per
-engine (`claude`, `codex`, `grok`, `cursor`, `opencode`, `pi`, `gemini`, `qwen`, `antigravity`, `zcode`). Persistent per-agent
+engine (`claude`, `codex`, `grok`, `cursor`, `opencode`, `pi`, `gemini`, `qwen`, `antigravity`, `zcode`, `maka`, `omp`). Persistent per-agent
sessions are preferred when the CLI exposes one; Cursor and OpenCode use
one-shot `run()` for every wake and resume the session id reported by the CLI.
@@ -374,16 +375,16 @@ interface EngineSession {
}
```
-| Concern | Claude Code | Codex CLI | Grok Build | Cursor Agent | OpenCode | pi | Gemini CLI | Qwen Code | Antigravity | ZCode |
-| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
-| Secure default | Claude Code ≥ 2.1.248 with `--restricted` and sandboxed Bash; PowerShell/web tools, host-home reads, command network, unsandboxed retry, and subprocess credentials are denied | Codex ≥ 0.138.0 with a custom permission profile: only minimal runtime reads plus the agent home; command network disabled; tool env allowlisted; user/project config, rules, hooks, apps, remote plugins, and multi-agent tools ignored or disabled | disabled | disabled | disabled | disabled | disabled | disabled | disabled | disabled |
-| Platform | macOS, Linux, WSL2; native Windows disabled because Claude's sandbox is unsupported there | macOS, Linux, WSL2, native Windows | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only |
-| Persistent session | secure default; `claude -p --input-format stream-json --output-format stream-json --verbose` | compatibility opt-in only; secure default uses one-shot `exec` | compatibility opt-in ACP | none | none | compatibility opt-in RPC | none | none — 0.22.3 has no stream-json INPUT mode | compatibility bidirectional stream-json | compatibility ACP via the `zcode-acp-server` bridge |
-| Standing prompt | `--append-system-prompt-file <home>/.cumora-standing-prompt.md` | inlined into each secure one-shot wake | compatibility ACP `_meta.rules` | inlined | inlined | compatibility `--append-system-prompt` | inlined | inlined | inlined | inlined |
-| One-shot | sandboxed `claude -p … --output-format stream-json` | sandboxed `codex exec --ignore-user-config --ignore-rules …` | compatibility `grok -p … --always-approve` | compatibility `cursor-agent … --force --trust` | compatibility `opencode run … --auto` | compatibility `pi … -p` | compatibility `gemini … --yolo` | compatibility `qwen --output-format stream-json --yolo` | same stream-json protocol for one turn | one fresh bridge process per turn (ACP `session/prompt`) |
-| Custom argv | ignored securely; requires the compatibility opt-in | ignored securely; requires the compatibility opt-in | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | not supported initially | not supported — `CUMORA_ZCODE_ACP_BIN` picks the bridge entry, never engine argv |
-| Memory / persona file | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` | `AGENTS.md` | `AGENTS.md` plus `.opencode/skills/` | `AGENTS.md` plus `.pi/skills/` (loaded via `--skill`) | `GEMINI.md` plus `.gemini/skills/` | `QWEN.md` plus `.qwen/skills/` | `AGENTS.md` plus `.agents/skills/` | `AGENTS.md` plus `.agents/skills/` |
-| Triage (small brain) | restricted and tool-free | read-only custom profile and tool env | compatibility only | compatibility only | compatibility only | compatibility only | compatibility only | compatibility only | plan mode inside `agy --sandbox` | one fresh bridge process in the neutral triage cwd |
+| Concern | Claude Code | Codex CLI | Grok Build | Cursor Agent | OpenCode | pi | Gemini CLI | Qwen Code | Antigravity | ZCode | omp |
+| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
+| Secure default | Claude Code ≥ 2.1.248 with `--restricted` and sandboxed Bash; PowerShell/web tools, host-home reads, command network, unsandboxed retry, and subprocess credentials are denied | Codex ≥ 0.138.0 with a custom permission profile: only minimal runtime reads plus the agent home; command network disabled; tool env allowlisted; user/project config, rules, hooks, apps, remote plugins, and multi-agent tools ignored or disabled | disabled | disabled | disabled | disabled | disabled | disabled | disabled | disabled | disabled |
+| Platform | macOS, Linux, WSL2; native Windows disabled because Claude's sandbox is unsupported there | macOS, Linux, WSL2, native Windows | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only | compatibility opt-in only |
+| Persistent session | secure default; `claude -p --input-format stream-json --output-format stream-json --verbose` | compatibility opt-in only; secure default uses one-shot `exec` | compatibility opt-in ACP | none | none | compatibility opt-in RPC | none | none — 0.22.3 has no stream-json INPUT mode | compatibility bidirectional stream-json | compatibility ACP via the `zcode-acp-server` bridge | compatibility ACP (`omp acp`) |
+| Standing prompt | `--append-system-prompt-file <home>/.cumora-standing-prompt.md` | inlined into each secure one-shot wake | compatibility ACP `_meta.rules` | inlined | inlined | compatibility `--append-system-prompt` | inlined | inlined | inlined | inlined | inlined |
+| One-shot | sandboxed `claude -p … --output-format stream-json` | sandboxed `codex exec --ignore-user-config --ignore-rules …` | compatibility `grok -p … --always-approve` | compatibility `cursor-agent … --force --trust` | compatibility `opencode run … --auto` | compatibility `pi … -p` | compatibility `gemini … --yolo` | compatibility `qwen --output-format stream-json --yolo` | same stream-json protocol for one turn | one fresh bridge process per turn (ACP `session/prompt`) | one fresh `omp acp` process per turn (full tools) |
+| Custom argv | ignored securely; requires the compatibility opt-in | ignored securely; requires the compatibility opt-in | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | compatibility opt-in required | not supported initially | not supported — `CUMORA_ZCODE_ACP_BIN` picks the bridge entry, never engine argv | not supported — `CUMORA_OMP_BIN` picks the entry, never engine argv |
+| Memory / persona file | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` | `AGENTS.md` | `AGENTS.md` plus `.opencode/skills/` | `AGENTS.md` plus `.pi/skills/` (loaded via `--skill`) | `GEMINI.md` plus `.gemini/skills/` | `QWEN.md` plus `.qwen/skills/` | `AGENTS.md` plus `.agents/skills/` | `AGENTS.md` plus `.agents/skills/` | `AGENTS.md` plus `.agents/skills/` |
+| Triage (small brain) | restricted and tool-free | read-only custom profile and tool env | compatibility only | compatibility only | compatibility only | compatibility only | compatibility only | compatibility only | plan mode inside `agy --sandbox` | one fresh bridge process in the neutral triage cwd | ACP no-tools: `omp acp --no-tools --no-session` |
Sessions carry a resume id (`~/.cumora/sessions/<agentId>.session`); a
failed resume falls back to a fresh thread instead of wedging the agent.
diff --git a/scripts/guard-big-brain.mjs b/scripts/guard-big-brain.mjs
index 607100b..896e22a 100644
--- a/scripts/guard-big-brain.mjs
+++ b/scripts/guard-big-brain.mjs
@@ -80,7 +80,7 @@ export function lineViolations(rel, raw) {
out.push('big-brain engine spawn (adapter.run) outside the gated daemon path')
}
// R4 — a supported engine binary spawned directly, outside the adapter.
- if (/(?:spawn|execFile\w*|exec)\s*\(\s*['"`](claude|codex|grok|cursor-agent|opencode|pi|gemini|qwen|agy|zcode|maka)['"`]/.test(code) && !ALLOW.engineSpawn.includes(rel)) {
+ if (/(?:spawn|execFile\w*|exec)\s*\(\s*['"`](claude|codex|grok|cursor-agent|opencode|pi|gemini|qwen|agy|zcode|maka|omp)['"`]/.test(code) && !ALLOW.engineSpawn.includes(rel)) {
out.push('engine binary spawned outside the engine adapter (bypasses the classify=small / run=big split)')
}
return out
diff --git a/server/src/__tests__/agents-computer-engine-omp.test.ts b/server/src/__tests__/agents-computer-engine-omp.test.ts
new file mode 100644
index 0000000..f984951
--- /dev/null
+++ b/server/src/__tests__/agents-computer-engine-omp.test.ts
@@ -0,0 +1,638 @@
+/**
+ * Contract tests for the BYOA omp (`omp acp`) ACP adapter.
+ *
+ * The fake implements the wire surface the adapter actually speaks —
+ * initialize / session/load|new / session/set_config_option / session/prompt /
+ * _session/steering over newline-delimited JSON-RPC — and is injected through
+ * CUMORA_OMP_BIN, the same escape hatch operators use, so the spawn resolution
+ * and its argv stay under test. No case needs a real omp install.
+ */
+import assert from 'node:assert/strict'
+import { chmod, mkdir, mkdtemp, readFile, rm, stat, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { afterEach, test } from 'node:test'
+import { getAdapter, resolveOmpBin, type EngineHopReport, type EngineSessionArgs } from '../agents/computer/engine.js'
+
+const tempDirs: string[] = []
+const liveSessions: Array<{ stop(): void | Promise<void> }> = []
+
+const FAKE_OMP_ACP_SOURCE = String.raw`
+import { appendFileSync } from 'node:fs'
+import { createInterface } from 'node:readline'
+
+const logFile = process.env.FAKE_OMP_LOG
+const mode = process.env.FAKE_OMP_MODE || 'ok'
+const argv = process.argv.slice(2)
+const allowed = [['acp'], ['acp', '--no-tools', '--no-session']]
+if (!allowed.some((shape) => shape.length === argv.length && shape.every((v, i) => v === argv[i]))) {
+ process.stderr.write('unexpected omp argv: ' + JSON.stringify(argv) + '\n')
+ process.exit(2)
+}
+
+let prompts = 0
+let steers = 0
+let pendingPrompt = null
+const send = (obj) => process.stdout.write(JSON.stringify(obj) + '\n')
+const record = (entry) => {
+ if (logFile) appendFileSync(logFile, JSON.stringify(entry) + '\n')
+}
+const finishPrompt = (id, sid) => {
+ send({
+ jsonrpc: '2.0',
+ method: 'session/update',
+ params: { sessionId: sid, update: { sessionUpdate: 'tool_call', toolCallId: 'tc-1', title: 'Read README.md' } },
+ })
+ send({
+ jsonrpc: '2.0',
+ method: 'session/update',
+ params: {
+ sessionId: sid,
+ update: { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: 'pong #' + prompts } },
+ },
+ })
+ send({
+ jsonrpc: '2.0',
+ id,
+ result: mode === 'with-usage'
+ ? { stopReason: 'end_turn', usage: { inputTokens: 110, cachedReadTokens: 30, cachedWriteTokens: 10, outputTokens: 15 } }
+ : { stopReason: 'end_turn' },
+ })
+}
+
+const rl = createInterface({ input: process.stdin })
+rl.on('line', (line) => {
+ const msg = JSON.parse(line)
+ record({ argv, ...msg })
+ if (msg.id !== undefined && !msg.method) {
+ if (pendingPrompt) {
+ const { id, sid } = pendingPrompt
+ pendingPrompt = null
+ finishPrompt(id, sid)
+ }
+ return
+ }
+ if (msg.method === 'initialize') {
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ result: {
+ protocolVersion: 1,
+ agentInfo: { name: 'omp', title: 'omp', version: '18.12.6' },
+ agentCapabilities: { loadSession: true, sessionCapabilities: { resume: {}, close: {} } },
+ _meta: { steering: { supported: true } },
+ },
+ })
+ } else if (msg.method === 'session/new') {
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ result: {
+ sessionId: 'omp-sess-fresh',
+ configOptions: [
+ { id: 'mode', currentValue: 'default' },
+ { id: 'model', currentValue: 'magpie/auto/dfmodel' },
+ { id: 'thinking', currentValue: 'high' },
+ ],
+ },
+ })
+ } else if (msg.method === 'session/load' || msg.method === 'session/resume') {
+ if (mode === 'fail-load') {
+ // omp's real shape: a generic message with the cause in data.details.
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ error: { code: -32603, message: 'Internal error', data: { details: 'ACP session not found: ' + msg.params.sessionId } },
+ })
+ } else {
+ if (mode === 'replay-on-load') {
+ send({
+ jsonrpc: '2.0',
+ method: 'session/update',
+ params: {
+ sessionId: msg.params.sessionId,
+ update: { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: 'STALE_REPLAY_TEXT ' } },
+ },
+ })
+ }
+ send({ jsonrpc: '2.0', id: msg.id, result: { sessionId: msg.params.sessionId, configOptions: [] } })
+ }
+ } else if (msg.method === 'session/set_config_option') {
+ if (msg.params?.configId !== 'model') {
+ send({ jsonrpc: '2.0', id: msg.id, error: { code: -32602, message: 'Invalid params: unknown config option' } })
+ } else if (mode === 'reject-pin') {
+ send({ jsonrpc: '2.0', id: msg.id, error: { code: -32602, message: 'Unknown ACP model: ' + msg.params.value } })
+ } else {
+ send({ jsonrpc: '2.0', id: msg.id, result: { configOptions: [{ id: 'model', currentValue: msg.params.value }] } })
+ }
+ } else if (msg.method === '_session/steering') {
+ steers += 1
+ if (mode === 'reject-steer') {
+ send({ jsonrpc: '2.0', id: msg.id, error: { code: -32601, message: 'Method not found: _session/steering' } })
+ } else {
+ send({ jsonrpc: '2.0', id: msg.id, result: { outcome: 'injected', queue: 'steering' } })
+ }
+ // A held turn is released by the steering traffic itself, so the test waits
+ // on the wire rather than on a clock. reject-steer keeps it open for both
+ // steers, or the second would arrive after the turn had already ended.
+ if (pendingPrompt && (mode !== 'reject-steer' || steers >= 2)) {
+ const { id, sid } = pendingPrompt
+ pendingPrompt = null
+ finishPrompt(id, sid)
+ }
+ } else if (msg.method === 'session/prompt') {
+ prompts += 1
+ const text = msg.params.prompt[0].text
+ if (mode === 'die-mid-turn') process.exit(17)
+ if (mode === 'session-gone' || (mode === 'session-gone-after-first' && prompts >= 2)) {
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ error: { code: -32603, message: 'Internal error', data: { details: 'ACP session not found: ' + msg.params.sessionId } },
+ })
+ return
+ }
+ if (mode === 'session-unsupported') {
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ error: { code: -32603, message: 'Internal error', data: { details: 'Unsupported ACP session: ' + msg.params.sessionId } },
+ })
+ return
+ }
+ if (mode === 'cancelled') {
+ send({ jsonrpc: '2.0', id: msg.id, result: { stopReason: 'cancelled' } })
+ return
+ }
+ if (mode === 'ask-permission' || mode === 'ask-permission-once' || mode === 'ask-permission-reject-only') {
+ pendingPrompt = { id: msg.id, sid: msg.params.sessionId }
+ const options = mode === 'ask-permission'
+ ? [
+ { optionId: 'opt-allow-once', name: 'Allow once', kind: 'allow_once' },
+ { optionId: 'opt-allow-always', name: 'Always allow', kind: 'allow_always' },
+ { optionId: 'opt-reject', name: 'Reject', kind: 'reject_once' },
+ ]
+ : mode === 'ask-permission-once'
+ ? [{ optionId: 'opt-allow-once', name: 'Allow once', kind: 'allow_once' }]
+ : [{ optionId: 'opt-reject', name: 'Reject', kind: 'reject_once' }]
+ // Reuse the pending prompt's id on purpose: a server->client request must be
+ // routed by method, never by id, or it would be taken as the prompt's answer.
+ send({
+ jsonrpc: '2.0',
+ id: msg.id,
+ method: 'session/request_permission',
+ params: {
+ sessionId: msg.params.sessionId,
+ toolCall: { toolCallId: 'tc-perm', title: 'npm test', kind: 'execute' },
+ options,
+ },
+ })
+ return
+ }
+ const sid = msg.params.sessionId
+ if ((mode === 'hold' || mode === 'reject-steer') && text === 'held turn') {
+ // Announce receipt through the turn's own chunk stream, then block until
+ // the steer arrives — the test waits on the log line, not on a clock.
+ send({
+ jsonrpc: '2.0',
+ method: 'session/update',
+ params: {
+ sessionId: sid,
+ update: { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: 'PROMPT_HELD' } },
+ },
+ })
+ pendingPrompt = { id: msg.id, sid }
+ return
+ }
+ if (mode === 'split-utf8') {
+ const frame = Buffer.from(
+ JSON.stringify({
+ jsonrpc: '2.0',
+ method: 'session/update',
+ params: {
+ sessionId: sid,
+ update: { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: '你好世界' } },
+ },
+ }) + '\n',
+ 'utf8',
+ )
+ // '你' is 0xe4 0xbd 0xa0 — split right after the first byte.
+ const cut = frame.indexOf(0xe4) + 1
+ process.stdout.write(frame.subarray(0, cut))
+ setTimeout(() => {
+ process.stdout.write(frame.subarray(cut))
+ send({ jsonrpc: '2.0', id: msg.id, result: { stopReason: 'end_turn' } })
+ }, 15)
+ return
+ }
+ finishPrompt(msg.id, sid)
+ }
+})
+`
+
+interface Fixture {
+ home: string
+ env: NodeJS.ProcessEnv
+ /** Pass as onLog so waitForLog() sees the adapter's own output. */
+ log: (line: string) => void
+ lines: string[]
+ /** Resolves once the adapter has logged a line containing `needle`. */
+ waitForLog: (needle: string) => Promise<void>
+ readCalls: () => Promise<Array<{ argv?: string[]; id?: number; method?: string; params?: Record<string, unknown>; result?: Record<string, unknown> }>>
+}
+
+async function makeFixture(mode = 'ok'): Promise<Fixture> {
+ const root = await mkdtemp(join(tmpdir(), 'cumora-omp-'))
+ tempDirs.push(root)
+ const home = join(root, 'home')
+ await mkdir(home, { recursive: true })
+ const bridge = join(root, 'fake-omp.mjs')
+ const logFile = join(root, 'calls.jsonl')
+ await writeFile(bridge, FAKE_OMP_ACP_SOURCE, 'utf8')
+ const lines: string[] = []
+ const waiting = new Set<() => void>()
+ const log = (line: string) => {
+ lines.push(line)
+ for (const check of waiting) check()
+ }
+ return {
+ home,
+ log,
+ lines,
+ waitForLog: (needle) => new Promise<void>((resolve) => {
+ const check = () => {
+ if (!lines.some((line) => line.includes(needle))) return
+ waiting.delete(check)
+ resolve()
+ }
+ waiting.add(check)
+ check()
+ }),
+ env: {
+ ...process.env,
+ CUMORA_OMP_BIN: bridge,
+ FAKE_OMP_LOG: logFile,
+ FAKE_OMP_MODE: mode,
+ },
+ readCalls: async () => {
+ const raw = await readFile(logFile, 'utf8').catch(() => '')
+ return raw.trim().split('\n').filter(Boolean).map((l) => JSON.parse(l))
+ },
+ }
+}
+
+function startOmpSession(f: Fixture, overrides: Partial<Omit<EngineSessionArgs, 'home' | 'env'>> = {}) {
+ const session = getAdapter('omp').startSession?.({
+ home: f.home,
+ env: f.env,
+ standingPrompt: null,
+ resumeSessionId: null,
+ onLog: () => {},
+ ...overrides,
+ })
+ assert.ok(session)
+ liveSessions.push(session)
+ return session
+}
+
+afterEach(async () => {
+ for (const s of liveSessions.splice(0)) {
+ try { await s.stop() } catch { /* already gone */ }
+ }
+ await Promise.all(tempDirs.splice(0).map((d) => rm(d, { recursive: true, force: true })))
+})
+
+test('omp wake spawns `omp acp` and triage spawns `omp acp --no-tools --no-session`', async () => {
+ const f = await makeFixture()
+ const adapter = getAdapter('omp')
+ const signal = AbortSignal.timeout(10_000)
+
+ const session = startOmpSession(f)
+ await session.send('wake turn')
+ await session.stop()
+
+ const classified = await adapter.classify({ cwd: f.home, env: f.env, prompt: 'Actionable?', signal })
+ assert.equal(classified.error, undefined)
+ assert.equal(classified.text, 'pong #1')
+
+ const calls = await f.readCalls()
+ assert.deepEqual(calls[0]?.argv, ['acp'], 'a wake runs omp with FULL tools')
+ assert.deepEqual(calls[calls.length - 1]?.argv, ['acp', '--no-tools', '--no-session'], 'triage is the no-tool surface')
+})
+
+test('omp orders initialize → session/new → pin → prompt and pins once across wakes', async () => {
+ const f = await makeFixture()
+ const logs: string[] = []
+ const hops: EngineHopReport[] = []
+ const session = startOmpSession(f, {
+ model: 'magpie/auto/dfmodel',
+ standingPrompt: 'ignored by omp over ACP',
+ onLog: (l) => logs.push(l),
+ onHopUsage: (h) => hops.push(h),
+ })
+ assert.equal(session.carriesStandingPrompt, false, 'omp does not deliver --append-system-prompt over ACP')
+
+ const r1 = await session.send('first wake')
+ const r2 = await session.send('second wake')
+
+ assert.equal(r1.exitCode, 0)
+ assert.equal(r2.exitCode, 0)
+ assert.equal(r1.sessionId, 'omp-sess-fresh')
+ assert.equal(r2.sessionId, 'omp-sess-fresh')
+ assert.equal(r1.model, 'magpie/auto/dfmodel')
+ assert.equal(hops.length, 2)
+ assert.equal(hops[0]?.model, 'magpie/auto/dfmodel')
+ assert.ok(logs.some((l) => l.includes('[omp] tool Read README.md')))
+ assert.ok(logs.some((l) => l.includes('pong #1')))
+ assert.ok(logs.some((l) => l.includes('pong #2')))
+
+ const calls = await f.readCalls()
+ assert.deepEqual(
+ calls.map((c) => c.method),
+ ['initialize', 'session/new', 'session/set_config_option', 'session/prompt', 'session/prompt'],
+ )
+ assert.deepEqual(calls[2]?.params, {
+ sessionId: 'omp-sess-fresh',
+ configId: 'model',
+ value: 'magpie/auto/dfmodel',
+ })
+ assert.equal(
+ calls.some((c) => c.method === 'session/set_config_option' && c.params?.configId !== 'model'),
+ false,
+ 'omp exposes no permission_mode option — nothing else may be pinned',
+ )
+})
+
+test('omp keeps the turn alive when the model pin is rejected and never retries it', async () => {
+ const f = await makeFixture('reject-pin')
+ const logs: string[] = []
+ const session = startOmpSession(f, {
+ model: 'unknown/selector',
+ onLog: (l) => logs.push(l),
+ })
+
+ const r1 = await session.send('first wake')
+ const r2 = await session.send('second wake')
+
+ assert.equal(r1.exitCode, 0, 'an unknown pin is a preference loss, not a turn failure')
+ assert.equal(r1.model, '<omp-default>', 'a rejected pin must not be reported as the active model')
+ assert.equal(r2.exitCode, 0)
+ assert.ok(logs.some((l) => l.includes('[omp] model pin (unknown/selector) rejected') && l.includes('engine default')))
+ const pins = (await f.readCalls()).filter((c) => c.method === 'session/set_config_option')
+ assert.equal(pins.length, 1, 'ONE pin attempt per session process')
+})
+
+test('omp attaches with session/load so the transcript replays, and replay stays out of the turn', async () => {
+ const f = await makeFixture('replay-on-load')
+ const logs: string[] = []
+ const session = startOmpSession(f, {
+ model: 'deepseek/deepseek-v4-pro',
+ resumeSessionId: 'omp-sess-existing',
+ onLog: (l) => logs.push(l),
+ })
+
+ const r = await session.send('wake after load')
+ assert.equal(r.exitCode, 0)
+ assert.equal(r.sessionId, 'omp-sess-existing')
+ assert.ok(!logs.some((l) => l.includes('STALE_REPLAY_TEXT')), 'replayed history must not be reported as this turn')
+ assert.ok(logs.some((l) => l.includes('pong #1')))
+
+ const calls = await f.readCalls()
+ assert.deepEqual(
+ calls.map((c) => c.method),
+ ['initialize', 'session/load', 'session/set_config_option', 'session/prompt'],
+ 'the pin lands after the attach and before the turn',
+ )
+})
+
+test('omp classifies both missing-session wordings as resume-not-found, ungated on wasResume', async () => {
+ // `ACP session not found` — the attach wording, surfaced from data.details.
+ const gone = await makeFixture('session-gone')
+ const onGone = startOmpSession(gone, {
+ resumeSessionId: 'omp-sess-stale',
+ })
+ const rGone = await onGone.send('turn on a dead session')
+ assert.equal(rGone.exitCode, 1)
+ assert.equal(rGone.failure?.kind, 'resume-not-found')
+ assert.match(rGone.error ?? '', /ACP session not found/i, 'the cause must survive rpc() rejection, not just "Internal error"')
+
+ // `Unsupported ACP session` — the live-call wording.
+ const unsupported = await makeFixture('session-unsupported')
+ const onUnsupported = startOmpSession(unsupported, {
+ resumeSessionId: 'omp-sess-stale',
+ })
+ const rUnsupported = await onUnsupported.send('turn on an unsupported session')
+ assert.equal(rUnsupported.failure?.kind, 'resume-not-found')
+
+ // A session that disappears AFTER a successful turn still recovers.
+ const afterFirst = await makeFixture('session-gone-after-first')
+ const onAfterFirst = startOmpSession(afterFirst, {
+ resumeSessionId: 'omp-sess-existing',
+ })
+ assert.equal((await onAfterFirst.send('first turn')).exitCode, 0)
+ assert.equal((await onAfterFirst.send('second turn')).failure?.kind, 'resume-not-found')
+})
+
+test('omp self-heals a stale session/load at handshake time via session/new', async () => {
+ const f = await makeFixture('fail-load')
+ const logs: string[] = []
+ const session = startOmpSession(f, {
+ resumeSessionId: 'omp-sess-stale',
+ onLog: (l) => logs.push(l),
+ })
+
+ const r = await session.send('after stale load')
+ assert.equal(r.exitCode, 0)
+ assert.equal(r.sessionId, 'omp-sess-fresh')
+ assert.ok(logs.some((l) => l.includes('session/load failed') && l.includes('fresh session')))
+
+ const calls = await f.readCalls()
+ assert.deepEqual(calls.slice(0, 3).map((c) => c.method), ['initialize', 'session/load', 'session/new'])
+})
+
+test('omp auto-answers session/request_permission preferring allow_always, then allow_once, then cancels', async () => {
+ const cases: Array<[string, unknown]> = [
+ ['ask-permission', { outcome: { outcome: 'selected', optionId: 'opt-allow-always' } }],
+ ['ask-permission-once', { outcome: { outcome: 'selected', optionId: 'opt-allow-once' } }],
+ ['ask-permission-reject-only', { outcome: { outcome: 'cancelled' } }],
+ ]
+ for (const [mode, expected] of cases) {
+ const f = await makeFixture(mode)
+ const session = startOmpSession(f)
+
+ const r = await session.send('do something requiring permission')
+ assert.equal(r.exitCode, 0, mode)
+
+ const calls = await f.readCalls()
+ const promptCall = calls.find((c) => c.method === 'session/prompt')
+ const reply = calls.find((c) => c.id === promptCall?.id && !c.method)
+ assert.equal(reply?.id, promptCall?.id, mode)
+ assert.deepEqual(reply?.result, expected, mode)
+ await session.stop()
+ }
+})
+
+test('omp treats stopReason=cancelled as a failed turn instead of success', async () => {
+ const f = await makeFixture('cancelled')
+ const hops: EngineHopReport[] = []
+ const session = startOmpSession(f, {
+ onHopUsage: (h) => hops.push(h),
+ })
+
+ const r = await session.send('fail with cancelled stopReason')
+ assert.equal(r.exitCode, 1)
+ assert.match(r.error ?? '', /cancelled/i)
+ assert.equal(hops.length, 0)
+})
+
+test('omp steer injects mid-turn via _session/steering and no-ops while idle', async () => {
+ const f = await makeFixture('hold')
+ const session = startOmpSession(f, {
+ onLog: f.log,
+ })
+
+ // Before any turn: nothing to inject into, and no RPC may be attempted.
+ session.steer('too early')
+ assert.equal((await f.readCalls()).filter((c) => c.method === '_session/steering').length, 0, 'an idle steer is a no-op')
+
+ const turn = session.send('held turn')
+ await f.waitForLog('PROMPT_HELD')
+ session.steer('answer the ping first')
+ const result = await turn
+ assert.equal(result.exitCode, 0, 'a steer must not cancel the in-flight turn')
+
+ const steerCall = (await f.readCalls()).find((c) => c.method === '_session/steering')
+ assert.deepEqual(steerCall?.params, {
+ sessionId: 'omp-sess-fresh',
+ prompt: [{ type: 'text', text: 'answer the ping first' }],
+ _meta: { steering: { queue: 'steering' } },
+ })
+})
+
+test('omp swallows a rejected steer and logs it once', async () => {
+ const f = await makeFixture('reject-steer')
+ const session = startOmpSession(f, {
+ onLog: f.log,
+ })
+
+ const held = session.send('held turn')
+ await f.waitForLog('PROMPT_HELD')
+ session.steer('first rejected steer')
+ await f.waitForLog('[omp] steer rejected')
+ session.steer('second rejected steer')
+
+ const result = await held
+ assert.equal(result.exitCode, 0, 'a rejected steer never fails the turn')
+ assert.equal(f.lines.filter((l) => l.includes('[omp] steer rejected')).length, 1, 'warn once per session')
+})
+
+test('omp process dying MID-TURN resolves the turn as a failure, never rejects', async () => {
+ const f = await makeFixture('die-mid-turn')
+ const session = startOmpSession(f)
+
+ const r = await session.send('crash now')
+ assert.equal(r.exitCode, 17)
+ assert.match(r.error ?? '', /exited with code 17/)
+ assert.equal(session.alive, false)
+})
+
+test('omp seedHome writes the AGENTS.md and .agents/skills that omp actually loads', async () => {
+ const f = await makeFixture()
+ const adapter = getAdapter('omp')
+ await adapter.seedHome(f.home, {
+ id: 'agent-omp',
+ name: 'omp Engineer',
+ role: 'engineer',
+ systemPrompt: 'Follow first principles.',
+ })
+ const agentsMd = await readFile(join(f.home, 'AGENTS.md'), 'utf8')
+ assert.match(agentsMd, /omp Engineer/)
+ assert.match(agentsMd, /\.agents\/skills\//)
+ assert.equal((await stat(join(f.home, '.agents', 'skills'))).isDirectory(), true)
+})
+
+test('omp probeWake exercises the acp handshake and one-shot run forwards resumeSessionId', async () => {
+ const f = await makeFixture()
+ const adapter = getAdapter('omp')
+ const controller = new AbortController()
+
+ const wake = await adapter.probeWake({ cwd: f.home, env: f.env, signal: controller.signal })
+ assert.equal(wake.ok, true, 'the wake path IS omp acp on every platform, so it is never skipped')
+
+ const oneShot = await adapter.run({
+ home: f.home,
+ env: f.env,
+ prompt: 'say pong',
+ resumeSessionId: 'omp-sess-resumed-run',
+ signal: controller.signal,
+ onLog: () => {},
+ })
+ assert.equal(oneShot.exitCode, 0)
+ assert.equal(oneShot.sessionId, 'omp-sess-resumed-run')
+
+ const calls = await f.readCalls()
+ assert.ok(
+ calls.some((c) => c.method === 'session/load' && c.params?.sessionId === 'omp-sess-resumed-run'),
+ 'OmpAdapter.run must forward resumeSessionId to session/load',
+ )
+
+ const probed = await adapter.probe({ cwd: f.home, env: f.env, tier: 'big', signal: controller.signal })
+ assert.equal(probed.text, 'pong #1')
+ assert.deepEqual((await f.readCalls()).at(-1)?.argv, ['acp', '--no-tools', '--no-session'])
+})
+
+test('omp resolves no bin when only another engine is on PATH and reports a failed handshake', async () => {
+ const root = await mkdtemp(join(tmpdir(), 'cumora-omp-path-'))
+ tempDirs.push(root)
+ const binDir = join(root, 'bin')
+ await mkdir(binDir, { recursive: true })
+ const other = join(binDir, process.platform === 'win32' ? 'maka.cmd' : 'maka')
+ await writeFile(other, '#!/bin/sh\nexit 0\n', 'utf8')
+ await chmod(other, 0o755)
+
+ assert.equal(resolveOmpBin({ PATH: binDir }), null)
+
+ // A pinned-but-broken entry is the deterministic failure: probing PATH would
+ // find whatever omp the DEVELOPER has installed, which is not this test's subject.
+ const controller = new AbortController()
+ const wake = await getAdapter('omp').probeWake({
+ cwd: root,
+ env: { ...process.env, CUMORA_OMP_BIN: join(root, 'missing-omp.mjs') },
+ signal: controller.signal,
+ })
+ assert.equal(wake.ok, false)
+ assert.match(wake.detail ?? '', /omp acp handshake failed/)
+})
+
+test('omp extracts the ACP camelCase usage fields', async () => {
+ const f = await makeFixture('with-usage')
+ const hops: EngineHopReport[] = []
+ const session = startOmpSession(f, {
+ onHopUsage: (h) => hops.push(h),
+ })
+
+ const r = await session.send('turn with usage')
+ assert.equal(r.exitCode, 0)
+ assert.deepEqual(r.usage, {
+ input_tokens: 110,
+ output_tokens: 15,
+ cache_read_input_tokens: 30,
+ cache_creation_input_tokens: 10,
+ })
+ assert.equal(hops.length, 1)
+ assert.deepEqual(hops[0]?.usage, r.usage)
+})
+
+test('omp decodes multi-byte UTF-8 split across stdout chunks without replacement characters', async () => {
+ const f = await makeFixture('split-utf8')
+ const controller = new AbortController()
+ const classified = await getAdapter('omp').classify({
+ cwd: f.home,
+ env: f.env,
+ prompt: 'say hello in Chinese',
+ signal: controller.signal,
+ })
+ assert.equal(classified.error, undefined)
+ assert.equal(classified.text, '你好世界')
+ assert.ok(!classified.text.includes('\uFFFD'))
+})
diff --git a/server/src/__tests__/agents-computer-model-catalog.test.ts b/server/src/__tests__/agents-computer-model-catalog.test.ts
index 2887e2e..f1de368 100644
--- a/server/src/__tests__/agents-computer-model-catalog.test.ts
+++ b/server/src/__tests__/agents-computer-model-catalog.test.ts
@@ -9,7 +9,7 @@ import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { readClaudeUserSettings, withClaudeUserSettingsEnv } from '../agents/computer/claude-user-settings.js'
-import { clearModelCatalogCache, discoverEngineModelCatalog, parseListedModels } from '../agents/computer/model-catalog.js'
+import { clearModelCatalogCache, discoverEngineModelCatalog, parseListedModels, parseOmpModels } from '../agents/computer/model-catalog.js'
// Metadata probes must never share the developer's real Codex home/login.
const isolatedHome = await mkdtemp(join(tmpdir(), 'cumora-catalog-home-'))
@@ -336,3 +336,63 @@ test('an engine with a preset keeps it when its CLI fails to list', async () =>
await cleanup()
}
})
+
+/** Cross-platform omp stand-in: the binary prints `payload` whatever the argv,
+ * which is all discovery reads. */
+async function stubOmpListing(payload: string): Promise<{ bin: string; cleanup: () => Promise<void> }> {
+ const root = await mkdtemp(join(tmpdir(), 'cumora-omp-listing-'))
+ const script = join(root, 'models.mjs')
+ const bin = join(root, process.platform === 'win32' ? 'omp.cmd' : 'omp')
+ await writeFile(script, `process.stdout.write(${JSON.stringify(payload)})\n`)
+ await writeFile(bin, process.platform === 'win32'
+ ? `@echo off\r\n"${process.execPath}" "%~dp0models.mjs" %*\r\n`
+ : `#!/bin/sh\nexec "${process.execPath}" "${script}" "$@"\n`, { mode: 0o755 })
+ return { bin, cleanup: () => rm(root, { recursive: true, force: true }) }
+}
+
+test('omp catalog keys rows on the provider-qualified selector and drops non-chat entries', async () => {
+ // The bare `id` is provider-relative; pinning it silently no-ops, so a parser
+ // that takes `id` would produce a picker whose every choice does nothing.
+ const payload = JSON.stringify({
+ models: [
+ { provider: 'magpie', kind: 'chat', id: 'auto/dfmodel', selector: 'magpie/auto/dfmodel', name: 'magpie/auto/dfmodel' },
+ { provider: 'deepseek', kind: 'chat', id: 'deepseek-v4-flash', selector: 'deepseek/deepseek-v4-flash', name: 'DeepSeek V4 Flash' },
+ { provider: 'openai', kind: 'embedding', id: 'embed', selector: 'openai/embed', name: 'Embeddings' },
+ { provider: 'deepseek', kind: 'chat', id: 'deepseek-v4-flash', selector: 'deepseek/deepseek-v4-flash', name: 'DeepSeek V4 Flash' },
+ ],
+ })
+ assert.deepEqual(parseOmpModels(payload), [
+ { id: 'magpie/auto/dfmodel', label: 'magpie/auto/dfmodel', description: null, recommendedFor: undefined },
+ { id: 'deepseek/deepseek-v4-flash', label: 'DeepSeek V4 Flash', description: null, recommendedFor: undefined },
+ ])
+
+ const { bin, cleanup } = await stubOmpListing(payload)
+ try {
+ clearModelCatalogCache()
+ const catalog = await discoverEngineModelCatalog('omp', bin, true)
+ assert.equal(catalog.source, 'cli')
+ assert.equal(catalog.trustedModels, true)
+ assert.equal(catalog.supportsCustom, true)
+ assert.equal(catalog.fastModelScope, 'agent')
+ assert.deepEqual(catalog.models.map((model) => model.id), ['magpie/auto/dfmodel', 'deepseek/deepseek-v4-flash'])
+ } finally {
+ clearModelCatalogCache()
+ await cleanup()
+ }
+})
+
+test('omp discovery falls back to its preset on an empty or non-JSON listing', async () => {
+ for (const payload of ['{"models":[]}', 'not json at all', '']) {
+ const { bin, cleanup } = await stubOmpListing(payload)
+ try {
+ clearModelCatalogCache()
+ const catalog = await discoverEngineModelCatalog('omp', bin, true)
+ assert.equal(catalog.source, 'presets', payload)
+ assert.deepEqual(catalog.models, [], payload)
+ assert.equal(catalog.trustedModels, undefined, payload)
+ } finally {
+ clearModelCatalogCache()
+ await cleanup()
+ }
+ }
+})
diff --git a/server/src/agents/computer/cli-version.ts b/server/src/agents/computer/cli-version.ts
index 47d5384..5571b29 100644
--- a/server/src/agents/computer/cli-version.ts
+++ b/server/src/agents/computer/cli-version.ts
@@ -140,6 +140,11 @@ export const ENGINE_VERSION_SPECS: Record<string, EngineVersionSpec> = {
versionArgs: ['--version'],
selfUpdate: 'maka update --target latest',
},
+ omp: {
+ versionArgs: ['--version'],
+ npm: '@oh-my-pi/pi-coding-agent',
+ selfUpdate: 'omp update',
+ },
hermes: {
versionArgs: ['version'],
selfUpdate: 'hermes update',
diff --git a/server/src/agents/computer/daemon.ts b/server/src/agents/computer/daemon.ts
index 61c2bee..4073709 100644
--- a/server/src/agents/computer/daemon.ts
+++ b/server/src/agents/computer/daemon.ts
@@ -861,6 +861,9 @@ export function authFailureHint(engine: EngineId, detail: string): string {
if (engine === 'maka') {
return 'Open Maka on that computer and run `maka` to refresh its login, model access, or quota, then wake the agent again.'
}
+ if (engine === 'omp') {
+ return 'Open a terminal on that computer and run `omp` (or `omp login`) to refresh its provider credentials, then wake the agent again.'
+ }
return 'Check the daemon terminal for details, then wake the agent again.'
}
@@ -884,6 +887,7 @@ function missingEngineMessage(): string {
' (the daemon drives it through the npm-published `zcode-acp-server` bridge via npx;',
' CUMORA_ZCODE_ACP_BIN pins a specific bridge copy when needed)',
' - Maka: install the `maka` CLI, then run `maka` once to sign in',
+ ' - omp: install the `omp` CLI, then run `omp` once to sign in to a provider',
'',
'After that, rerun:',
' npx cumora@latest agent computer --pair <code>',
@@ -2528,6 +2532,7 @@ export class AgentRunner {
if (this.adapter.id === 'antigravity') return this.agent.model ?? 'gemini-3.8-flash-high'
if (this.adapter.id === 'zcode') return this.agent.model ?? '<zcode-default>'
if (this.adapter.id === 'maka') return '<maka-default>'
+ if (this.adapter.id === 'omp') return this.agent.model ?? '<omp-default>'
if (this.adapter.id === 'cursor') return this.agent.model ?? '<cursor-default>'
return this.agent.model ?? '<cursor-default>'
}
diff --git a/server/src/agents/computer/engine.ts b/server/src/agents/computer/engine.ts
index 241f921..9b43496 100644
--- a/server/src/agents/computer/engine.ts
+++ b/server/src/agents/computer/engine.ts
@@ -322,10 +322,10 @@ const CODEX_LOG_RAW = process.env.CUMORA_CODEX_VERBOSE === '1'
* `shell:true` when nothing else is on PATH. */
// Exported for tests; the nvm-windows extensionless-shim regression (issue #5)
// needs a stable handle to the resolver without going through spawn().
-export function resolveSpawn(bin: string): { command: string; shell: boolean; wantsStdinPrompt: boolean } {
+export function resolveSpawn(bin: string, env: NodeJS.ProcessEnv = process.env): { command: string; shell: boolean; wantsStdinPrompt: boolean } {
if (!IS_WIN) return { command: bin, shell: false, wantsStdinPrompt: false }
- const exts = (process.env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').map((e) => e.trim()).filter(Boolean)
- for (const dir of (process.env.PATH ?? '').split(PATH_DELIMITER)) {
+ const exts = (env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').map((e) => e.trim()).filter(Boolean)
+ for (const dir of (env.PATH ?? '').split(PATH_DELIMITER)) {
if (!dir) continue
for (const ext of exts) {
const candidate = join(dir, bin + ext)
@@ -342,7 +342,7 @@ export function resolveSpawn(bin: string): { command: string; shell: boolean; wa
// itself is a `#!/bin/sh` wrapper and cannot be exec'd without a shell → force
// shell:true so Node routes the call through cmd.exe, which can find the
// .cmd via PATHEXT after the shim.
- for (const dir of (process.env.PATH ?? '').split(PATH_DELIMITER)) {
+ for (const dir of (env.PATH ?? '').split(PATH_DELIMITER)) {
if (!dir) continue
const shim = join(dir, bin)
if (existsSync(shim)) {
@@ -394,10 +394,10 @@ export async function loginCodexRuntime(): Promise<void> {
})
}
-export type EngineId = 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka'
+export type EngineId = 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka' | 'omp'
/** The pairable engine ids, in the daemon's default detection order. */
-export const ENGINE_IDS: EngineId[] = ['claude', 'codex', 'grok', 'cursor', 'opencode', 'pi', 'gemini', 'qwen', 'antigravity', 'zcode', 'maka']
+export const ENGINE_IDS: EngineId[] = ['claude', 'codex', 'grok', 'cursor', 'opencode', 'pi', 'gemini', 'qwen', 'antigravity', 'zcode', 'maka', 'omp']
/** Engines for which Cumora can impose a fail-closed filesystem + tool-network
* boundary non-interactively. The remaining adapters still work for operators
@@ -2573,10 +2573,21 @@ type AcpMsg = {
id?: number
method?: string
result?: { sessionId?: unknown }
- error?: { message?: unknown }
+ // omp answers a real cause with a generic `Internal error` and puts the cause
+ // in `data.details` (e.g. "ACP session not found: <id>").
+ error?: { message?: unknown; data?: { details?: unknown } }
params?: Record<string, unknown>
}
+/** Operator-facing text for a JSON-RPC rejection. `data.details` carries the
+ * actual cause on agents that answer every failure with a generic message;
+ * appending it is additive, so adapters keyed on the plain message still match. */
+function acpErrorMessage(error: AcpMsg['error'], method: string): string {
+ const message = typeof error?.message === 'string' && error.message ? error.message : `${method} failed`
+ const details = error?.data?.details
+ return typeof details === 'string' && details.trim() ? `${message} — ${details}` : message
+}
+
/** Persistent Grok Build session over ACP stdio (`grok agent --always-approve stdio`).
* Handshake: initialize → session/new|load → session/prompt per wake.
* Mid-turn steer is not in the ACP surface Grok exposes — steer() is a no-op
@@ -3135,7 +3146,7 @@ class AcpRpcConnection {
const id = ++this.reqId
return new Promise<AcpMsg>((resolve, reject) => {
this.waiters.set(id, (msg) => {
- if (msg.error) reject(new Error(String(msg.error.message || `${method} failed`)))
+ if (msg.error) reject(new Error(acpErrorMessage(msg.error, method)))
else resolve(msg)
})
writeStdin(this.child, JSON.stringify({ jsonrpc: '2.0', id, method, params }) + '\n')
@@ -3500,7 +3511,7 @@ function resolveMakaAcpSpawn(env: NodeJS.ProcessEnv): { command: string; args: s
const explicit = env.CUMORA_MAKA_BIN?.trim()
if (explicit) {
if (/\.[cm]?js$/i.test(explicit)) return { command: process.execPath, args: [explicit, '--acp'], shell: false }
- const sp = resolveSpawn(explicit)
+ const sp = resolveSpawn(explicit, env)
return { command: sp.command, args: ['--acp'], shell: sp.shell }
}
const sp = resolveSpawn(resolveMakaBin(env) ?? 'maka')
@@ -3799,6 +3810,367 @@ class MakaAdapter implements EngineAdapter {
}
}
+// ─── omp ──────────────────────────────────────────────────────────────────
+//
+// omp (the `omp` CLI, `omp acp`) is an ACP v1 agent server over stdio:
+// initialize → session/load (or session/new) → model pin → session/prompt per
+// wake. Triage rides the SAME lifecycle with `--no-tools --no-session`
+// appended — measured ~3.3s against `omp -p`'s 12–16s, and tool-free by
+// construction, one code path instead of a second parser. `omp acp` reads
+// AGENTS.md and .agents/skills from the session cwd natively; its
+// `--append-system-prompt` is NOT delivered over ACP, so
+// carriesStandingPrompt stays false and the daemon inlines the standing
+// prompt per wake (the Cursor/OpenCode contract).
+
+/** Resolve `CUMORA_OMP_BIN` or `omp` on `env.PATH`. */
+export function resolveOmpBin(env: NodeJS.ProcessEnv = process.env): string | null {
+ const explicit = env.CUMORA_OMP_BIN?.trim()
+ if (explicit) return explicit
+ for (const dir of (env.PATH ?? '').split(PATH_DELIMITER)) {
+ if (!dir) continue
+ const candidate = join(dir, IS_WIN ? 'omp.cmd' : 'omp')
+ if (existsSync(candidate)) return candidate
+ if (IS_WIN && existsSync(join(dir, 'omp.exe'))) return join(dir, 'omp.exe')
+ if (IS_WIN && existsSync(join(dir, 'omp'))) return join(dir, 'omp')
+ }
+ return null
+}
+
+/** Locate the `omp acp` spawn command. `extraArgs` is what separates a wake
+ * (full tools) from triage (`--no-tools --no-session`). */
+function resolveOmpAcpSpawn(env: NodeJS.ProcessEnv, extraArgs: string[]): { command: string; args: string[]; shell: boolean } {
+ const explicit = env.CUMORA_OMP_BIN?.trim()
+ if (explicit) {
+ if (/\.[cm]?js$/i.test(explicit)) return { command: process.execPath, args: [explicit, 'acp', ...extraArgs], shell: false }
+ const sp = resolveSpawn(explicit, env)
+ return { command: sp.command, args: ['acp', ...extraArgs], shell: sp.shell }
+ }
+ const sp = resolveSpawn(resolveOmpBin(env) ?? 'omp', env)
+ return { command: sp.command, args: ['acp', ...extraArgs], shell: sp.shell }
+}
+
+interface OmpTurnOptions {
+ cwd: string
+ env: NodeJS.ProcessEnv
+ prompt: string
+ model?: string | null
+ resumeSessionId?: string | null
+ signal: AbortSignal
+ onLog?: (line: string) => void
+ onHopUsage?: (r: EngineHopReport) => void
+ /** Stateless triage surface: `--no-tools --no-session`. */
+ noTools?: boolean
+}
+
+interface OmpSessionOptions extends EngineSessionArgs {
+ onAgentText?: (text: string) => void
+ signal?: AbortSignal
+ extraArgs?: string[]
+}
+
+/** omp names one failure two ways: `ACP session not found: <id>` when the
+ * attach misses, `Unsupported ACP session: <id>` from a live call on an id
+ * the engine no longer holds. Both ride `error.data.details`, which
+ * acpErrorMessage() surfaces into the classifier's input. */
+const OMP_MISSING_SESSION_RE = /acp session not found|unsupported acp session/i
+
+class OmpSession implements EngineSession {
+ readonly carriesStandingPrompt = false
+
+ private readonly conn: AcpRpcConnection
+ private readonly onLog: (line: string) => void
+ private readonly onHopUsage?: (r: EngineHopReport) => void
+ private readonly onAgentText?: (text: string) => void
+ private readonly model: string | null
+ private modelPinTried = false
+ private modelPinAccepted = false
+ private turn: { resolve: (r: EngineRunResult) => void } | null = null
+ private promptInFlight = false
+ private steerWarned = false
+ private stopped = false
+
+ constructor(home: string, env: NodeJS.ProcessEnv, opts: OmpSessionOptions) {
+ this.onLog = opts.onLog
+ this.onHopUsage = opts.onHopUsage
+ this.onAgentText = opts.onAgentText
+ this.model = opts.model ?? null
+ this.conn = new AcpRpcConnection(
+ resolveOmpAcpSpawn(env, opts.extraArgs ?? []),
+ home,
+ env,
+ opts.resumeSessionId ?? null,
+ () => ({ cwd: home, mcpServers: [] }),
+ {
+ onLog: (line) => this.onLog(line),
+ onNotification: (msg) => this.onUpdate(msg),
+ onDeath: (code, why) => this.onDeath(code, why),
+ onLoadFallback: (why) => {
+ this.onLog(`[omp] session/load failed (${why}) — starting a fresh session`)
+ },
+ },
+ opts.signal,
+ 'session/load',
+ )
+ }
+
+ get alive(): boolean { return this.conn.alive }
+ get sessionId(): string | null { return this.conn.sid }
+ whenReady(): Promise<void> { return this.conn.ready }
+
+ async send(prompt: string): Promise<EngineRunResult> {
+ if (this.turn) return classifyEngineResult({ exitCode: 1, error: 'engine session busy — a turn is already in flight', sessionId: this.conn.sid }, this.conn.resumed)
+ if (!this.alive) return classifyEngineResult({ exitCode: this.conn.exitStatusCode || 1, error: 'engine session is not alive (process gone)', sessionId: this.conn.sid }, this.conn.resumed)
+ let resolveTurn!: (r: EngineRunResult) => void
+ const done = new Promise<EngineRunResult>((resolve) => { resolveTurn = resolve })
+ let settled = false
+ const settle = (r: EngineRunResult) => { if (!settled) { settled = true; this.turn = null; resolveTurn(r) } }
+ this.turn = { resolve: settle }
+ try {
+ await this.conn.ready
+ await this.applyModelPin()
+ if (!this.alive) throw new Error('engine session is not alive (process gone)')
+ const wasResume = this.conn.resumed
+ const startedAt = Date.now()
+ this.promptInFlight = true
+ const resp = await this.conn.rpc('session/prompt', {
+ sessionId: this.conn.sid,
+ prompt: [{ type: 'text', text: stripLoneSurrogates(prompt) }],
+ })
+ this.conn.resumed = false
+ const stopReason = (resp.result as { stopReason?: unknown } | undefined)?.stopReason
+ if (stopReason === 'cancelled') {
+ settle(this.failureResult('omp turn was cancelled', wasResume, 1))
+ return done
+ }
+ const usage = extractAcpUsage(resp.result) ?? undefined
+ const model = this.model && this.modelPinAccepted ? this.model : '<omp-default>'
+ if (this.onHopUsage) {
+ try {
+ this.onHopUsage({
+ model,
+ usage,
+ latencyMs: Date.now() - startedAt,
+ hopIndex: 1,
+ })
+ } catch { /* never break the stream */ }
+ }
+ settle(classifyEngineResult({ exitCode: 0, sessionId: this.conn.sid, usage, model }, wasResume))
+ } catch (err) {
+ const message = err instanceof Error ? err.message : String(err)
+ const wasResume = this.conn.resumed
+ this.conn.resumed = false
+ settle(this.failureResult(message, wasResume, this.conn.exitStatusCode || 1))
+ } finally {
+ this.promptInFlight = false
+ }
+ return done
+ }
+
+ steer(text: string): void {
+ // Idle means nothing to inject into: omp answers `{outcome:'promptRequired'}`,
+ // and the daemon's next wake already carries the ping.
+ if (!this.promptInFlight || !this.conn.sid) return
+ void this.conn.rpc('_session/steering', {
+ sessionId: this.conn.sid,
+ prompt: [{ type: 'text', text: stripLoneSurrogates(text) }],
+ _meta: { steering: { queue: 'steering' } },
+ }).catch((err: unknown) => {
+ // Steering is an optional extension: an older omp rejects the method, and
+ // an inject that loses the race to the turn's end changes nothing. Either
+ // way the coalesced rerun is the backstop, so warn once and stop shouting.
+ if (this.steerWarned) return
+ this.steerWarned = true
+ this.log(`[omp] steer rejected (${err instanceof Error ? err.message : String(err)}) — the ping rides the next wake`)
+ })
+ }
+
+ async stop(options: { force?: boolean } = {}): Promise<void> {
+ this.stopped = true
+ await this.conn.stop(options)
+ }
+
+ /** ONE attempt per session process. A rejection is a preference loss, not a
+ * turn failure: omp answers an unknown selector with `Unknown ACP model` and
+ * the following prompt still runs on the engine default. */
+ private async applyModelPin(): Promise<void> {
+ if (this.modelPinTried || !this.model || !this.conn.sid) return
+ this.modelPinTried = true
+ try {
+ await this.conn.rpc('session/set_config_option', { sessionId: this.conn.sid, configId: 'model', value: this.model })
+ this.modelPinAccepted = true
+ } catch (err) {
+ const why = err instanceof Error ? err.message : String(err)
+ this.log(`[omp] model pin (${this.model}) rejected (${why}) — continuing on the engine default`)
+ }
+ }
+
+ private failureResult(message: string, wasResume: boolean, exitCode = 1): EngineRunResult {
+ // omp's wording is unambiguous, so it classifies whether or not this turn
+ // began as a resume: a session can also disappear AFTER a successful turn,
+ // and gating on `resumed` would leave the connection on a stale id.
+ const missingSession = OMP_MISSING_SESSION_RE.test(message)
+ return classifyEngineResult({
+ exitCode,
+ error: message,
+ failure: missingSession
+ ? { kind: 'resume-not-found', message, diagnostic: message }
+ : undefined,
+ sessionId: this.conn.sid,
+ }, wasResume)
+ }
+
+ private onDeath(code: number, why: string): void {
+ if (!this.stopped) {
+ this.log(`[session] engine process died ${this.turn ? 'MID-TURN' : 'while idle'}: ${why} (exit ${code})`)
+ }
+ const wasResume = this.conn.resumed
+ this.conn.resumed = false
+ this.turn?.resolve(this.failureResult(why, wasResume, code))
+ }
+
+ private onUpdate(msg: AcpMsg): void {
+ if (msg.method === 'session/request_permission' && msg.id !== undefined) {
+ const options = Array.isArray(msg.params?.options)
+ ? msg.params.options as Array<{ optionId?: unknown; kind?: unknown }>
+ : []
+ const preferred = options.find((o) => o?.kind === 'allow_always')
+ ?? options.find((o) => o?.kind === 'allow_once')
+ if (typeof preferred?.optionId === 'string' && preferred.optionId) {
+ this.conn.reply(msg.id, { outcome: { outcome: 'selected', optionId: preferred.optionId } })
+ } else {
+ this.conn.reply(msg.id, { outcome: { outcome: 'cancelled' } })
+ }
+ return
+ }
+ // A session/load replays the prior transcript as agent_message_chunk
+ // notifications; only chunks of the turn we asked for are the turn's text.
+ if (msg.method !== 'session/update' || !this.promptInFlight) return
+ const u = (msg.params?.update ?? msg.params) as Record<string, unknown> | undefined
+ const kind = typeof u?.sessionUpdate === 'string' ? u.sessionUpdate : null
+ if (kind === 'tool_call' && typeof u?.title === 'string') {
+ this.log(`[omp] tool ${u.title}`)
+ } else if (kind === 'agent_message_chunk') {
+ const content = u?.content as { text?: unknown } | undefined
+ if (typeof content?.text === 'string' && content.text) {
+ this.onAgentText?.(content.text)
+ if (content.text.trim()) this.log(`[omp] » ${content.text.replace(/\s+/g, ' ').slice(0, 200)}`)
+ }
+ }
+ }
+
+ private log(line: string): void { this.onLog(line) }
+}
+
+/** One full omp lifecycle for the stateless paths (run/classify/probe): a fresh
+ * `omp acp`, one turn, tear-down. A missing binary or a rejected handshake is a
+ * failed TURN, not a thrown one, so callers keep their uniform error handling. */
+async function runOmpAcpTurn(opts: OmpTurnOptions): Promise<EngineRunResult & { text: string }> {
+ const chunks: string[] = []
+ const session = new OmpSession(opts.cwd, opts.env, {
+ home: opts.cwd,
+ env: opts.env,
+ model: opts.model,
+ standingPrompt: null,
+ resumeSessionId: opts.resumeSessionId ?? null,
+ onLog: opts.onLog ?? (() => {}),
+ onHopUsage: opts.onHopUsage,
+ onAgentText: (text) => chunks.push(text),
+ signal: opts.signal,
+ // `omp acp` persists a transcript even with `--no-session`, so triage leaves
+ // one behind per call. It stays in omp's own store on purpose: `omp gc`
+ // prunes that directory (retain-newest-per-cwd), and pointing --session-dir
+ // at a Cumora path would move the files out of reach of that sweep.
+ extraArgs: opts.noTools ? ['--no-tools', '--no-session'] : [],
+ })
+ try {
+ return { ...await session.send(opts.prompt), text: chunks.join('') }
+ } finally {
+ await session.stop({ force: true })
+ }
+}
+
+class OmpAdapter implements EngineAdapter {
+ readonly id = 'omp' as const
+ readonly bin = 'omp'
+
+ async seedHome(home: string, persona: EnginePersona): Promise<void> {
+ await ensureCommonHome(home)
+ // omp discovers project skills under .agents/skills/ in the session cwd and
+ // reads AGENTS.md from it — both measured against 18.12.6.
+ await mkdir(join(home, '.agents', 'skills'), { recursive: true })
+ await atomicAgentWrite(
+ join(home, 'AGENTS.md'),
+ PERSONA_HEADER(persona, { personaFile: 'AGENTS.md', skillsDir: '.agents/skills/' }),
+ )
+ }
+
+ run(args: EngineRunArgs): Promise<EngineRunResult> {
+ // Full tools: permissions raised mid-turn are auto-answered by OmpSession.
+ return runOmpAcpTurn({
+ cwd: args.home,
+ env: args.env,
+ prompt: args.prompt,
+ model: args.model,
+ resumeSessionId: args.resumeSessionId,
+ signal: args.signal,
+ onLog: args.onLog,
+ onHopUsage: args.onHopUsage,
+ })
+ }
+
+ startSession(args: EngineSessionArgs): EngineSession | null {
+ return new OmpSession(args.home, args.env, args)
+ }
+
+ classify(args: EngineClassifyArgs): Promise<EngineClassifyResult> {
+ return runOmpAcpTurn({
+ cwd: args.cwd,
+ env: args.env,
+ prompt: args.prompt,
+ model: args.model,
+ signal: args.signal,
+ onLog: args.onLog,
+ noTools: true,
+ })
+ }
+
+ probe(args: EngineProbeArgs): Promise<EngineClassifyResult> {
+ // Both tiers run the engine default: the catalog is the operator's own
+ // omp provider config, so there is no first-party cheap alias to pin.
+ return runOmpAcpTurn({
+ cwd: args.cwd,
+ env: args.env,
+ prompt: DOCTOR_PROMPT,
+ signal: args.signal,
+ noTools: true,
+ })
+ }
+
+ async probeWake(args: EngineWakeProbeArgs): Promise<EngineWakeProbeResult> {
+ // The wake path IS `omp acp` on every platform (JSON-RPC over the Windows
+ // .cmd shim works), so this probe is never skipped.
+ const session = new OmpSession(args.cwd, args.env, {
+ home: args.cwd,
+ env: args.env,
+ standingPrompt: null,
+ resumeSessionId: null,
+ onLog: () => {},
+ signal: args.signal,
+ })
+ try {
+ await session.whenReady()
+ return { ok: true, detail: '' }
+ } catch (err) {
+ const why = args.signal.aborted
+ ? 'aborted (timeout)'
+ : err instanceof Error ? err.message : String(err)
+ return { ok: false, detail: `omp acp handshake failed: ${why}`.slice(0, 240) }
+ } finally {
+ await session.stop({ force: true })
+ }
+ }
+}
+
// ─── cursor ───────────────────────────────────────────────────────────────
//
// Cursor Agent (the `cursor-agent` CLI bundled with Cursor, 2026.08.11-e8db854)
@@ -6302,6 +6674,7 @@ const ADAPTERS: Record<EngineId, EngineAdapter> = {
antigravity: new AntigravityAdapter(),
zcode: new ZcodeAdapter(),
maka: new MakaAdapter(),
+ omp: new OmpAdapter(),
}
export function getAdapter(id: EngineId): EngineAdapter {
@@ -6324,6 +6697,7 @@ export async function detectEnginesWithStatus(): Promise<EngineDetection> {
const installed = status === 'present'
|| (id === 'grok' && resolveGrokBin() != null)
|| (id === 'maka' && resolveMakaBin() != null)
+ || (id === 'omp' && resolveOmpBin() != null)
return { id, installed, status }
}))
return {
@@ -6368,7 +6742,9 @@ export async function snapshotDetectedEngines(ids?: readonly EngineId[]): Promis
? (resolveGrokBin() ?? await resolveBinPath(bin))
: id === 'maka'
? (resolveMakaBin() ?? await resolveBinPath(bin))
- : await resolveBinPath(bin)
+ : id === 'omp'
+ ? (resolveOmpBin() ?? await resolveBinPath(bin))
+ : await resolveBinPath(bin)
return { id, bin, path }
}))
}
@@ -6497,7 +6873,10 @@ export async function runEngineDoctor(opts?: {
return Promise.all(ids.map(async (id): Promise<EngineHealth> => {
const adapter = ADAPTERS[id]
const path = (await resolveBinPath(adapter.bin))
- ?? (id === 'grok' ? resolveGrokBin(env) : id === 'maka' ? resolveMakaBin(env) : null)
+ ?? (id === 'grok' ? resolveGrokBin(env)
+ : id === 'maka' ? resolveMakaBin(env)
+ : id === 'omp' ? resolveOmpBin(env)
+ : null)
if (!path) return { id, installed: false, path: null, big: null, small: null, wake: null }
const probeTier = async (tier: 'big' | 'small'): Promise<BrainHealth> => {
const controller = new AbortController()
diff --git a/server/src/agents/computer/model-catalog.ts b/server/src/agents/computer/model-catalog.ts
index 2d00040..ad8329c 100644
--- a/server/src/agents/computer/model-catalog.ts
+++ b/server/src/agents/computer/model-catalog.ts
@@ -157,9 +157,24 @@ const PRESETS: Record<EngineId, EngineModelCatalog> = {
fastModelScope: 'agent',
source: 'presets',
},
+ omp: {
+ // The namespace is the operator's own ~/.omp provider config, so there is
+ // no first-party preset to name — supportsCustom stays open for a pin.
+ models: [],
+ defaultModel: null,
+ defaultFastModel: null,
+ supportsCustom: true,
+ fastModelScope: 'agent',
+ source: 'presets',
+ },
}
const MODEL_PROBE_TIMEOUT_MS = 10_000
+// The first `omp models --json` of a fresh cache measured 11.9-13.5s here
+// (warm runs answer in 1.2s), so the shared 10s cap would report an empty
+// catalog on exactly the rescan after an install. Discovery rides the
+// 5-minute background rescan, so the longer ceiling costs nobody a wait.
+const OMP_CATALOG_TIMEOUT_MS = 30_000
const MODEL_OUTPUT_LIMIT = 2 * 1024 * 1024
const MODEL_CACHE_TTL_MS = 15 * 60 * 1000
const catalogCache = new Map<string, {
@@ -231,7 +246,7 @@ function stopChild(child: ReturnType<typeof spawn>): void {
child.once('close', () => clearTimeout(timer))
}
-function runText(command: string, args: string[], env: NodeJS.ProcessEnv): Promise<string | null> {
+function runText(command: string, args: string[], env: NodeJS.ProcessEnv, timeoutMs = MODEL_PROBE_TIMEOUT_MS): Promise<string | null> {
return new Promise((resolve) => {
const invocation = versionCommandInvocation(command, args)
let child: ReturnType<typeof spawn>
@@ -261,7 +276,7 @@ function runText(command: string, args: string[], env: NodeJS.ProcessEnv): Promi
clearTimeout(timer)
resolve(ok && !exceeded ? output.trim() : null)
}
- const timer = setTimeout(() => { stopChild(child); finish() }, MODEL_PROBE_TIMEOUT_MS)
+ const timer = setTimeout(() => { stopChild(child); finish() }, timeoutMs)
timer.unref?.()
child.once('error', () => finish())
child.once('close', code => finish(code === 0))
@@ -343,6 +358,31 @@ export function parseListedModels(text: string, style: 'provider' | 'pi' | 'curs
return mergeModels(models, [])
}
+/** Parse `omp models --json`. The selectable id is `selector` (provider/name),
+ * NOT the bare `id`, which is provider-relative and silently no-ops as a pin.
+ * Exported so fixtures never need a real omp install. */
+export function parseOmpModels(text: string): EngineModelOption[] {
+ // A banner line ahead of the payload would otherwise parse as nothing and
+ // silently leave the picker on the empty preset.
+ const start = text.indexOf('{')
+ if (start < 0) return []
+ let payload: unknown
+ try { payload = JSON.parse(text.slice(start)) } catch { return [] }
+ if (!payload || typeof payload !== 'object' || !('models' in payload)) return []
+ if (!Array.isArray(payload.models)) return []
+ const models: EngineModelOption[] = []
+ for (const row of payload.models) {
+ if (!row || typeof row !== 'object') continue
+ if (!('kind' in row) || row.kind !== 'chat') continue
+ if (!('selector' in row) || typeof row.selector !== 'string') continue
+ const id = clean(row.selector, 160)
+ if (!id) continue
+ const label = 'name' in row && typeof row.name === 'string' ? row.name : null
+ models.push({ id, label: clean(label, 160) ?? id, description: null })
+ }
+ return mergeModels(models, [])
+}
+
interface CodexListItem {
id?: unknown
model?: unknown
@@ -415,6 +455,10 @@ export async function discoverEngineModelCatalog(
const models = output === null ? [] : parseListedModels(output, style)
return models.length || output === '' ? fromDiscovered(id, models, 'cli', null) : preset
}
+ if (id === 'omp') {
+ const models = parseOmpModels(await runText(binPath, ['models', '--json'], env, OMP_CATALOG_TIMEOUT_MS) ?? '')
+ return models.length ? fromDiscovered(id, models, 'cli', null) : preset
+ }
if (id === 'gemini' || id === 'qwen' || id === 'zcode') {
try {
const configured = configuredEngineModels(id, env)
diff --git a/server/src/agents/computer/registry.ts b/server/src/agents/computer/registry.ts
index 6856559..0dcc7e4 100644
--- a/server/src/agents/computer/registry.ts
+++ b/server/src/agents/computer/registry.ts
@@ -26,7 +26,7 @@ import { signAgentToken } from '../runtime/jwt.js'
import type { EngineModelCatalog, EngineModelOption, FastModelScope, ModelCatalogSource } from './model-catalog.js'
export type ComputerKind = 'cloud' | 'local' | 'vps'
-export type EngineId = 'managed' | 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka'
+export type EngineId = 'managed' | 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka' | 'omp'
export type ComputerStatus = 'online' | 'offline' | 'busy'
/** How long a paired computer can go without a heartbeat before the sweep
@@ -71,6 +71,7 @@ const PAIRABLE: Record<Exclude<EngineId, 'managed'>, true> = {
antigravity: true,
zcode: true,
maka: true,
+ omp: true,
}
export const PAIRABLE_ENGINES: ReadonlySet<string> = new Set<string>(Object.keys(PAIRABLE))
@@ -124,6 +125,7 @@ const ENGINE_BINS: Record<Exclude<EngineId, 'managed'>, string> = {
antigravity: 'agy',
zcode: 'zcode',
maka: 'maka',
+ omp: 'omp',
}
/** Cached PATH snapshot from the daemon. The app reads this; it never probes. */
@@ -793,6 +795,9 @@ export async function listAgentsForComputer(computerId: string, supportsProvider
const qwenDefault = process.env.CUMORA_DEFAULT_QWEN_MODEL?.trim() || null
const antigravityDefault = process.env.CUMORA_DEFAULT_ANTIGRAVITY_MODEL?.trim() || null
const zcodeDefault = process.env.CUMORA_DEFAULT_ZCODE_MODEL?.trim() || null
+ // omp's catalog is whatever providers the operator's own ~/.omp/agent config
+ // reaches, so there is no universal default to name — only a deploy pin.
+ const ompDefault = process.env.CUMORA_DEFAULT_OMP_MODEL?.trim() || null
return rows.map((r) => {
const { availableEngines, detectedEngines, engineDefaults, ...agent } = r
// A profile's endpoint owns its model namespace: neither the computer's
@@ -842,7 +847,9 @@ export async function listAgentsForComputer(computerId: string, supportsProvider
? zcodeDefault
: r.engine === 'maka'
? null
- : null
+ : r.engine === 'omp'
+ ? ompDefault
+ : null
return dflt ? { ...agent, model: dflt, fastModel: fastModelWithEngineDefault } : { ...agent, fastModel: fastModelWithEngineDefault }
})
}
diff --git a/server/src/agents/llm-ledger.ts b/server/src/agents/llm-ledger.ts
index fbf24dc..ec47997 100644
--- a/server/src/agents/llm-ledger.ts
+++ b/server/src/agents/llm-ledger.ts
@@ -75,7 +75,7 @@ export type LlmCallPurpose =
| 'agent-image'
export type LlmCallStatus = 'ok' | 'rate_limited' | 'timeout' | 'failed'
-export type LlmCallSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka'
+export type LlmCallSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka' | 'byoa-omp'
/** Context bound to a tracked client. Every LLM call it makes carries this
* shape into the ledger. `purpose` is mandatory; everything else scopes the
diff --git a/server/src/agents/observability.ts b/server/src/agents/observability.ts
index 5ceb3f3..fa03539 100644
--- a/server/src/agents/observability.ts
+++ b/server/src/agents/observability.ts
@@ -4,7 +4,7 @@ import { pool } from '../db/pool.js'
import { EMPTY_USAGE, effectiveCostUsd, modelPriceTable, priceFor, type TokenUsage } from './cost.js'
export type AgentRunStatus = 'running' | 'completed' | 'failed' | 'skipped'
-export type TriageSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka'
+export type TriageSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka' | 'byoa-omp'
export type AgentEventLevel = 'debug' | 'info' | 'warn' | 'error'
type Queryable = Pick<PoolClient, 'query'>
diff --git a/server/src/agents/runtime/byoa-source.ts b/server/src/agents/runtime/byoa-source.ts
index 823d235..fc25e9b 100644
--- a/server/src/agents/runtime/byoa-source.ts
+++ b/server/src/agents/runtime/byoa-source.ts
@@ -12,6 +12,7 @@ export const BYOA_SOURCES = [
'byoa-antigravity',
'byoa-zcode',
'byoa-maka',
+ 'byoa-omp',
] as const
export type ByoaSource = typeof BYOA_SOURCES[number]
diff --git a/src/admin/api.ts b/src/admin/api.ts
index 5375034..c391013 100644
--- a/src/admin/api.ts
+++ b/src/admin/api.ts
@@ -120,7 +120,7 @@ export type LlmCallPurpose =
| 'palette' | 'gender' | 'avatar-image' | 'agent-image'
export type LlmCallStatus = 'ok' | 'rate_limited' | 'timeout' | 'failed'
-export type LlmCallSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka'
+export type LlmCallSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka' | 'byoa-omp'
export interface LlmSummary {
sinceDays: number
diff --git a/src/api/client.ts b/src/api/client.ts
index 0a44845..087ef3c 100644
--- a/src/api/client.ts
+++ b/src/api/client.ts
@@ -421,7 +421,7 @@ export interface ApiAgentRun {
}
// ── Triage cost-effectiveness ledger ──
-export type ApiTriageSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka'
+export type ApiTriageSource = 'cloud' | 'byoa-claude' | 'byoa-codex' | 'byoa-grok' | 'byoa-cursor' | 'byoa-opencode' | 'byoa-pi' | 'byoa-gemini' | 'byoa-qwen' | 'byoa-antigravity' | 'byoa-zcode' | 'byoa-maka' | 'byoa-omp'
export interface ApiTriageAgentRow {
agentId: string
diff --git a/src/desktop/MeView.tsx b/src/desktop/MeView.tsx
index bf96a67..a858b96 100644
--- a/src/desktop/MeView.tsx
+++ b/src/desktop/MeView.tsx
@@ -797,7 +797,7 @@ type AgentRow = {
const CLI_ORDER = [
'claude', 'cursor', 'codex', 'grok', 'opencode',
- 'pi', 'gemini', 'qwen', 'zcode', 'maka', 'hermes',
+ 'pi', 'gemini', 'qwen', 'zcode', 'maka', 'omp', 'hermes',
]
const COMPUTER_STATUS_KEY: Record<string, MessageKey> = {
diff --git a/src/lib/engines.ts b/src/lib/engines.ts
index 0038af0..5f430bd 100644
--- a/src/lib/engines.ts
+++ b/src/lib/engines.ts
@@ -12,6 +12,7 @@ export const ENGINE_LABEL: Record<string, string> = {
antigravity: 'Antigravity',
zcode: 'ZCode',
maka: 'Maka',
+ omp: 'omp',
hermes: 'Hermes',
}
@@ -28,6 +29,7 @@ export const ENGINE_BIN: Record<string, string> = {
antigravity: 'agy',
zcode: 'zcode',
maka: 'maka',
+ omp: 'omp',
hermes: 'hermes',
}
@@ -39,7 +41,7 @@ export const ENGINE_BIN: Record<string, string> = {
* state that holds a choice, and the set for membership tests. Engine pickers
* used to inline their own copy of this list *and* their own copy of the
* labels, which is how adding an engine could leave it unselectable. */
-export const RUNNABLE_ENGINES = ['claude', 'codex', 'grok', 'cursor', 'opencode', 'pi', 'gemini', 'qwen', 'antigravity', 'zcode', 'maka'] as const
+export const RUNNABLE_ENGINES = ['claude', 'codex', 'grok', 'cursor', 'opencode', 'pi', 'gemini', 'qwen', 'antigravity', 'zcode', 'maka', 'omp'] as const
export type RunnableEngineId = typeof RUNNABLE_ENGINES[number]
diff --git a/src/types.ts b/src/types.ts
index f193990..2e5d68e 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -7,7 +7,7 @@ export type Status = 'avail' | 'working' | 'thinking' | 'waiting' | 'resting'
export type ComputerKind = 'cloud' | 'local' | 'vps'
export type ComputerStatus = 'online' | 'offline' | 'busy'
/** Engine an agent's host runs it on. 'managed' = Cumora's server-side loop. */
-export type EngineId = 'managed' | 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka'
+export type EngineId = 'managed' | 'claude' | 'codex' | 'grok' | 'cursor' | 'opencode' | 'pi' | 'gemini' | 'qwen' | 'antigravity' | 'zcode' | 'maka' | 'omp'
export interface EngineModelOption {
id: string