Phase 11, part 4: agents' limits, recent calls and a pause switch

Each agent has calls a minute and things it may ask to send out a day,
checked on every tool call and every request to send; every call is
recorded (tool, outcome, time) and the agent's page lists the last 50 and
what it's waiting on. Pause refuses all its calls at once. Also fixes each
agent's MCP server being shared with others that had the same scopes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 11:09:18 -07:00
co-authored by Claude Opus 5.5
parent 311d2e815b
commit 6bf0517163
16 changed files with 527 additions and 13 deletions
+23
View File
@@ -217,6 +217,29 @@ CREATE TABLE agent_autonomy (
granted_at TEXT NOT NULL,
PRIMARY KEY (agent_id, class)
);
`,
},
// 39
{
Note: "agents' limits and pause switch, and the calls they make",
SQLite: `
CREATE TABLE agent_limits (
agent_id INTEGER PRIMARY KEY,
per_minute INTEGER NOT NULL DEFAULT 60, -- tool calls a minute
out_per_day INTEGER NOT NULL DEFAULT 50, -- things it asks to send out, in 24 hours
paused_at TEXT NOT NULL DEFAULT '', -- '' when running
paused_by INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE agent_calls (
id INTEGER PRIMARY KEY,
agent_id INTEGER NOT NULL,
at TEXT NOT NULL,
tool TEXT NOT NULL,
outcome TEXT NOT NULL, -- ok, error, refused (over the rate)
detail TEXT NOT NULL DEFAULT '', -- the error, or the start of the answer
ms INTEGER NOT NULL DEFAULT 0
);
CREATE INDEX agent_calls_agent ON agent_calls(agent_id, at);
`,
},
}