UAT: Missing --config-path global CLI flag — ADR-021 requires it to override core.config-path #4755

Open
opened 2026-04-08 18:53:35 +00:00 by HAL9000 · 1 comment
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 --config-path flag should allow users to point to an alternate config file for a single invocation.

Expected usage:

agents --config-path /etc/cleveragents/prod.toml plan list
agents --config-path ~/projects/myapp/.cleveragents/config.toml info

Actual Behavior

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

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

The --config-path 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 --config-path flag here

The CLEVERAGENTS_CONFIG_PATH env var is used in system.py (line 113) and config.py (line 51) to locate the config file, but there is no --config-path CLI flag to set it per-invocation.

Steps to Reproduce

agents --config-path /tmp/test-config.toml info
# Error: No such option: --config-path

Code Location

  • src/cleveragents/cli/main.pymain_callback function (lines 293–334)
  • src/cleveragents/cli/commands/system.py — uses CLEVERAGENTS_CONFIG_PATH env var (line 113)
  • src/cleveragents/cli/commands/config.py_CONFIG_PATH constant (line 51)

Fix Required

Add --config-path to main_callback and wire it to set CLEVERAGENTS_CONFIG_PATH before any service initialization:

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

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 `--config-path` flag should allow users to point to an alternate config file for a single invocation. **Expected usage:** ```bash agents --config-path /etc/cleveragents/prod.toml plan list agents --config-path ~/projects/myapp/.cleveragents/config.toml info ``` ## Actual Behavior The `main_callback` in `src/cleveragents/cli/main.py` only defines three global flags: - `--version` - `--show-secrets` - `--format` The `--config-path` 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 --config-path flag here ``` The `CLEVERAGENTS_CONFIG_PATH` env var is used in `system.py` (line 113) and `config.py` (line 51) to locate the config file, but there is no `--config-path` CLI flag to set it per-invocation. ## Steps to Reproduce ```bash agents --config-path /tmp/test-config.toml info # Error: No such option: --config-path ``` ## Code Location - `src/cleveragents/cli/main.py` — `main_callback` function (lines 293–334) - `src/cleveragents/cli/commands/system.py` — uses `CLEVERAGENTS_CONFIG_PATH` env var (line 113) - `src/cleveragents/cli/commands/config.py` — `_CONFIG_PATH` constant (line 51) ## Fix Required Add `--config-path` to `main_callback` and wire it to set `CLEVERAGENTS_CONFIG_PATH` before any service initialization: ```python @app.callback() def main_callback( ctx: typer.Context, ... config_path: Annotated[ Path | None, typer.Option("--config-path", help="Override core.config-path for this invocation"), ] = None, ) -> None: if config_path is not None: os.environ["CLEVERAGENTS_CONFIG_PATH"] = str(config_path) ... ``` ## 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:10 +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#4755
No description provided.