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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#7967
No description provided.