UAT: Missing --data-dir global CLI flag — ADR-021 requires it to override core.data-dir #4753

Closed
opened 2026-04-08 18:53:27 +00:00 by HAL9000 · 2 comments
Owner

Bug Report

Feature area: CLI global options
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 --data-dir flag should allow users to override the data directory for a single invocation without modifying environment variables or config files.

Expected usage:

agents --data-dir /tmp/test-data version
agents --data-dir /custom/path plan list

Actual Behavior

The main_callback in src/cleveragents/cli/main.py only defines three global flags:

  • --version
  • --show-secrets
  • --format

The --data-dir flag is completely absent from the CLI.

# 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:
    # NO --data-dir flag here

While Settings.data_dir reads from CLEVERAGENTS_DATA_DIR env var, there is no --data-dir CLI flag to override it per-invocation.

Steps to Reproduce

agents --data-dir /tmp/test-data version
# Error: No such option: --data-dir

Code Location

  • src/cleveragents/cli/main.pymain_callback function (lines 293–334)
  • src/cleveragents/config/settings.pydata_dir field (line 166)

Fix Required

Add --data-dir to main_callback and wire it to override settings.data_dir before any service initialization:

@app.callback()
def main_callback(
    ctx: typer.Context,
    ...
    data_dir: Annotated[
        Path | None,
        typer.Option("--data-dir", help="Override core.data-dir for this invocation"),
    ] = None,
) -> None:
    if data_dir is not None:
        os.environ["CLEVERAGENTS_DATA_DIR"] = str(data_dir)
    ...

References

  • ADR-021 §Global CLI Flags table
  • 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 **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 `--data-dir` flag should allow users to override the data directory for a single invocation without modifying environment variables or config files. **Expected usage:** ```bash agents --data-dir /tmp/test-data version agents --data-dir /custom/path plan list ``` ## Actual Behavior The `main_callback` in `src/cleveragents/cli/main.py` only defines three global flags: - `--version` - `--show-secrets` - `--format` The `--data-dir` flag is **completely absent** from the CLI. ```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: # NO --data-dir flag here ``` While `Settings.data_dir` reads from `CLEVERAGENTS_DATA_DIR` env var, there is no `--data-dir` CLI flag to override it per-invocation. ## Steps to Reproduce ```bash agents --data-dir /tmp/test-data version # Error: No such option: --data-dir ``` ## Code Location - `src/cleveragents/cli/main.py` — `main_callback` function (lines 293–334) - `src/cleveragents/config/settings.py` — `data_dir` field (line 166) ## Fix Required Add `--data-dir` to `main_callback` and wire it to override `settings.data_dir` before any service initialization: ```python @app.callback() def main_callback( ctx: typer.Context, ... data_dir: Annotated[ Path | None, typer.Option("--data-dir", help="Override core.data-dir for this invocation"), ] = None, ) -> None: if data_dir is not None: os.environ["CLEVERAGENTS_DATA_DIR"] = str(data_dir) ... ``` ## References - ADR-021 §Global CLI Flags table - `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:05:11 +00:00
Member

dup with #6785

dup with #6785
hurui200320 2026-05-11 06:19:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#4753
No description provided.