fix(cli): add --format flag to session export command per spec #1451 #1482

Open
freemo wants to merge 7 commits from bugfix/session-export-format-flag into master

7 Commits

Author SHA1 Message Date
CleverAgents Bot f3467d67b0 fix(cli): restore session command behavior for export flag
CI / push-validation (pull_request) Successful in 45s
CI / lint (pull_request) Successful in 51s
CI / helm (pull_request) Successful in 49s
CI / build (pull_request) Successful in 1m12s
CI / quality (pull_request) Successful in 1m19s
CI / typecheck (pull_request) Successful in 1m42s
CI / security (pull_request) Successful in 1m42s
CI / integration_tests (pull_request) Failing after 15m32s
CI / unit_tests (pull_request) Failing after 15m33s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
2026-06-18 12:07:44 -04:00
controller-ci-rerun 72a0a7886f chore: re-trigger CI [controller]
CI / lint (pull_request) Successful in 36s
CI / push-validation (pull_request) Successful in 28s
CI / helm (pull_request) Successful in 36s
CI / build (pull_request) Successful in 42s
CI / quality (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 1m13s
CI / security (pull_request) Successful in 1m19s
CI / unit_tests (pull_request) Failing after 5m54s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 10m24s
CI / status-check (pull_request) Failing after 3s
2026-06-14 17:24:24 -04:00
brent.edwards 0588495007 fix(cli): fix broken merge state in session command per spec #1451
CI / lint (pull_request) Failing after 1s
CI / typecheck (pull_request) Failing after 1s
CI / security (pull_request) Failing after 1s
CI / quality (pull_request) Failing after 1s
CI / unit_tests (pull_request) Failing after 1s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 0s
CI / build (pull_request) Failing after 0s
CI / helm (pull_request) Failing after 1s
CI / push-validation (pull_request) Failing after 1s
CI / status-check (pull_request) Failing after 0s
The PR 1482 merge of master into bugfix/session-export-format-flag left
multiple broken states:

1. delete(): Orphaned else block without matching if/elif — removed
   the orphaned structure that references deleted fmt/message_count vars.

2. export_session(): Multiple unbound variable references (json_data instead
   of data, fmt instead of output_format) and a call to deleted
   _render_export_panels function — fixed all references and removed the
   Rich panel rendering block since CLI export is JSON-only per spec §1986.

3. import_session(): References to deleted schema_version and actor_name
   variables in structured output envelope — replaced with data.get() calls.

4. _facade_dispatch(): Changed A2aRequest constructor from operation= to
   method= (matching the actual model field name) and response attributes
   from .status/.data to .error/.result (matching A2aResponse model).

5. Added --format flag to export_session() that explicitly rejects non-JSON
   data format values (md, xml, etc.) since CLI export is JSON-only per spec.
   Use TUI /session:export --format md for Markdown export instead.

6. Updated robot integration tests (helper_session_cli.py, session_cli.robot)
   to expect JSON output instead of Rich panels for file and stdout export.
2026-06-10 00:21:47 +00:00
brent.edwards 3d2c106e6c Merge branch 'master' into bugfix/session-export-format-flag
CI / lint (pull_request) Failing after 38s
CI / quality (pull_request) Successful in 50s
CI / typecheck (pull_request) Failing after 1m10s
CI / security (pull_request) Failing after 1m11s
CI / build (pull_request) Successful in 41s
CI / helm (pull_request) Successful in 34s
CI / integration_tests (pull_request) Failing after 58s
CI / push-validation (pull_request) Successful in 29s
CI / unit_tests (pull_request) Has been cancelled
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
2026-06-03 19:26:08 -07:00
controller-ci-rerun f41a884f96 chore: re-trigger CI [controller] 2026-05-30 01:33:56 -04:00
HAL9000 f8f7c1cbfa fix(cli): remove --format flag from session export per spec
Remove the --format/-f flag from the CLI `agents session export` command
to align with spec §1986, which defines the command as JSON-only:

    agents session export [(--output|-o) <FILE>] <SESSION_ID>

The --format md (Markdown) option is only specified for the TUI slash
command /session:export --format md, not for the CLI command.

Changes:
- src/cleveragents/cli/commands/session.py: Remove fmt parameter and
  Markdown export branch from export_session(); remove unused SessionMessage
  import; update docstring to reference spec §1986
- benchmarks/session_model_bench.py: Remove two broken @click.option
  decorators that were incorrectly inserted between method definitions
  (click not imported, decorators applied to wrong functions, breaks ASV)
- features/tui_session_export_import.feature: Update CLI export scenarios
to reflect JSON-only behavior; add @tdd_issue and @tdd_issue_1451 tags
- features/steps/tui_thought_block_steps.py: Restore original step names
  (thought block rendered text should contain) to fix AmbiguousStep conflict
  with tui_first_run_steps.py
- features/tui_thought_block.feature: Update step references to match
  restored step names

ISSUES CLOSED: #1451
2026-05-30 01:33:56 -04:00
freemo 62347d830f fix(cli): add --format flag to session export command per spec #1451
Fixes #1451

Added --format/-f flag to agents session export command
as required by the specification. Supports json, yaml, and toml formats.
2026-05-30 01:33:56 -04:00