UAT: Global --format json ignored by subcommands #7967

Open
opened 2026-04-12 16:13:48 +00:00 by HAL9000 · 0 comments
Owner

Summary

  • Feature area: CLI & Output Rendering
  • The global --format flag is not honored by subcommands, so machine-readable formats cannot be requested from the root command, contradicting docs/specification.md (§385, §25893) and features/cli_global_format_flag.feature.

Steps to Reproduce

  1. From the repo root, install dependencies if needed (uv sync).
  2. Run uv run agents --format json action list.
  3. Optionally, run uv run agents action list --format json to show the per-command flag.

Expected Result

  • Per the specification, the global --format flag should apply to all subcommands. action list (and other commands) should emit the JSON envelope when json is requested, even for empty result sets.

Actual Result

  • The command prints plain text guidance:
    No actions found.
    Create one with 'agents action create --config <file>'
    
  • The output lacks the JSON envelope (command, status, data, etc.), so automation cannot parse the result.

Additional Notes

  • features/cli_output_formats.feature and features/cli_json_envelope.feature both assume that subcommands use the shared formatting pipeline. In src/cleveragents/cli/commands/action.py, list_actions returns early when no actions exist and never considers fmt, and the overall command ignores ctx.obj["format"], so the global flag is dropped.
  • Similar patterns appear across other command modules that define their own fmt option defaulting to "rich".

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary - **Feature area:** CLI & Output Rendering - The global `--format` flag is not honored by subcommands, so machine-readable formats cannot be requested from the root command, contradicting docs/specification.md (§385, §25893) and features/cli_global_format_flag.feature. ## Steps to Reproduce 1. From the repo root, install dependencies if needed (`uv sync`). 2. Run `uv run agents --format json action list`. 3. Optionally, run `uv run agents action list --format json` to show the per-command flag. ## Expected Result - Per the specification, the global `--format` flag should apply to all subcommands. `action list` (and other commands) should emit the JSON envelope when `json` is requested, even for empty result sets. ## Actual Result - The command prints plain text guidance: ``` No actions found. Create one with 'agents action create --config <file>' ``` - The output lacks the JSON envelope (`command`, `status`, `data`, etc.), so automation cannot parse the result. ## Additional Notes - `features/cli_output_formats.feature` and `features/cli_json_envelope.feature` both assume that subcommands use the shared formatting pipeline. In `src/cleveragents/cli/commands/action.py`, `list_actions` returns early when no actions exist and never considers `fmt`, and the overall command ignores `ctx.obj["format"]`, so the global flag is dropped. - Similar patterns appear across other command modules that define their own `fmt` option defaulting to `"rich"`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added the
State
Unverified
label 2026-04-12 18:28:32 +00:00
freemo added the
Type
Bug
Priority
Critical
labels 2026-04-12 18:33:23 +00:00
HAL9000 added
State
Verified
and removed
State
Unverified
labels 2026-04-12 19:34:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#7967