Q130: every open task says why it is not moving, when it resumes, and who must act
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
271a83a7bc
commit
074a1fc8e3
14 files changed
+255
-7
No files matched your search
@@ -69,7 +69,8 @@ export function budgetBlock(db: DatabaseSync, agentId: string, paid: boolean, no
|
||||
const agentSpend = (db.prepare("select coalesce(sum(cost_cents), 0) as cents from provider_requests where agent_id = ? and created_at >= ?")
|
||||
.get(agentId, since) as { cents: number }).cents;
|
||||
if (agentSpend >= agent.budget_cents) {
|
||||
return `${agent.name} has spent its monthly budget (${dollars(agentSpend)} of ${dollars(agent.budget_cents)}). Raise the budget or wait for next month.`;
|
||||
const next = agent.budget_cents === 0 ? "Raise the budget to let it run." : "Raise the budget or wait for next month.";
|
||||
return `${agent.name} has spent its monthly budget (${dollars(agentSpend)} of ${dollars(agent.budget_cents)}). ${next}`;
|
||||
}
|
||||
const department = db.prepare("select monthly_budget_limit_cents from org_departments where org_id = ? and name = ?")
|
||||
.get(agent.org_id, agent.department) as { monthly_budget_limit_cents: number } | undefined;
|
||||
|
||||
Reference in new issue
Block a user