feat(budget): implement budget enforcement in PlanExecutor (halt on budget exceeded) #5249

Open
opened 2026-04-09 04:03:41 +00:00 by HAL9000 · 1 comment
Owner

Background

Part of Epic #5178 (Cost & Session Budget Enforcement). Implements budget enforcement in the PlanExecutor that halts plan execution when configured spending limits are exceeded.

Expected Behavior

  • PlanExecutor checks budget before each LLM call
  • If session budget exceeded: halt with BudgetExceededError
  • If plan budget exceeded: halt with PlanBudgetExceededError
  • Budget limits configured in automation profile YAML
  • Graceful halt: save plan state before stopping

Subtasks

  • Add budget limit fields to automation profile YAML schema
  • Implement budget check in PlanExecutor before each LLM call
  • Implement graceful halt with state save on budget exceeded
  • Add BudgetExceededError and PlanBudgetExceededError exceptions
  • Write Behave unit tests for budget enforcement scenarios

Definition of Done

  • Budget enforcement halts execution correctly
  • Plan state saved before halt
  • Error messages are clear and actionable
  • All nox stages pass
  • Coverage >= 97%

Metadata

  • Branch: feat/v3.6.0/budget-enforcement
  • Commit Message: feat(budget): implement budget enforcement in PlanExecutor
  • Milestone: v3.6.0
  • Parent Epic: #5178
  • Depends on: #5248 (CostTracker must exist first)

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Background Part of Epic #5178 (Cost & Session Budget Enforcement). Implements budget enforcement in the `PlanExecutor` that halts plan execution when configured spending limits are exceeded. ## Expected Behavior - `PlanExecutor` checks budget before each LLM call - If session budget exceeded: halt with `BudgetExceededError` - If plan budget exceeded: halt with `PlanBudgetExceededError` - Budget limits configured in automation profile YAML - Graceful halt: save plan state before stopping ## Subtasks - [ ] Add budget limit fields to automation profile YAML schema - [ ] Implement budget check in `PlanExecutor` before each LLM call - [ ] Implement graceful halt with state save on budget exceeded - [ ] Add `BudgetExceededError` and `PlanBudgetExceededError` exceptions - [ ] Write Behave unit tests for budget enforcement scenarios ## Definition of Done - [ ] Budget enforcement halts execution correctly - [ ] Plan state saved before halt - [ ] Error messages are clear and actionable - [ ] All nox stages pass - [ ] Coverage >= 97% ## Metadata - **Branch**: `feat/v3.6.0/budget-enforcement` - **Commit Message**: `feat(budget): implement budget enforcement in PlanExecutor` - **Milestone**: v3.6.0 - **Parent Epic**: #5178 - **Depends on**: #5248 (CostTracker must exist first) --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.6.0 milestone 2026-04-09 04:03:56 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — budget enforcement and cost reporting are required for v3.6.0 milestone
  • Story Points: 5 (L) — substantial implementation work
  • MoSCoW: Must Have — budget enforcement is a safety-critical feature for autonomous agent operation
  • Assignee: HAL9000 — default assignment to maintain velocity

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High — budget enforcement and cost reporting are required for v3.6.0 milestone - **Story Points**: 5 (L) — substantial implementation work - **MoSCoW**: Must Have — budget enforcement is a safety-critical feature for autonomous agent operation - **Assignee**: HAL9000 — default assignment to maintain velocity --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 self-assigned this 2026-04-09 04:04:31 +00:00
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.

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