UAT: Missing global -v verbosity levels — ADR-021 requires -v through -vvvvv for log level control #4763

Open
opened 2026-04-08 18:54:48 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature area: CLI global options / verbosity
Severity: Medium
Discovered by: UAT Testing (uat-tester-cli-rendering-001)


Expected Behavior (from ADR-021)

ADR-021 specifies the following global CLI flags:

Flag Description
--format Output format (6 options)
--data-dir Override core.data-dir
--config-path Override core.config-path
-v through -vvvvv Verbosity (ERROR → WARN → INFO → DEBUG → TRACE)

The -v flag (stackable) should control log verbosity:

  • (no flag) → ERROR
  • -v → WARN
  • -vv → INFO
  • -vvv → DEBUG
  • -vvvv → TRACE
  • -vvvvv → TRACE (max)

Expected usage:

agents -vvv plan list    # DEBUG level logging
agents -v info           # WARN level logging
agents --verbose plan list  # same as -v

Actual Behavior

The main_callback in src/cleveragents/cli/main.py does NOT have a global -v verbosity flag. Instead:

  1. The main callback hardcodes configure_structlog(log_level="WARNING") for all commands
  2. Individual commands like actor and actor_run have their own --verbose/-v flag, but it's a boolean/count flag for "show detailed output" — not a global log level control
  3. The build command has --verbose/-v as a boolean flag for "Show detailed output"
# src/cleveragents/cli/main.py lines 293-334
@app.callback()
def main_callback(
    ctx: typer.Context,
    version: bool = typer.Option(...),
    show_secrets: bool = typer.Option(...),
    fmt: Annotated[OutputFormat, typer.Option("--format", "-f", ...)] = OutputFormat.RICH,
) -> None:
    configure_structlog(log_level="WARNING")  # Hardcoded! No -v flag

Steps to Reproduce

agents -vvv plan list
# Error: No such option: -v (or unexpected behavior)

agents -v info
# Error: No such option: -v

Code Location

  • src/cleveragents/cli/main.pymain_callback function (lines 293–334)
  • src/cleveragents/config/logging.pyconfigure_structlog() function

Fix Required

Add a stackable -v count option to main_callback that maps to log levels:

_VERBOSITY_LEVELS = ["ERROR", "WARNING", "INFO", "DEBUG", "TRACE"]

@app.callback()
def main_callback(
    ctx: typer.Context,
    ...
    verbose: Annotated[
        int,
        typer.Option("--verbose", "-v", count=True, help="Increase verbosity (-v WARN, -vv INFO, -vvv DEBUG, -vvvv TRACE)"),
    ] = 0,
) -> None:
    log_level = _VERBOSITY_LEVELS[min(verbose, len(_VERBOSITY_LEVELS) - 1)]
    configure_structlog(log_level=log_level)
    ...

Note: The ADR-021 constraint says "Log output from -v flags goes to stderr (or the configured core.log.terminal-stream), never to stdout, to avoid contaminating structured output."

References

  • ADR-021 §Global CLI Flags table
  • ADR-021 §Constraints: "Log output from -v flags goes to stderr"
  • src/cleveragents/cli/main.py lines 293–334

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

## Bug Report **Feature area:** CLI global options / verbosity **Severity:** Medium **Discovered by:** UAT Testing (uat-tester-cli-rendering-001) --- ## Expected Behavior (from ADR-021) ADR-021 specifies the following global CLI flags: | Flag | Description | |------|-------------| | `--format` | Output format (6 options) | | `--data-dir` | Override `core.data-dir` | | `--config-path` | Override `core.config-path` | | `-v` through `-vvvvv` | Verbosity (ERROR → WARN → INFO → DEBUG → TRACE) | The `-v` flag (stackable) should control log verbosity: - (no flag) → ERROR - `-v` → WARN - `-vv` → INFO - `-vvv` → DEBUG - `-vvvv` → TRACE - `-vvvvv` → TRACE (max) **Expected usage:** ```bash agents -vvv plan list # DEBUG level logging agents -v info # WARN level logging agents --verbose plan list # same as -v ``` ## Actual Behavior The `main_callback` in `src/cleveragents/cli/main.py` does NOT have a global `-v` verbosity flag. Instead: 1. The main callback hardcodes `configure_structlog(log_level="WARNING")` for all commands 2. Individual commands like `actor` and `actor_run` have their own `--verbose/-v` flag, but it's a boolean/count flag for "show detailed output" — not a global log level control 3. The `build` command has `--verbose/-v` as a boolean flag for "Show detailed output" ```python # src/cleveragents/cli/main.py lines 293-334 @app.callback() def main_callback( ctx: typer.Context, version: bool = typer.Option(...), show_secrets: bool = typer.Option(...), fmt: Annotated[OutputFormat, typer.Option("--format", "-f", ...)] = OutputFormat.RICH, ) -> None: configure_structlog(log_level="WARNING") # Hardcoded! No -v flag ``` ## Steps to Reproduce ```bash agents -vvv plan list # Error: No such option: -v (or unexpected behavior) agents -v info # Error: No such option: -v ``` ## Code Location - `src/cleveragents/cli/main.py` — `main_callback` function (lines 293–334) - `src/cleveragents/config/logging.py` — `configure_structlog()` function ## Fix Required Add a stackable `-v` count option to `main_callback` that maps to log levels: ```python _VERBOSITY_LEVELS = ["ERROR", "WARNING", "INFO", "DEBUG", "TRACE"] @app.callback() def main_callback( ctx: typer.Context, ... verbose: Annotated[ int, typer.Option("--verbose", "-v", count=True, help="Increase verbosity (-v WARN, -vv INFO, -vvv DEBUG, -vvvv TRACE)"), ] = 0, ) -> None: log_level = _VERBOSITY_LEVELS[min(verbose, len(_VERBOSITY_LEVELS) - 1)] configure_structlog(log_level=log_level) ... ``` Note: The ADR-021 constraint says "Log output from `-v` flags goes to stderr (or the configured `core.log.terminal-stream`), never to stdout, to avoid contaminating structured output." ## References - ADR-021 §Global CLI Flags table - ADR-021 §Constraints: "Log output from `-v` flags goes to stderr" - `src/cleveragents/cli/main.py` lines 293–334 --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — spec compliance bug identified by UAT testing
  • Story Points: 3 (M) — targeted fix to align implementation with spec
  • MoSCoW: Must Have — spec compliance is required for correct system behavior

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — spec compliance bug identified by UAT testing - **Story Points**: 3 (M) — targeted fix to align implementation with spec - **MoSCoW**: Must Have — spec compliance is required for correct system behavior --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:04:47 +00:00
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#4763
No description provided.