summaryrefslogtreecommitdiff
path: root/internal/executor
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-05-26 20:27:36 +0000
committerClaude <noreply@anthropic.com>2026-05-26 20:27:36 +0000
commit39f74dbbc7adca0e2058112408bb99694deefcaf (patch)
treefb657954c1eba928567403b0e320b976e23f734a /internal/executor
parent561915c5182c3fb39cd6a8b6613c489b35b7c1bf (diff)
feat(budget,storage,config): per-provider spend accounting substrate (Phase 6)
Adds the budget accountant foundation: - storage: a per-execution `agent` column (additive migration, populated by the dispatcher) and SpendByProviderSince(since), summing cost_usd per provider in a window. Accurate attribution survives a task running on different providers across retries. - internal/budget: Accountant over a SpendSource + Limits, exposing Headroom (remaining/fraction per provider), Allow (would estCost breach the cap), and All (one query, sorted). Unconfigured/local providers are unlimited. - config: a [budget] section (window + provider_5h_usd map). No default cap — gating is opt-in by configuring limits. Fully unit-tested; dispatcher gating and the API/UI surface follow. https://claude.ai/code/session_01SESwn7kQ7oP62trWw6pc39
Diffstat (limited to 'internal/executor')
-rw-r--r--internal/executor/executor.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index 6d6c528..4333f51 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -1025,6 +1025,7 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
TaskID: t.ID,
StartTime: time.Now().UTC(),
Status: "RUNNING",
+ Agent: agentType,
}
// Pre-populate log paths so they're available in the DB immediately —