ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial4 min readDisconfirmAI Editorial

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.

Verified 2026-12-02 19:05 GMT+8

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.

Sign in / Sign up
ReadingResearchRadarInvestment framework

The article walks through three concrete engineering decisions that made this work at scale. For streaming output, writing each token fragment to the relational database would amplify peak load to roughly a million writes per second at 20 million daily tasks. The solution was to split preview from persistence: incremental fragments bypass the database entirely and reach the frontend through lightweight publish/subscribe, while only completed text blocks, reasoning blocks, or tool calls are written as durable events. This reduced streaming-related database writes to below 1% of their previous volume while preserving the smooth typewriter effect users expect.

For scheduling, traditional fixed-partition ordered queues expose two failure modes at scale: thousands of sessions hash to the same partition, so one session blocked on a slow model response can hold up hundreds of unrelated users; and a large customer submitting hundreds of thousands of batch tasks can consume all available processing capacity. Qoder replaced fixed partitions with per-session and per-user lightweight queues using RocketMQ LiteTopic, with fair consumption across users. When a tenant hits a rate limit, the consumer suspends only that specific queue and redelivers after a short delay, rather than failing the task or blocking other users.

For sandbox lifecycle, the team implemented a three-tier reclamation policy. Creating a session does not allocate a container; a tool call starts one on demand. After execution, current cluster compute utilization determines the reclamation schedule—at peak load, the system quickly pauses containers to release compute; off peak, a dynamic idle window keeps containers warm. When the window expires, the compute container is destroyed and only the detached cloud disk is retained. After 24 hours, a cloud disk snapshot is taken before deleting the disk, so a user returning later can restore the workspace without manual intervention. A background reconciliation loop and reverse inventory have kept the orphaned sandbox rate below 1 in 100,000.

The counterintuitive finding is that this added complexity improved task quality rather than degrading it. In an internal benchmark covering eight evaluation sets with 310 cases per combination, the same underlying model running on QCA's Serverless Harness scored 85.9 on mean effective-task score versus 70.2 on a comparable managed platform—a 15.7-point difference. Task invocation success rate was 96.8% versus 77.7%. The team's explanation is straightforward: many tasks fail not because the model cannot do the work, but because the environment trips up the model partway through. A compilation gets reclaimed six minutes in, an external tool falters and the whole session errors out, context gets abruptly truncated. Once the platform handles context compression, per-session backoff and retries, long-task keepalives, and result checks, the model no longer spends its limited turns on infrastructure errors.

The article also references Anthropic's similar architectural evolution, documented in April 2026, where they split session, harness, and sandbox into independently recoverable parts and reported P50 time-to-first-token falling by about 60% and P95 by more than 90%. Qoder notes these are measurements from Anthropic's implementation, not guaranteed gains from decoupling itself.

All figures in this account are self-reported by Qoder's engineering team based on internal production measurements and benchmarks. The quality comparison against a comparable managed platform does not control for differences in default parameters, tool configurations, and execution budgets; the article itself states that the figures reflect end-to-end delivery across each platform's complete execution path rather than a model-only leaderboard comparison.

Sources

  • alibabacloud.comAlibaba Cloud Community↗
Continue researching →