fix(cli): fix JSON/YAML envelope messages[].text to show actual content #6739

Merged
HAL9000 merged 5 commits from fix/issue-6457-json-envelope-messages-text into master 2026-06-01 00:34:52 +00:00

5 Commits

Author SHA1 Message Date
HAL9000 9561c3a7be fix(tests): update MCP logger step to match constant usage in source
CI / push-validation (pull_request) Successful in 25s
CI / build (pull_request) Successful in 31s
CI / lint (pull_request) Successful in 38s
CI / helm (pull_request) Successful in 44s
CI / typecheck (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 59s
CI / security (pull_request) Successful in 1m19s
CI / unit_tests (pull_request) Successful in 12m20s
CI / docker (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Successful in 21m17s
CI / coverage (pull_request) Successful in 13m37s
CI / status-check (pull_request) Successful in 4s
The step assertion checked for 'logging.getLogger("cleveragents.mcp")'
literally, but session.py uses the _MCP_LOGGER_NAME constant so
inspect.getsource() returns 'logging.getLogger(_MCP_LOGGER_NAME)'.
Update the assertion to match the actual source text.

ISSUES CLOSED: #6457
2026-05-31 19:27:43 -04:00
HAL9000 c0606ce0ce fix(cli): handle --format color in session delete as Rich output
The delete command's output branch used `fmt == OutputFormat.RICH` which
caused --format color to emit a JSON envelope instead of Rich panels.
Align with all other session commands by checking
`fmt not in (OutputFormat.RICH, OutputFormat.COLOR)` for machine-readable
paths. Add BDD scenario and step for --format color to close the coverage gap.

ISSUES CLOSED: #6457
2026-05-31 19:27:43 -04:00
HAL9000 b1bfaf032e fix(cli): fix JSON/YAML envelope messages[].text for delete/export/import
Extend the JSON/YAML envelope messages[].text fix to cover the remaining
three session subcommands that were still producing plain Rich output
instead of structured envelopes for non-rich format paths:

- session delete: route non-rich formats through format_output() with
  messages=[{"level": "ok", "text": "Session deleted"}]
- session export: add --output-format/-f option; emit structured envelope
  with session_export/contents/integrity data and "Export completed" message
- session import: add --format/-f option; emit structured envelope with
  session_import/validation/merge data and "Import completed" message

Also add BDD scenarios to features/session_cli.feature for each new
envelope path, add corresponding step definitions, add CHANGELOG entry
under [Unreleased] Fixed, and assign milestone v3.2.0 to the PR.

ISSUES CLOSED: #6457
2026-05-31 19:27:43 -04:00
HAL9000 f8946e1147 test(cli): assert container-instance stop mock invocation
Extend the devcontainer cleanup Behave scenario for container-instance resources to assert that the stop command delegates to the lifecycle stop mock, providing regression coverage that both container-instance and devcontainer-instance remain stoppable.

ISSUES CLOSED: #6457
2026-05-31 19:27:43 -04:00
HAL9000 d785397da4 fix(cli): fix JSON/YAML envelope messages[].text to show actual content (#6457) 2026-05-31 19:27:43 -04:00