Skip to main content

One post tagged with "Background Tasks"

View All Tags
Command Timeouts and Faked Completion: Long-Running Task Governance in Decoupled Agents
· 11 min read

Command Timeouts and Faked Completion: Long-Running Task Governance in Decoupled Agents

xfgong
CubePlex

In local terminal environments, letting an agent run long-duration commands in the background is well-understood. From Claude Code to CLI-based coding agents, developers are accustomed to moving long commands off the foreground interactive prompt. The shell process and the agent reasoning loop run on the same local machine; a background task is fundamentally an asynchronous child process handle in the host operating system's process tree and local memory. Polling state queries local pipes, and canceling a run dispatches a local OS signal. Its complexity remains cleanly encapsulated within single-host operating system abstractions.

When agents move to enterprise production and adopt a "decoupled brain-and-hand" architecture—where a protected control plane owns the reasoning loop, conversation state, and checkpoints (the "brain"), while remote isolated sandboxes lease compute and run commands on demand (the "hand")—the single-host assumptions that previously masked this complexity collapse.

In this architecture, a background task is no longer a local PID that can be polled in memory. It becomes a distributed state transfer across network failure boundaries. Systems must survive gateway connection timeouts, maintain consistency across network interruptions and worker restarts, manage concurrency in multiplayer conversations, and eliminate a frequent model failure mode: pretending a long-running command has finished and prematurely checking off unfinished tasks. Governing long commands requires complete state contracts across turn lifecycles, task list validation, log recovery, and cancellation propagation.