UAT: agents diagnostics config file check defaults to relative config.toml instead of ~/.cleveragents/config.toml #3660

Open
opened 2026-04-05 21:12:40 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/diagnostics-config-default-path
  • Commit Message: fix(cli): default config path in diagnostics to ~/.cleveragents/config.toml
  • Milestone: (none — see backlog note below)
  • Parent Epic: #397

Description

The _check_config_file() function in src/cleveragents/cli/commands/system.py (lines 159–174) defaults to checking a relative path "config.toml" when CLEVERAGENTS_CONFIG_PATH is not set:

def _check_config_file() -> dict[str, Any]:
    """Check that the config path is readable."""
    config_path = Path(
        os.environ.get(
            "CLEVERAGENTS_CONFIG_PATH",
            "config.toml",  # ← BUG: should be ~/.cleveragents/config.toml
        )
    )

Expected behavior (from spec):
The default config path is ~/.cleveragents/config.toml. When CLEVERAGENTS_CONFIG_PATH is not set, agents diagnostics should check ~/.cleveragents/config.toml.

Actual behavior:
agents diagnostics checks <current working directory>/config.toml instead of ~/.cleveragents/config.toml. This means:

  1. If the user runs agents diagnostics from a directory that doesn't have a config.toml, the check reports "Config file: not found" even though ~/.cleveragents/config.toml exists and is readable.
  2. If the user runs from a directory that happens to have a config.toml (e.g., a project directory), the wrong file is checked.

Code location: src/cleveragents/cli/commands/system.py, line 164 — "config.toml" should be str(Path.home() / ".cleveragents" / "config.toml").

Note: The same function also appears in build_info_data() at line 112–116, where the fallback is str(settings.storage_path / "config.toml") — this is also incorrect since settings.storage_path defaults to <cwd>/data (see related bug #3645).

Steps to reproduce:

  1. Ensure ~/.cleveragents/config.toml exists.
  2. Run agents diagnostics from a directory that does NOT have a config.toml.
  3. Observe: "Config file: not found" even though the file exists at ~/.cleveragents/config.toml.

Subtasks

  • Change the fallback in _check_config_file() from "config.toml" to str(Path.home() / ".cleveragents" / "config.toml") in src/cleveragents/cli/commands/system.py (line 164)
  • Also fix build_info_data() at line 112–116 to use the correct default config path
  • Write Behave unit test scenarios verifying agents diagnostics checks the correct config path
  • Verify nox -e typecheck passes
  • Verify nox -e unit_tests passes with coverage >= 97%

Definition of Done

  • agents diagnostics checks ~/.cleveragents/config.toml by default when CLEVERAGENTS_CONFIG_PATH is not set
  • agents info reports the correct config path by default
  • Behave unit tests cover the correct default config path
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/diagnostics-config-default-path` - **Commit Message**: `fix(cli): default config path in diagnostics to ~/.cleveragents/config.toml` - **Milestone**: *(none — see backlog note below)* - **Parent Epic**: #397 ## Description The `_check_config_file()` function in `src/cleveragents/cli/commands/system.py` (lines 159–174) defaults to checking a relative path `"config.toml"` when `CLEVERAGENTS_CONFIG_PATH` is not set: ```python def _check_config_file() -> dict[str, Any]: """Check that the config path is readable.""" config_path = Path( os.environ.get( "CLEVERAGENTS_CONFIG_PATH", "config.toml", # ← BUG: should be ~/.cleveragents/config.toml ) ) ``` **Expected behavior** (from spec): The default config path is `~/.cleveragents/config.toml`. When `CLEVERAGENTS_CONFIG_PATH` is not set, `agents diagnostics` should check `~/.cleveragents/config.toml`. **Actual behavior**: `agents diagnostics` checks `<current working directory>/config.toml` instead of `~/.cleveragents/config.toml`. This means: 1. If the user runs `agents diagnostics` from a directory that doesn't have a `config.toml`, the check reports "Config file: not found" even though `~/.cleveragents/config.toml` exists and is readable. 2. If the user runs from a directory that happens to have a `config.toml` (e.g., a project directory), the wrong file is checked. **Code location**: `src/cleveragents/cli/commands/system.py`, line 164 — `"config.toml"` should be `str(Path.home() / ".cleveragents" / "config.toml")`. **Note**: The same function also appears in `build_info_data()` at line 112–116, where the fallback is `str(settings.storage_path / "config.toml")` — this is also incorrect since `settings.storage_path` defaults to `<cwd>/data` (see related bug #3645). **Steps to reproduce**: 1. Ensure `~/.cleveragents/config.toml` exists. 2. Run `agents diagnostics` from a directory that does NOT have a `config.toml`. 3. Observe: "Config file: not found" even though the file exists at `~/.cleveragents/config.toml`. ## Subtasks - [ ] Change the fallback in `_check_config_file()` from `"config.toml"` to `str(Path.home() / ".cleveragents" / "config.toml")` in `src/cleveragents/cli/commands/system.py` (line 164) - [ ] Also fix `build_info_data()` at line 112–116 to use the correct default config path - [ ] Write Behave unit test scenarios verifying `agents diagnostics` checks the correct config path - [ ] Verify `nox -e typecheck` passes - [ ] Verify `nox -e unit_tests` passes with coverage >= 97% ## Definition of Done - [ ] `agents diagnostics` checks `~/.cleveragents/config.toml` by default when `CLEVERAGENTS_CONFIG_PATH` is not set - [ ] `agents info` reports the correct config path by default - [ ] Behave unit tests cover the correct default config path - [ ] All nox stages pass - [ ] Coverage >= 97% --- > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Backlog — Diagnostics command usability issue. The command works but checks the wrong config path by default.
  • Milestone: None (backlog)
  • Story Points: 1 — XS — Single-line path string change in 2 locations.
  • MoSCoW: Could Have — The diagnostics command is a developer/debugging tool. The incorrect default path is confusing but doesn't affect core functionality. Related to #3645 (Settings.data_dir default).
  • Parent Epic: #397

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Backlog — Diagnostics command usability issue. The command works but checks the wrong config path by default. - **Milestone**: None (backlog) - **Story Points**: 1 — XS — Single-line path string change in 2 locations. - **MoSCoW**: Could Have — The diagnostics command is a developer/debugging tool. The incorrect default path is confusing but doesn't affect core functionality. Related to #3645 (Settings.data_dir default). - **Parent Epic**: #397 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3660
No description provided.