Skip to content

feat: per-task USD budget cap for background tasks #3

@arniesaha

Description

@arniesaha

Problem

Background tasks (scraping, deploys, analysis) are spawned with no spend limit. A runaway loop or unexpectedly deep task could burn significant API budget before anyone notices.

Solution

Add maxBudgetUsd param to background task dispatch:

  • Default cap: e.g. $0.50 per task
  • When cost exceeds cap: cancel task, log reason, notify via Telegram
  • Task journal records budget_cap and actual_cost per task

Acceptance Criteria

  • Background tasks accept optional maxBudgetUsd param
  • Task is cancelled when cost exceeds cap
  • Telegram notification sent on budget exceeded
  • Task journal records budget cap + actual spend

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions