Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
import { agentChildWorkFencesEqual, type AgentChildWorkRecord } from './agent-status-child-work'
import type { AgentChildWorkStopRequest } from './agent-status-child-work-admission'
import { findAgentChildWork } from './agent-status-child-work-admission-core'
import type { AgentStatusStore } from './agent-status-store'
import { agentStatusSubjectsEqual } from './agent-status-subject'
export function authorizeAgentChildWorkStop(
store: AgentStatusStore,
request: AgentChildWorkStopRequest
): AgentChildWorkRecord | null {
const child = findAgentChildWork(store, request.childWorkId)
if (
!child ||
!agentStatusSubjectsEqual(child.parent, request.parent) ||
!agentChildWorkFencesEqual(child.invocation, request.expectedFence) ||
child.membership !== 'live' ||
child.stoppable !== true
) {
return null
}
return child
}