6c672c0ab2
- 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
33 lines
1.4 KiB
Gherkin
33 lines
1.4 KiB
Gherkin
Feature: Cost reporting in plan status and session show CLI output
|
|
As a user
|
|
I want to see cost information in the plan status and session show commands
|
|
So that I can track how much I've spent on plans and sessions
|
|
|
|
Scenario: Plan status JSON output includes cost field
|
|
Given a plan status CLI runner with mocked service
|
|
And a plan exists with cost metadata
|
|
When I run plan status --format json for the plan
|
|
Then the JSON output contains a "cost" field
|
|
And the cost field contains cost metadata
|
|
|
|
Scenario: Session show JSON output includes estimated cost
|
|
Given a session show CLI runner with mocked service
|
|
And a session exists with token usage
|
|
When I run session show --format json for the session
|
|
Then the JSON output contains "estimated_cost" field
|
|
And the estimated_cost is properly formatted as currency
|
|
|
|
Scenario: Plan status rich output displays cost panel
|
|
Given a plan status CLI runner with mocked service
|
|
And a plan exists with cost metadata
|
|
When I run plan status for the plan with cost reporting
|
|
Then the output contains cost information
|
|
And the cost information is properly formatted
|
|
|
|
Scenario: Session show rich output displays cost information
|
|
Given a session show CLI runner with mocked service
|
|
And a session exists with token usage
|
|
When I run session show for the session
|
|
Then the output contains cost information
|
|
And the cost information is properly formatted
|