UAT: core.format config key is registered but never applied — setting it has no effect on CLI output format #2075

Open
opened 2026-04-03 03:50:20 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/core-format-config-key-not-applied
  • Commit Message: fix(cli): read core.format config key to set default output format for all commands
  • Milestone: v3.7.0
  • Parent Epic: #936

Subtasks

  • Identify all CLI command files that define a --format / fmt / output_format option with a hardcoded "rich" default
  • Implement a helper (e.g. in ConfigService or a CLI utility module) that reads core.format and returns the configured default format, falling back to "rich" if unset
  • Update src/cleveragents/cli/commands/config.py to use the config-driven default instead of the hardcoded fmt: str = "rich"
  • Update src/cleveragents/cli/commands/project.py to use the config-driven default instead of the hardcoded output_format: str = "rich"
  • Update src/cleveragents/cli/commands/automation_profile.py to use the config-driven default instead of the hardcoded fmt: str = "rich"
  • Audit and update all remaining CLI command files that hardcode "rich" as the format default
  • Add BDD unit tests (Behave) verifying that each updated command respects core.format when set
  • Add BDD unit tests verifying that commands fall back to "rich" when core.format is not set
  • Add a Robot Framework integration test: agents config set core.format json → subsequent command output is JSON

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Background and Context

The specification states that the output format can be set globally via the core.format config key. This key is registered in ConfigService at src/cleveragents/application/services/config_service.py line 150 with the description "Default output format: rich, color, table, plain, json, yaml." — confirming the feature is intentionally designed.

However, no CLI command reads this config key. Every command that accepts a --format option hardcodes "rich" as the default value, making the core.format config key silently inert.

Current Behavior

  • src/cleveragents/cli/commands/config.py — all commands use hardcoded fmt: str = "rich" as default (~line 100)
  • src/cleveragents/cli/commands/project.py — uses hardcoded output_format: str = "rich" as default
  • src/cleveragents/cli/commands/automation_profile.py — uses hardcoded fmt: str = "rich" as default
  • All other CLI command files — none read core.format from ConfigService

Running agents config set core.format json writes the value to the TOML config file, but every subsequent command still defaults to "rich" format, ignoring the stored preference entirely.

Expected Behavior

Per the specification, when a user sets agents config set core.format json, all subsequent CLI commands should default to JSON output format without requiring --format json on each invocation. The --format flag should still override the config value when explicitly provided.

Steps to Reproduce

  1. Run agents config set core.format json
  2. Run agents config list
  3. Expected: Output is in JSON format (since core.format is set to json)
  4. Actual: Output is in rich table format — the hardcoded default "rich" is used; the config value is ignored

Spec Reference

docs/specification.md — Output Rendering Framework section; core.format config key definition. The ConfigService registry entry at src/cleveragents/application/services/config_service.py line 150 confirms the key is intentionally registered.


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

## Metadata - **Branch**: `fix/core-format-config-key-not-applied` - **Commit Message**: `fix(cli): read core.format config key to set default output format for all commands` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Subtasks - [ ] Identify all CLI command files that define a `--format` / `fmt` / `output_format` option with a hardcoded `"rich"` default - [ ] Implement a helper (e.g. in `ConfigService` or a CLI utility module) that reads `core.format` and returns the configured default format, falling back to `"rich"` if unset - [ ] Update `src/cleveragents/cli/commands/config.py` to use the config-driven default instead of the hardcoded `fmt: str = "rich"` - [ ] Update `src/cleveragents/cli/commands/project.py` to use the config-driven default instead of the hardcoded `output_format: str = "rich"` - [ ] Update `src/cleveragents/cli/commands/automation_profile.py` to use the config-driven default instead of the hardcoded `fmt: str = "rich"` - [ ] Audit and update all remaining CLI command files that hardcode `"rich"` as the format default - [ ] Add BDD unit tests (Behave) verifying that each updated command respects `core.format` when set - [ ] Add BDD unit tests verifying that commands fall back to `"rich"` when `core.format` is not set - [ ] Add a Robot Framework integration test: `agents config set core.format json` → subsequent command output is JSON ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. ## Background and Context The specification states that the output format can be set globally via the `core.format` config key. This key is registered in `ConfigService` at `src/cleveragents/application/services/config_service.py` line 150 with the description `"Default output format: rich, color, table, plain, json, yaml."` — confirming the feature is intentionally designed. However, no CLI command reads this config key. Every command that accepts a `--format` option hardcodes `"rich"` as the default value, making the `core.format` config key silently inert. ## Current Behavior - `src/cleveragents/cli/commands/config.py` — all commands use hardcoded `fmt: str = "rich"` as default (~line 100) - `src/cleveragents/cli/commands/project.py` — uses hardcoded `output_format: str = "rich"` as default - `src/cleveragents/cli/commands/automation_profile.py` — uses hardcoded `fmt: str = "rich"` as default - All other CLI command files — none read `core.format` from `ConfigService` Running `agents config set core.format json` writes the value to the TOML config file, but every subsequent command still defaults to `"rich"` format, ignoring the stored preference entirely. ## Expected Behavior Per the specification, when a user sets `agents config set core.format json`, all subsequent CLI commands should default to JSON output format without requiring `--format json` on each invocation. The `--format` flag should still override the config value when explicitly provided. ## Steps to Reproduce 1. Run `agents config set core.format json` 2. Run `agents config list` 3. **Expected**: Output is in JSON format (since `core.format` is set to `json`) 4. **Actual**: Output is in rich table format — the hardcoded default `"rich"` is used; the config value is ignored ## Spec Reference `docs/specification.md` — Output Rendering Framework section; `core.format` config key definition. The `ConfigService` registry entry at `src/cleveragents/application/services/config_service.py` line 150 confirms the key is intentionally registered. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 03:50:24 +00:00
freemo self-assigned this 2026-04-03 16:58:10 +00:00
Author
Owner

MoSCoW classification: Should Have

Rationale: This issue addresses a spec requirement or important quality improvement. It should be included in the milestone if possible.


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

MoSCoW classification: **Should Have** Rationale: This issue addresses a spec requirement or important quality improvement. It should be included in the milestone if possible. --- **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.

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