managarten/services/mana-ai/src
Till JS 0d613e1846 feat(ai): thread TokenUsage through runPlannerLoop → mana-ai budget
Carries per-round token counts from the mana-llm response body
(prompt_tokens + completion_tokens) back through LlmCompletionResponse
→ PlannerLoopResult. The loop sums across rounds and exposes a single
aggregate on result.usage.

Lets mana-ai's tick re-activate per-agent daily-token budget tracking
— tokensUsed was stubbed to 0 in the migration commit (6) because the
loop didn't surface usage yet. Now recordTokenUsage + agentTokenUsage24h
get real numbers again, and the mana_ai_tokens_used_total Prometheus
counter is accurate.

Additive only: consumers without usage needs ignore the new field,
and providers that don't return usage produce zeros (not undefined —
the loop still exposes the object so downstream branches stay trivial).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 18:21:34 +02:00
..
cron feat(ai): thread TokenUsage through runPlannerLoop → mana-ai budget 2026-04-20 18:21:34 +02:00
crypto feat(mana-ai): encrypted resolver + tick uses Mission Grant to decrypt scoped inputs 2026-04-15 13:42:31 +02:00
db docs: update architecture comparison — 5/10 roadmap items done 2026-04-16 15:00:09 +02:00
middleware feat(mana-ai): scaffold server-side Mission Runner (v0.1) 2026-04-14 23:48:30 +02:00
planner feat(ai): thread TokenUsage through runPlannerLoop → mana-ai budget 2026-04-20 18:21:34 +02:00
config.ts feat(ai-tools): server-side web-research + contacts for agents 2026-04-16 12:25:45 +02:00
index.ts feat(ai): Mission Grant consent UI + Workbench audit tab 2026-04-15 13:53:11 +02:00
metrics.ts feat(mana-ai): server-side token budget enforcement per agent 2026-04-16 14:41:31 +02:00
tracing.ts feat(mana-ai): OpenTelemetry tracing + Grafana Tempo backend 2026-04-16 15:21:23 +02:00