fix(session): correct field names and data types in Session.as_cli_dict() for spec compliance #3461

Merged
freemo merged 1 commits from bugfix/session-show-as-cli-dict-field-names into master 2026-04-05 18:19:20 +00:00

1 Commits

Author SHA1 Message Date
freemo c1ab8c86b3 fix(session): correct field names and data types in Session.as_cli_dict() for spec compliance
CI / lint (pull_request) Successful in 32s
CI / quality (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 54s
CI / security (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 28s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 6m47s
CI / e2e_tests (pull_request) Successful in 17m15s
CI / integration_tests (pull_request) Failing after 22m54s
CI / docker (pull_request) Successful in 1m22s
CI / coverage (pull_request) Successful in 11m0s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m15s
Fixes issue #3440: agents session show JSON output uses wrong field names
and wrong data types for recent_messages and linked_plans.

Changes:
- Add LinkedPlan value object to session domain model with plan_id, phase,
  state fields for spec-compliant linked_plans output
- Add automation field to Session domain model for automation profile name
- Rewrite as_cli_dict() to produce spec-compliant output:
  - Wrap session fields in session_summary sub-dict
  - Rename session_id -> id, actor_name -> actor, message_count -> messages,
    created_at -> created, updated_at -> updated
  - Remove namespace from session_summary (not in spec)
  - Add automation field to session_summary
  - Use 'text' key (not 'content') in recent_messages items
  - Replace linked_plan_ids (flat list) with linked_plans (list of objects
    with plan_id, phase, state)
  - Format estimated_cost as string (e.g. '$0.0184') not raw float
- Update session show rich output to use spec-compliant labels and
  render linked_plans as a table with Plan ID / Phase / State columns
- Update consolidated_domain_models.feature tests to assert new field names
- Add new Behave step definitions for spec-compliant field assertions
- Export LinkedPlan from domain models core __init__.py

ISSUES CLOSED: #3440
2026-04-05 17:56:02 +00:00