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
// Imported backup/set-aside records may hide an already granted fence: choose above the recovery floor to prevent a second equal-fence writer.
// Keep the current fence for proven live handles; moving it invalidates them. The source ratchet catches direct + 1 mints only; transition tests pin the bound/floor.
import type { AgentSessionLease } from './agent-session-record'
export function nextAgentSessionFence(lease: AgentSessionLease): number {
return Math.max(lease.runtimeFence + 1, lease.minimumNextFence ?? 0)
}