feat(cli): add --max-cost budget flag to agents session create and wire CostBudgetService #3373

Open
opened 2026-04-05 14:41:21 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: feat/v3.6.0/session-cost-budget
  • Commit Message: feat(cli): add --max-cost budget flag to agents session create and wire CostBudgetService
  • Milestone: v3.6.0
  • Parent Epic: #3370

Background

Issue #3226 identified that agents session create is missing the --max-cost budget flag. The CostBudgetService exists but has no CLI integration. The specification requires that sessions can be created with a maximum cost budget that is enforced during execution.

Expected Behavior

  • agents session create --max-cost <AMOUNT> creates a session with a cost budget
  • CostBudgetService is wired into the session lifecycle
  • When the session cost exceeds max-cost, execution is halted with a clear error
  • agents session show displays the current cost and budget remaining

Acceptance Criteria

  • agents session create --max-cost <AMOUNT> flag implemented
  • CostBudgetService wired into session creation and tracking
  • Cost budget enforcement halts execution when exceeded
  • agents session show displays cost budget status
  • BDD unit tests cover cost budget enforcement
  • nox -e typecheck passes with no suppressions
  • Coverage >= 97%

Dependencies

  • Blocked by: (none)
  • Blocks: #3370

Subtasks

  • Add --max-cost flag to agents session create CLI
  • Wire CostBudgetService into session creation
  • Implement cost budget enforcement in execution pipeline
  • Update agents session show to display budget status
  • Add BDD feature file for cost budget
  • Add step definitions for cost budget tests
  • Verify nox passes

Definition of Done

  • All subtasks completed
  • Tests written and passing
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: Unknown | Agent: ca-epic-planner

## Metadata - **Branch**: `feat/v3.6.0/session-cost-budget` - **Commit Message**: `feat(cli): add --max-cost budget flag to agents session create and wire CostBudgetService` - **Milestone**: v3.6.0 - **Parent Epic**: #3370 ## Background Issue #3226 identified that `agents session create` is missing the `--max-cost` budget flag. The `CostBudgetService` exists but has no CLI integration. The specification requires that sessions can be created with a maximum cost budget that is enforced during execution. ## Expected Behavior - `agents session create --max-cost <AMOUNT>` creates a session with a cost budget - `CostBudgetService` is wired into the session lifecycle - When the session cost exceeds `max-cost`, execution is halted with a clear error - `agents session show` displays the current cost and budget remaining ## Acceptance Criteria - [ ] `agents session create --max-cost <AMOUNT>` flag implemented - [ ] `CostBudgetService` wired into session creation and tracking - [ ] Cost budget enforcement halts execution when exceeded - [ ] `agents session show` displays cost budget status - [ ] BDD unit tests cover cost budget enforcement - [ ] `nox -e typecheck` passes with no suppressions - [ ] Coverage >= 97% ## Dependencies - Blocked by: (none) - Blocks: #3370 ## Subtasks - [ ] Add `--max-cost` flag to `agents session create` CLI - [ ] Wire `CostBudgetService` into session creation - [ ] Implement cost budget enforcement in execution pipeline - [ ] Update `agents session show` to display budget status - [ ] Add BDD feature file for cost budget - [ ] Add step definitions for cost budget tests - [ ] Verify `nox` passes ## Definition of Done - [ ] All subtasks completed - [ ] Tests written and passing - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-epic-planner
freemo added this to the v3.6.0 milestone 2026-04-05 14:41:41 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Critical — The --max-cost budget flag is required for cost budget enforcement per the specification. Without it, sessions cannot be created with cost limits, making budget enforcement impossible. Identified by UAT #3226.
  • Milestone: v3.6.0 (already set)
  • Story Points: 5 — L — Requires adding CLI flag, wiring CostBudgetService, implementing enforcement in execution pipeline, and updating session show output. Estimated 1-2 days.
  • MoSCoW: Must Have — Cost/session budgets are explicitly scoped to v3.6.0. The specification requires that sessions can be created with a maximum cost budget that is enforced during execution.
  • Parent Epic: #3370

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Critical — The `--max-cost` budget flag is required for cost budget enforcement per the specification. Without it, sessions cannot be created with cost limits, making budget enforcement impossible. Identified by UAT #3226. - **Milestone**: v3.6.0 (already set) - **Story Points**: 5 — L — Requires adding CLI flag, wiring CostBudgetService, implementing enforcement in execution pipeline, and updating session show output. Estimated 1-2 days. - **MoSCoW**: Must Have — Cost/session budgets are explicitly scoped to v3.6.0. The specification requires that sessions can be created with a maximum cost budget that is enforced during execution. - **Parent Epic**: #3370 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo removed this from the v3.6.0 milestone 2026-04-06 23:52:43 +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#3373
No description provided.