Qoder's Serverless Harness: How Decoupling Orchestration, State, and Sandbox Scaled Cloud Agents to 20 Million Daily Tasks
Alibaba Cloud's Qoder engineering team explains why the common agent-in-sandbox pattern creates a fundamental scaling ceiling, and how their Serverless Harness architecture—separating stateful session data, stateless workers, and on-demand sandboxes—enabled a hundredfold task-volume increase while reducing sandbox cost to about 1% of the always-on baseline and improving end-to-end task quality.
The most natural way to deploy a cloud agent is to put everything—model calls, tool dispatch, session state, and the execution sandbox—inside one container. Each session gets its own isolated environment, the agent can read and write files directly, and runtime state lives in the process. It is a convenient starting point, and for small scale it works.
The problem emerges when task volume grows. Production agent tasks often extend beyond a single online conversation: a code commit, a schedule, or a business event triggers work that keeps running after the user closes the page. If session state lives only in the container's memory, the platform cannot reclaim that container even when the agent is waiting for a model response or a remote API. The number of environments that must stay alive depends on how many tasks are unfinished, not how many are actively executing code. Resource reclamation and task recovery pull in opposite directions, and the conflict traces back to one design choice: coupling the lifetime of a task to the lifetime of its execution environment.
Qoder's engineering team describes rebuilding their orchestration and sandbox infrastructure to break this coupling. The resulting architecture, which they call Serverless Harness, rests on two boundaries. First, stateful and stateless components are separated: session history and task progress live in a database, a message queue handles transitions between steps, and the harness workers that execute work are stateless. A worker takes one atomic command from the queue, performs one inference or tool call, writes the result to the event bus, and returns to the pool to serve an unrelated task. Second, compute and storage are separated: container CPU and memory are needed only during execution and can be reclaimed afterward, while workspace code, dependencies, and intermediate files live on independent cloud disks and object storage. Destroying a container does not destroy the workspace; a new container can mount it and continue.