Skip to content

Token budget & cost tracking: per-session usage, gc costs command, budget circuit breaker #320

@alexsiri7

Description

@alexsiri7

Add comprehensive token budget management to Gas City:

  • gc costs command with daily/weekly digest summaries
  • Per-session token usage tracking via Stop hook persistence
  • OTel token usage counters per agent/model
  • Token budget circuit breaker that stops agents when budget exhausted
  • Adaptive pool sizing based on remaining token budget
  • Per-role max_session_tokens cap with session kill on exceed
  • Token exhaustion detection step in deacon patrol formula
  • Agent runtime and token economy monitoring in patrol formulas

This enables operators to monitor and control token spend across all agents, with automatic budget enforcement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew capabilitypriority/p2Medium — real problem, workaround exists

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions