mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 16:02:03 +00:00
A pty.spawn whose response is lost leaves the relay holding a live agent PTY it deliberately will not reap (the stale-spawn killer is skipped for agentSessionCreateOperationId spawns), while the client memoizes the rejection for 24h and never asks again — an agent burning tokens with no way back. The client already names what it launched: the deterministic preAllocatedHandle is exported as ORCA_TERMINAL_HANDLE and published back in pty.listProcesses. Retain that identity with the fenced operation and, on replay, reuse reconcileRemoteTerminalCreate to adopt it. Adoption only: never spawns, never kills, and any unverifiable or ambiguous inventory replays the original failure unchanged. Scope the reconcile listing to the owning host so an unreachable relay throws instead of silently reading as absence. Refs #17929