- Add `cost` field to `_plan_spec_dict` in plan.py so `plan status --format
json` includes cost metadata in output (was previously omitted)
- Fix `_make_plan_with_cost` helper: replace broken
`Plan.namespaced_name.__class__(...)` (returns FieldInfo, not NamespacedName)
with `NamespacedName.parse("local/test-plan")`; add `NamespacedName` import
- Remove `<plan_id>` / `<session_id>` angle-bracket placeholders from feature
file When steps: these are not Scenario Outline templates so they were
passed literally to `_validate_plan_ulid()` which rejected them; steps now
use `context.plan_id` / `context.session_id` set by the Given steps
- Rename `I run plan status for the plan` step to
`I run plan status for the plan with cost reporting` to avoid AmbiguousStep
collision with `plan_cli_spec_alignment_steps.py`
- Fix session `estimated_cost` assertions: the value is nested under
`token_usage` (not top-level) and is a formatted string `"$0.0080"`,
not a float
- Apply ruff format to step file
ISSUES CLOSED: #5250
Rewrite cost_reporting_cli_steps.py to properly test plan status and
session show cost reporting in CLI output.
- Add @when step implementations that execute CLI via CliRunner
- Add proper @given fixtures that create Plan and Session domain objects
with CostMetadata/SessionTokenUsage data
- Replace setattr-based assertions with direct context.result assertions
- Import json module and add _unwrap_envelope helper for CLI spec envelopes
- Follow existing test patterns from session_cli_steps.py
Closes#10616
---
Automated by CleverAgents Bot
Supervisor: PR Fix | Agent: task-implementor
Added BDD feature file and step implementations for cost reporting in CLI commands.
- Plan status now includes cost metadata in JSON output
- Session show includes estimated cost in JSON output
- Both commands display cost information in rich output format
ISSUES CLOSED: #5250