feat(statestore): record a usage row for every model call

Task agent runs and MCP sampling record against their task (billed to the
task's org); gateway chat turns, titles, sampling and curators record
against the system org. Rows carry source, workflow, step, alias,
provider/model and tokens for later chargeback.
This commit is contained in:
sam committed 2026-10-10 18:32:43 +11:00
1 parent 12b9a57404
commit e4ea2eaabc
31 files changed
+1068 -322

No files matched your search

+1 -1
View File
@@ -95,7 +95,7 @@ func runBaselineFix(ctx context.Context, tc *TaskContext, argv []string, out []b
Protection: agentrun.Protection{Suffixes: append([]string(nil), tc.Repo.Protect...)},
}
res, agentErr := tc.RunAgentChild(ctx, "baseline-fix", func() (agentrun.Result, error) {
res, agentErr := tc.RunAgentChild(ctx, "baseline-fix", "", modelRef, func() (agentrun.Result, error) {
return tc.Agent.Run(ctx, tc.Dir, req, tc.toolCallReporter("baseline-fix"))
})
if agentErr != nil && res.Version == 0 {