Live
Browser Run Crawl Endpoint Adds Per‑URL Outcomes and Robots.txt State ReportingOpenKruise Agents v0.6.0: Traffic‑control plane and sandbox lifecycle upgrades reshape platform opsPi Harness Upgrade in Agents SDK Cuts Storage I/O and Memory FootprintCodeQL language extensions in 2.27.3: Python 3.15 support, JSON data files, and C23 integersCopilot in JetBrains Air adds local and cloud task execution for engineering teamsAI‑Driven Simulation and Digital Twins Speed Up Semiconductor Fab OperationsIn‑Country Inference for Kimi K3 on Amazon Bedrock: Architecture and Ops Impact for India DeploymentsEmbedding an EDB Postgres AI Semantic Layer for Bedrock AgentCoreBrowser Run Crawl Endpoint Adds Per‑URL Outcomes and Robots.txt State ReportingOpenKruise Agents v0.6.0: Traffic‑control plane and sandbox lifecycle upgrades reshape platform opsPi Harness Upgrade in Agents SDK Cuts Storage I/O and Memory FootprintCodeQL language extensions in 2.27.3: Python 3.15 support, JSON data files, and C23 integersCopilot in JetBrains Air adds local and cloud task execution for engineering teamsAI‑Driven Simulation and Digital Twins Speed Up Semiconductor Fab OperationsIn‑Country Inference for Kimi K3 on Amazon Bedrock: Architecture and Ops Impact for India DeploymentsEmbedding an EDB Postgres AI Semantic Layer for Bedrock AgentCore
Cloudflare

Pi Harness Upgrade in Agents SDK Cuts Storage I/O and Memory Footprint

AI SummaryPowered by AI

Agents SDK v0.33.0 moves to Pi 1.5, batching streamed writes, revising the scheduler, and changing memory handling for large tool calls. The changes lower storage traffic, boost session throughput, and reduce heap usage, directly affecting performance and cost for AI workloads.

The Agents SDK has been updated to version 0.33.0, which now runs on Pi 1.5. The new harness batches streamed answer writes, revises the scheduling loop, and avoids copying large text buffers, resulting in fewer storage transactions, higher concurrent throughput, and lower memory consumption.

What Changed in the Pi Harness

  • Batching of streamed writes. Instead of persisting every incremental update, Pi now stores streamed answers and tool output in one‑second batches. Benchmarks against SQLite show roughly a 27× reduction in write transactions for long answers and a 5.7× reduction for parallel‑tool turns, with CPU usage dropping by about 25%.
  • Scheduler no longer rechecks every conversation on each commit. In a 2,048‑session SQLite test, a single harness went from 88 to 459 agent runs per second.
  • Memory handling for large tool calls. Streaming a 500 KB tool call now appends text instead of copying the entire buffer on each update, cutting heap usage from ~100 MB to a fraction of that.
  • Session API updates. session.watch() replaces session.events(), delivering the latest transcript entries together with live state (streamed answer, running tools, termination reason). session.continue() starts a new run on the existing transcript without adding a new user message.
  • Turn limit configuration. The defaults.maxTurns setting caps the number of tool rounds a run may take in newly created sessions.
  • Task restart semantics. Tasks that exceed the restart limit now end automatically; the previous retry() and parked status have been removed.
  • Browser tool integration. In Pi’s code mode, browserTool can feed screenshots to image(), and the tool respects harness abort signals.

Why It Matters for Engineers

Reducing storage writes directly lowers I/O cost and contention on the underlying SQLite store, which can be a bottleneck in high‑concurrency deployments. The scheduler improvement translates into a five‑fold increase in agent runs per second, enabling larger fleets of concurrent sessions without scaling the underlying compute. Memory savings on large tool calls free up heap space, allowing more agents to run on the same instance size and reducing the risk of out‑of‑memory crashes.

Operational and Architectural Implications

  • Recovery window. Because streamed updates are persisted in one‑second batches, a crash can lose up to about one second of progress. Teams should evaluate the default interval against their tolerance for lost streaming state and adjust the recovery configuration if needed.
  • Code migration. Existing code that consumes session.events() must be updated to the new session.watch() shape. Similarly, any logic that relied on retry() or the parked status will need to be refactored.
  • Configuration review. The new defaults.maxTurns introduces a hard ceiling on tool loops. Operators should set this value based on expected tool complexity to avoid premature termination.
  • Monitoring. The reduction in storage transactions and CPU usage should be reflected in metrics. Teams should track write‑transaction counts, CPU utilization, and heap size before and after upgrade to confirm expected gains.
  • Security posture. The change does not introduce new authentication or authorization mechanisms, but the reduced write frequency may lower the attack surface for storage‑related exploits simply by decreasing exposure time.

Related CloudNinjas coverage: hands-on guides.

What This Means For Practitioners

Upgrade to Agents SDK v0.33.0 and verify that your deployment runs on Pi 1.5. Run a baseline benchmark of storage writes, CPU, and memory to quantify the improvement. Update any client code to use session.watch() and session.continue(), and remove references to deprecated retry APIs. Review the recovery interval setting to balance data loss risk against write load, and configure defaults.maxTurns to match your tool usage patterns. Finally, monitor the new metrics after deployment to ensure the expected performance gains materialize in production.

Originally published atCloudflare Developer Platform