feat(budget): implement budget enforcement in PlanExecutor with halt-on-exceeded behavior #10143

Open
opened 2026-04-17 03:56:51 +00:00 by HAL9000 · 0 comments
Owner

Background

Budget enforcement requires the PlanExecutor to check remaining budget before each LLM call and halt plan execution gracefully when the budget is exceeded. This prevents runaway costs in production and provides clear feedback to users when their spending limit is reached.

Acceptance Criteria

  • PlanExecutor checks remaining budget before each LLM call
  • Plan execution halts gracefully when budget is exceeded
  • BudgetExceededError raised with remaining budget and total spent information
  • Budget configuration loaded from automation profile YAML (budget.max_cost_usd, budget.max_tokens)
  • Test coverage >= 97%

Metadata

  • Commit Message: feat(budget): implement budget enforcement in PlanExecutor with halt-on-exceeded behavior
  • Branch: feature/v3.6.0/budget-enforcement
  • Milestone: v3.6.0
  • Ref: #5178 EPIC: Cost & Session Budget Enforcement — Spending Limits & Safety Profiles (v3.6.0)

Subtasks

  • Add budget configuration fields to automation profile YAML schema
  • Implement pre-call budget check in PlanExecutor
  • Implement BudgetExceededError with context information
  • Implement graceful plan halt with partial result preservation
  • Write unit tests for budget enforcement scenarios

Definition of Done

  • Implementation complete and all acceptance criteria met
  • Tests written and passing (coverage >= 97%)
  • PR reviewed and merged
  • Parent epic updated

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Background Budget enforcement requires the PlanExecutor to check remaining budget before each LLM call and halt plan execution gracefully when the budget is exceeded. This prevents runaway costs in production and provides clear feedback to users when their spending limit is reached. ## Acceptance Criteria - [ ] `PlanExecutor` checks remaining budget before each LLM call - [ ] Plan execution halts gracefully when budget is exceeded - [ ] `BudgetExceededError` raised with remaining budget and total spent information - [ ] Budget configuration loaded from automation profile YAML (`budget.max_cost_usd`, `budget.max_tokens`) - [ ] Test coverage >= 97% ## Metadata - **Commit Message**: `feat(budget): implement budget enforcement in PlanExecutor with halt-on-exceeded behavior` - **Branch**: `feature/v3.6.0/budget-enforcement` - **Milestone**: v3.6.0 - **Ref**: #5178 EPIC: Cost & Session Budget Enforcement — Spending Limits & Safety Profiles (v3.6.0) ## Subtasks - [ ] Add budget configuration fields to automation profile YAML schema - [ ] Implement pre-call budget check in `PlanExecutor` - [ ] Implement `BudgetExceededError` with context information - [ ] Implement graceful plan halt with partial result preservation - [ ] Write unit tests for budget enforcement scenarios ## Definition of Done - Implementation complete and all acceptance criteria met - Tests written and passing (coverage >= 97%) - PR reviewed and merged - Parent epic updated --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10143
No description provided.