Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4c53712
fix(omp): reconcile live subagent status from native registry
kiendle Oct 14, 2026
680c957
fix(omp): harden native subagent tracking at scale
kiendle Oct 14, 2026
d55f359
test(omp): consolidate tracking regressions and native smoke
kiendle Oct 15, 2026
31a3af0
test(omp): keep core tracking regressions only
kiendle Oct 15, 2026
835ee65
fix(omp): preserve tracking through prompt completion markers
kiendle Oct 15, 2026
f87e1cb
Merge main and adapt OMP completion checks to typed runtime
kiendle Oct 15, 2026
16b06b8
test(omp): align tracking checks with current main contracts
kiendle Oct 15, 2026
edba859
fix(omp): preserve completion across shutdown and controller gaps
kiendle Oct 15, 2026
72180bd
fix(omp): fence superseded completion markers on reattached terminals
kiendle Oct 15, 2026
de20959
Merge current main and drop superseded OMP prompt-marker handling
kiendle Oct 18, 2026
5cc2c22
fix(omp): reconcile live subagents from the native registry
kiendle Oct 18, 2026
30237a7
revert(omp): drop the native registry observer and omp_status channel
AmoabaKelvin Oct 25, 2026
d04f83c
Merge origin/main into omp-subagent-status
AmoabaKelvin Oct 25, 2026
35e94b3
fix(omp): settle the pane once OMP no longer runs its children
AmoabaKelvin Oct 25, 2026
a12096f
test(omp): type the async job snapshot on the hook context
AmoabaKelvin Oct 25, 2026
6e5d7b2
fix(omp): keep a woken child that waits on its own background work
AmoabaKelvin Oct 25, 2026
1e99d02
fix(omp): skip pruning when OMP's job snapshot cannot name its children
AmoabaKelvin Oct 25, 2026
55c0f90
fix(omp): keep every child when OMP exposes no agent registry
AmoabaKelvin Oct 26, 2026
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
46 changes: 45 additions & 1 deletion docs/site/content/docs/agents/supported.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To restore prompts for one agent only, edit that agent's default arguments or en
| GitHub Copilot CLI | Auto-setup | [GitHub](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) |
| OpenCode | Auto-setup, status | [OpenCode](https://opencode.ai/docs/cli/) |
| Pi | Auto-setup, hooks, status | [Pi](https://pi.dev) |
| OMP | Auto-setup, hooks, status | [OMP](https://omp.sh) |
| OMP | Auto-setup, hooks, live subagent status | [OMP](https://omp.sh) |
| Prime Agent | Auto-setup, hooks, status, session history | [Prime Intellect](https://github.com/PrimeIntellect-ai/prime-agent) |
| Gemini | Auto-setup | [Google](https://github.com/google-gemini/gemini-cli) |
| Antigravity | Auto-setup, hooks, status | [Google](https://antigravity.google/docs/cli-overview) |
Expand Down Expand Up @@ -65,6 +65,50 @@ To restore prompts for one agent only, edit that agent's default arguments or en
| OpenClaw | Auto-setup | [OpenClaw](https://github.com/openclaw/openclaw) |
| Trae | Auto-setup via `traecli` (TRAE CN CLI) | [Trae](https://www.trae.ai/) |

## OMP: live subagent status

Orca's managed status extension observes OMP's own agent registry. Children appear by their native
IDs rather than repeated role names, and completed or cancelled children leave the live roster.
Registry changes are coalesced for about 200 ms; active work is rechecked every five seconds, including
when the parent is silently waiting. These checks verify running agents, not new model activity.
Children waiting for background tool results remain live even when OMP temporarily marks their
model loop idle. Opening an unprompted OMP session does not count as working.

After upgrading Orca, fully restart the app and OMP to load the updated tracking code and extension.
No additional tracking tool, daemon, or model instruction is needed. Native tracking is
capability-detected and has been verified with OMP 18.10.3, 18.10.4, and 18.11.0; runtimes without the
registry API retain lifecycle-only tracking. Agent roles do not restrict which children are tracked.

Snapshots belong to one root and its current session. Session changes retire the previous roster,
and observation refreshes preserve the root's prompt, input waits, and turn timing. Failed registry
reads or hook delivery cannot refresh stale child evidence or declare an agent exited.

The existing compact sidebar layout is unchanged. Expand the worktree's agent count, then use the
chevron on an OMP parent row to show or hide its children; there is no separate subagent switch.
When OMP reports a new session ID and transcript, the renderer cannot inherit the previous session's
turn clock. The root's own completion time remains separate from its children's.

OMP paints shell-completion markers inside its prompt bubbles while the process is still running.
Orca checks that the foreground has returned to a shell before retiring that OMP launch; an
unverifiable foreground read does not close its status channel.

Delivery keeps current and adjacent closing scopes rather than replaying an unbounded history after
an outage. Older retired updates may be discarded; the status feed is not a durable notification log.

For SSH workspaces, the execution host owns the registry and hook store; use an updated Orca host and
a compatible OMP there. Losing client contact remains `unverifiable`, not `exited`. The adapter does
not require a git worktree, so the same observation works in folder workspaces.

The shared roster displays up to 32 children. Root completion accounts for all discovered native
children, including those beyond that display limit.

The optional installed-OMP E2E uses one core scenario: two sessions with three children by default.
`ORCA_OMP_SCALE=1` adds eight sessions with six children; `ORCA_OMP_SCALE_STRESS=1` adds sixteen with eight.
It checks live rosters, quiet/background work, cancellation/completion and session isolation, with a
smoke check of the existing compact UI rather than repeating its disclosure or accessibility tests.
Run `ORCA_BACKGROUND_LAUNCH=1 ORCA_REAL_OMP_CLI_TEST=1 pnpm run test:e2e omp-subagent-status.spec.ts --workers=1`.
The core suite was verified with OMP 18.10.4; it is a functional check, not a benchmark harness.

## ZCode: pick a CLI that ships the TUI

Orca drives ZCode through the `zcode` terminal CLI, so `zcode` on your `PATH` has to be a build that
Expand Down
162 changes: 161 additions & 1 deletion src/main/agent-hooks/server-pi-normalization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,24 +288,48 @@ const REVIEWER = {
agentType: 'reviewer',
description: 'Review the diff'
}
const OMP_SESSION = {
session_id: 'omp-root',
session_file: '/home/dev/.omp/agent/sessions/omp-root.jsonl'
}

describe('Pi-family child rows through the hook lane', () => {
let server: AgentHookServer

beforeEach(async () => {
vi.useFakeTimers({ toFake: ['Date'] })
vi.setSystemTime(1_000_000)
server = new AgentHookServer()
await server.start({ env: 'production' })
})

afterEach(() => {
server.stop()
vi.useRealTimers()
})

async function post(source: 'pi' | 'omp', payload: Record<string, unknown>): Promise<void> {
async function post(
source: 'pi' | 'omp' | 'prime-agent',
payload: Record<string, unknown>
): Promise<void> {
const response = await postHookEvent(server, buildBody(payload), `/hook/${source}`)
expect(response.status).toBe(204)
}

async function snapshot(
ompStatus: unknown,
subagents: unknown = [SCOUT],
extra: Record<string, unknown> = {}
): Promise<void> {
await post('omp', {
...OMP_SESSION,
hook_event_name: 'subagents_update',
omp_status: ompStatus,
subagents,
...extra
})
}

it.each(['pi', 'omp'] as const)(
'publishes the %s extension roster as the row subagents',
async (source) => {
Expand Down Expand Up @@ -349,6 +373,139 @@ describe('Pi-family child rows through the hook lane', () => {
expect(server.getStatusSnapshot()[0]?.subagents).toBeUndefined()
})

it('recovers a root and named children after receiver restart', async () => {
await snapshot({
state: 'blocked',
prompt: 'Recover root',
tool_name: 'bash',
tool_input: { command: 'pnpm test' },
role: 'assistant',
text: 'Root approval pending'
})
expect(server.getStatusSnapshot()).toMatchObject([
{
agentType: 'omp',
state: 'blocked',
prompt: 'Recover root',
toolName: 'bash',
toolInput: 'pnpm test',
lastAssistantMessage: 'Root approval pending',
subagents: [SCOUT],
providerSession: {
id: OMP_SESSION.session_id,
transcriptPath: OMP_SESSION.session_file
}
}
])
expect(server.getStatusSnapshot()[0]?.providerSessionOnly).toBeUndefined()
})

it('preserves human waits until native input evidence releases them', async () => {
await post('omp', {
...OMP_SESSION,
hook_event_name: 'before_agent_start',
prompt: 'Approve the change'
})
await post('omp', {
...OMP_SESSION,
hook_event_name: 'tool_approval_requested',
tool_name: 'bash',
reason: 'Critical pattern detected'
})
const blocked = server.getStatusSnapshot()[0]!
vi.setSystemTime(1_010_000)
await snapshot(
{
state: 'working',
prompt: 'Unproven busy prompt',
tool_name: 'read',
tool_input: { path: 'unproven.ts' }
},
[REVIEWER]
)
expect(server.getStatusSnapshot()[0]).toMatchObject({
state: 'blocked',
prompt: 'Approve the change',
toolName: 'bash',
toolInput: 'Critical pattern detected',
mainAgent: { state: 'blocked', stateStartedAt: blocked.stateStartedAt },
stateStartedAt: blocked.stateStartedAt,
turnStartedAt: blocked.turnStartedAt,
subagents: [REVIEWER]
})
// The resolution hook may have been coalesced away; false is positive release evidence.
await snapshot({
state: 'working',
input_pending: false,
tool_name: 'bash',
tool_input: null
})
expect(server.getStatusSnapshot()[0]).toMatchObject({
state: 'working',
mainAgent: { state: 'working', stateStartedAt: 1_010_000 }
})
expect(server.getStatusSnapshot()[0]?.toolInput).toBeUndefined()

const questions = { questions: [{ question: 'Which path?', options: ['A', 'B'] }] }
await snapshot({ state: 'waiting', tool_name: 'ask', tool_input: questions })
await snapshot({ state: 'working', input_pending: true, tool_name: 'bash' }, [REVIEWER])
expect(server.getStatusSnapshot()[0]).toMatchObject({
state: 'waiting',
toolName: 'ask',
interactivePrompt: JSON.stringify(questions),
subagents: [REVIEWER]
})
await snapshot({ state: 'working', input_pending: false }, [])
expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'working' })
expect(server.getStatusSnapshot()[0]?.interactivePrompt).toBeUndefined()
expect(server.getStatusSnapshot()[0]?.subagents).toBeUndefined()
})

it('requires native boundary proof to rebind and rejects stale snapshots', async () => {
await snapshot({ state: 'unknown', prompt: 'Invalid root' })
expect(server.getStatusSnapshot()).toEqual([])
await snapshot({ state: 'working', prompt: 'Old root' })
const before = server.getStatusSnapshot()
const replacement = { session_file: '/sessions/replacement.jsonl' }
vi.setSystemTime(1_010_000)
await snapshot({ state: 'working', prompt: 'Unproven root' }, [REVIEWER], replacement)
expect(server.getStatusSnapshot()).toEqual(before)
await snapshot({ state: 'unknown' }, [], replacement)
expect(server.getStatusSnapshot()).toEqual(before)
await snapshot({ state: 'done', session_boundary: true }, [REVIEWER], replacement)
const current = server.getStatusSnapshot()
expect(current[0]).toMatchObject({
state: 'working',
prompt: '',
providerSession: { id: OMP_SESSION.session_id, transcriptPath: replacement.session_file },
mainAgent: { state: 'done', stateStartedAt: 1_010_000 },
subagents: [REVIEWER]
})
expect(current[0]?.turnStartedAt).toBeUndefined()
await snapshot({ state: 'working', prompt: 'Delayed old root' })
expect(server.getStatusSnapshot()).toEqual(current)
})

it('ignores native OMP root metadata on the legacy Pi lane', async () => {
const payload = {
...OMP_SESSION,
hook_event_name: 'subagents_update',
omp_status: { state: 'blocked', prompt: 'Spoofed native root', session_boundary: true },
subagents: [REVIEWER]
}
await post('pi', payload)
expect(server.getStatusSnapshot()).toEqual([])
await post('pi', { hook_event_name: 'before_agent_start', prompt: 'Genuine provider root' })
await post('pi', payload)
expect(server.getStatusSnapshot()[0]).toMatchObject({
state: 'working',
agentType: 'pi',
prompt: 'Genuine provider root',
subagents: [REVIEWER]
})
expect(server.getStatusSnapshot()[0]?.mainAgent).toBeUndefined()
})

it('keeps an update from inventing a row or unhiding a resume placeholder', async () => {
await post('pi', { hook_event_name: 'subagents_update', subagents: [SCOUT] })
expect(server.getStatusSnapshot()).toEqual([])
Expand Down Expand Up @@ -382,6 +539,9 @@ describe('Pi-family child rows through the hook lane', () => {
it('never lets one agent restate another agent row', async () => {
await post('pi', { hook_event_name: 'before_agent_start', prompt: 'pi turn' })
await post('omp', { hook_event_name: 'subagents_update', subagents: [SCOUT] })
const before = server.getStatusSnapshot()
await snapshot({ state: 'blocked', prompt: 'Spoofed OMP root', session_boundary: true })
expect(server.getStatusSnapshot()).toEqual(before)

const [row] = server.getStatusSnapshot()
expect(row).toMatchObject({ agentType: 'pi', prompt: 'pi turn' })
Expand Down
33 changes: 32 additions & 1 deletion src/main/agent-hooks/server/server-status-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function resolveTurnStartedAt(
payload: AgentHookEventPayload,
at: number
): number | undefined {
if (isOmpSnapshotSessionReplacement(previous, payload)) {
return undefined
}
if (
payload.source !== undefined &&
payload.toolAgentId === undefined &&
Expand All @@ -54,6 +57,31 @@ function resolveTurnStartedAt(
return previous?.turnStartedAt
}

function isOmpSnapshotSessionReplacement(
previous: EnrichedAgentHookEventPayload | undefined,
incoming: AgentHookEventPayload
): boolean {
const previousSession = previous?.providerSession
const incomingSession = incoming.providerSession
if (
previous?.payload.agentType !== 'omp' ||
incoming.source !== 'omp' ||
incoming.payload.agentType !== 'omp' ||
incoming.hookEventName !== 'subagents_update' ||
incoming.isReplay === true ||
!previousSession ||
!incomingSession?.transcriptPath
) {
return false
}
return (
previousSession.key !== incomingSession.key ||
previousSession.id !== incomingSession.id ||
(previousSession.transcriptPath !== undefined &&
previousSession.transcriptPath !== incomingSession.transcriptPath)
)
}

export abstract class AgentHookServerStatusApplication extends AgentHookServerStatusDisposition {
protected refreshTerminalStatusEvidence(
previous: EnrichedAgentHookEventPayload,
Expand Down Expand Up @@ -146,7 +174,10 @@ export abstract class AgentHookServerStatusApplication extends AgentHookServerSt
incomingPromptInteractionKey: payload.promptInteractionKey
})
const stateStartedAt =
previous && previous.payload.state === payload.payload.state && !commandCodeNewTurn
previous &&
previous.payload.state === payload.payload.state &&
!commandCodeNewTurn &&
!isOmpSnapshotSessionReplacement(previous, payload)
? previous.stateStartedAt
: (observedAt ?? now)
const turnStartedAt = resolveTurnStartedAt(previous, payload, observedAt ?? now)
Expand Down
55 changes: 0 additions & 55 deletions src/main/pi/agent-status-completion-delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,61 +32,6 @@ describe('OMP completion delivery', () => {
}
)

it.each([22, null])('retries failed or timed-out WSL curl (exit %s)', async (curlExitCode) => {
const harness = createAgentStatusExtensionHarness({
kind: 'omp',
env: { WSL_DISTRO_NAME: 'Ubuntu' },
existsSync: (path) => path === '/mnt/c/Windows/System32/curl.exe',
curlExitCode,
fetchImpl: async () => {
throw new Error('guest unavailable')
}
})
await harness.callHook('agent_end')
await vi.advanceTimersByTimeAsync(curlExitCode === null ? 11251 : 251)
expect(harness.spawnMock).toHaveBeenCalledTimes(2)
await harness.callHook('session_shutdown')
await vi.advanceTimersByTimeAsync(60_000)
expect(harness.spawnMock).toHaveBeenCalledTimes(4)
expect(vi.getTimerCount()).toBe(0)
})

it('does not acknowledge a missing WSL curl bridge', async () => {
const harness = createAgentStatusExtensionHarness({
kind: 'omp',
env: { WSL_DISTRO_NAME: 'Ubuntu' },
fetchImpl: async () => {
throw new Error('guest unavailable')
}
})
await harness.callHook('agent_end')
await vi.advanceTimersByTimeAsync(251)
expect(harness.fetchMock).toHaveBeenCalledTimes(2)
await harness.callHook('session_shutdown')
})

it('waits for WSL curl acknowledgment before draining a newer snapshot', async () => {
const harness = createAgentStatusExtensionHarness({
kind: 'omp',
env: { WSL_DISTRO_NAME: 'Ubuntu' },
existsSync: (path) => path === '/mnt/c/Windows/System32/curl.exe',
curlExitCode: null,
fetchImpl: async () => {
throw new Error('guest unavailable')
}
})
await harness.callHook('agent_end')
await vi.advanceTimersByTimeAsync(0)
await harness.callHook('agent_start')
expect(harness.fetchMock).toHaveBeenCalledTimes(1)
harness.spawnedChildren[0]?.emit('close', 0)
await vi.advanceTimersByTimeAsync(0)
expect(harness.fetchMock).toHaveBeenCalledTimes(2)
harness.spawnedChildren[1]?.emit('close', 0)
await vi.advanceTimersByTimeAsync(1000)
expect(vi.getTimerCount()).toBe(0)
})

it.each(['before_agent_start', 'agent_start'])(
'retires a failed completion at %s',
async (boundary) => {
Expand Down
Loading