Skip to content

Add maxTokenBudget with automatic abort #515

@ibrahimkzmv

Description

@ibrahimkzmv

Issue:

  • There is currently no mechanism to enforce a budget or abort when spending exceeds a threshold.
  • A single agent stuck in a tool loop can consume thousands of tokens per turn.
  • Users running against paid APIs (e.g., Anthropic, OpenAI) have no safeguards against runaway costs.
  • Implementing token budget enforcement would be high-value and low-effort.

Proposed implementation:

  • Allow passing a max_token_budget configuration value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions