
We Built an OS Scheduler for Team of AI Agents in 72 Hours — Here Is What Actually Happened
We built HiveOS — a serverless AWS workspace where teams share AI agents through a real-time queue, enforced token ceiling, and shared memory.
The prompt that started this was simple enough: a small problem solved well beats a big one solved vaguely. So I spent the first day trying to find the smallest real problem I could see.
The one that kept coming back: Uber burned its entire 2026 AI coding budget in four months. One internal demo cost $1,200 in two hours. Across the industry, 79% of enterprises had AI cost overruns last year, and only 36% have any token or usage controls at all.
The problem is not that AI is expensive. The problem is that teams sharing AI agents have no visibility into who is using what, no fairness mechanism for access, and no real-time ceiling. One heavy agentic task can drain a monthly budget while everyone else is at lunch, and nobody sees it happen until the invoice arrives.

That is what HiveOS is: an OS scheduler for your team's shared AI budget.
What we built
The original pitch was a queue and a token meter. What shipped was more than that — because a queue is something you explain and an office is something you see, and the only judge touchpoint is a three-minute recorded video.
HiveOS is a live, multi-user office where a team runs AI agents together. You open a workspace, name your team, and two agents are already at their desks — Ada, an engineer, and Iris, a researcher. You can hire more, up to four: give them a name, a role, and a brief, and they walk onto the floor and take a desk. The workspace is the same on every member's screen, updating live over WebSocket — an avatar lights up when its agent is running, and the person who asked walks over to that desk, visible to everyone.
The governance layer is the product:
- One team shares a token budget, displayed as a live meter identical on every member's screen
- The budget is an enforced ceiling — the server refuses to invoke the model at 100%, and not one token is spent past it
- When every desk is busy, further requests queue with a real position number, visible team-wide
- A freed desk auto-dispatches the next queued task — nobody has to re-ask
- Agents share team memory — a fact one member saves is loaded into the next member's agent before their task starts, using tools the model decides to call
- A per-person spend ledger records who spent what and which agent ran it
The AWS architecture

Everything serverless, scaling to zero. The reasoning behind each choice:
API Gateway WebSocket is the backbone of the whole product. Every member holds an open socket; the server fans every state change to all of them. Without persistent connections, the live shared board does not exist.
Two Lambda functions, not one. Router Lambda handles connections, slot claims, and queueing. Agent Runner Lambda executes tasks. The split matters: agent latency (seconds per task) must never block connection handling (milliseconds for presence updates). Sharing one Lambda would mean an agent thinking about a coding problem delays every avatar move in the office.
The queue is gated in DynamoDB, not in SQS. The obvious approach was to use Lambda reserved concurrency equal to the slot count and let SQS gate itself. I rejected it: it pulls in Lambda throttling, visibility-timeout tuning, and DLQ risk under exactly the conditions a demo creates — and SQS only knows approximate depth, not "where am I in line." Instead, the Router claims a slot with an atomic conditional write: if the slot is IDLE, take it; if not, write a
QUEUE#<timestamp> item. Position is a trivial count of earlier items — deterministic, race-free, and the position display is free. SQS still does real work: every running task is a durable, DLQ-backed message that survives a Lambda crash.The budget ceiling is checked immediately before the model is called, not at claim time. A task can sit in the queue while the tasks ahead of it burn what was left — so claim time is the wrong moment. This is also the spend guard, which is why it is never disabled to make a demo look clean.
DynamoDB single table for everything: team metadata, WebSocket connection IDs, agent slot states, queue entries, and team memory. Atomic conditional writes handle the slot claiming. Atomic counters handle the token accounting.
SSM Parameter Store holds the model API key as a SecureString, read at Lambda runtime. It never appears in the template, the stack outputs, or the repository.
AWS Budgets sits behind the in-app ceiling as a backstop. The application enforces the limit; the account budget exists because I do not trust my own code completely.
What fought back
Bedrock was blocked account-wide
Amazon Bedrock is blocked on this AWS account. 42 of 43 per-day token quotas sit at zero and are marked
adjustable=False — including first-party Amazon Nova, which needs no Marketplace subscription and no payment instrument. I verified this in three regions ( us-east-1 , us-west-2 , ap-south-1 ) before concluding it was an account-level restriction rather than a configuration problem. Adding a payment method fixed a genuine INVALID_PAYMENT_INSTRUMENT failure for third-party models; Nova still returned ThrottlingException: Too many tokens per day against a zero quota. That is an AWS Support matter, not a config fix, and it was not going to resolve before the deadline.Model inference therefore calls out to Groq over HTTPS. Everything else — the WebSocket API, both Lambdas, SQS, DynamoDB, SSM, Amplify, SAM — is AWS. One outbound HTTP call is the entire difference between the submission and the plan.
I think this is the right call rather than a retreat, and the product itself argues why: a governance layer that only works against one vendor's models is a worse governance layer. The scheduler does not care where a token was spent, only that it was counted. The swap proved that concretely — it touched exactly one function plus a new 130-line client, and nothing about the queue, the slot state machine, the atomic accounting, or the enforced ceiling moved.
Frame ordering is a correctness property
The most counterintuitive bug in the build:
claim_agent was dispatching the task to SQS before broadcasting the BUSY state. A fast-failing task could post its completion frame ahead of the BUSY frame. The client would apply BUSY after the release — and show a slot stuck busy for the rest of the session.It failed about half the time, which is the worst failure rate there is: often enough to be a real bug, not often enough to seem systematic.

The rule that came out of it: a frame describing committed state must go out before the work that could produce the next frame. This is obvious in retrospect and invisible until you are watching a second browser.
The client that matters is the cold one
Twice I shipped something correct for a watching client and wrong for a joining one. The token-provenance flag — indicating whether token counts were real or estimated — only rode on live incremental events. A browser loading the URL cold reads exactly one frame: the state snapshot. That frame did not carry the flag.
Every judge opens the URL cold. I caught it because the smoke test asserts on the snapshot frame specifically. The fix was persisting the provenance on the metadata row and returning it on every snapshot.
The lesson generalised: the cold-load path is the most important path in a live product, and the most likely to be undertested.
Tidy numbers are a trap
Avatar coordinates go into DynamoDB as Decimal. Building
Decimal(24.92) from a float carries its binary expansion, and boto3 raises decimal.Inexact rather than rounding silently. My own test had passed — because I had picked 73.5 and 21.25 as coordinates that obviously have fractional parts, and both happen to be exactly representable in binary floating point.A real mouse click produced
24.92 , which is not. The failure mode was the worst kind: the mover's optimistic UI still moved their avatar, so they were standing somewhere nobody else could see. Choosing awkward test values is a skill. Round numbers are comfortable and dangerous.
What I actually learned
The hard part of this build was not the AI. It was making three browsers agree on one number.
The most transferable thing I took from the 72 hours: verify against the deployed system, not against an exit code. Every phase gate in the build plan is a runtime check run against real AWS —
ws_smoke.py (109 of 113 checks), rehearse.py (15/15 demo sequence, two unattended takes). A zero exit code proves a command ran. It does not prove the system behaved.The slot ordering bug and the cold-client provenance bug were both invisible to unit tests and obvious the moment I was asserting on frames arriving at a second, observing browser. Test what the user sees, not what the code returns.
The other thing I would carry forward: treat the repository as the agent's memory. This was built with Claude Code as the implementation assistant over many context resets.
CLAUDE.md defines the workflow. PROGRESS.md holds current execution state. CONTRACT.md pins the schemas and protocol so they cannot drift between sessions. A fresh session reads those three files and knows the phase, the blocker, and the next step. I never re-explained the project after a context reset, because the repo explained it.
The numbers, honestly
Measured against deployed AWS, not localhost:

Try it
Live: https://main.dbavt8jr66qxx.amplifyapp.com — no sign-in, opens cold. Open two tabs, pick different names, watch them see each other. Hire an agent, task it, watch the token meter tick.
Code: https://github.com/arunishrajput/hiveos —
ARCHITECTURE.md has every design decision and rejected alternative. SUBMISSION.md is the detailed hackathon writeup including the complete Bedrock diagnosis.Video: (link to follow)
Built for First Commit (WeMakeDevs × AWS), Ship It track. Solo, ~72 hours, September 2026.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article