The Serverless Trap: Scaling to Zero and the $0.00 Budget
Date: August 2026
What I Wanted
To eliminate local hardware dependencies for my agentic workflows, I needed a highly available, standardized execution plane. The architecture mandated a strict $0.00/month infrastructure cost constraint to prove that complex, enterprise-grade autonomous pipelines could be built and operated without institutional funding.
The chosen architecture was Google Cloud Run. By utilizing serverless containers, the system could theoretically "scale to zero" when idle, avoiding all compute charges while remaining instantly available.
What I Did
I migrated the Warlock Agent Server to GCP using Terraform. To support the new Model Context Protocol (MCP) for tool routing, I implemented the Server-Sent Events (SSE) transport layer. This allowed distributed agents (like the Eldritch Harvester) to connect via HTTP, request tool execution, and stream results back asynchronously.
🚨 INCIDENT: Unbounded Billing Accumulation
Total Cloud Run Instance Hours: 1,304
Total Cost: $16.71 (1,111% increase over prior period)
What I Learned
The architecture fundamentally failed due to a protocol mismatch. Cloud Run billing is based on instance uptime. The MCP SSE transport requires persistent, long-lived HTTP connections to stream context. Because the connection never closed, the container could never scale to zero.
This "Serverless Trap" is a form of economic gatekeeping. The tooling ecosystem presents small developers with a false binary: either pay a "cloud tax" for persistent centralized servers, or run ungoverned local scripts.
I pivoted. I demolished the Cloud Run infrastructure completely. Instead of a centralized cloud server, I redesigned the platform to utilize an immutable, decentralized edge-execution model. The Warlock server is now distributed as a pinned Python package and executed locally by the client over standard I/O streams using uvx run warlock-mcp --transport stdio.
The Result: Centralized GitOps governance, zero developer drift, zero latency network hops, and an immediate return to the $0.00 budget constraint.