UAT: --format color renders plain text without ANSI color codes — spec requires ANSI-colored output #2120

Closed
opened 2026-04-03 04:14:38 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/cli-color-format-ansi-codes
  • Commit Message: fix(cli): color format should apply ANSI color codes to keys and values
  • Milestone: v3.7.0
  • Parent Epic: #936

Description

The spec (§Output Rendering Framework, §Format Descriptions) defines the color format as:

color: Plain scrolling text with ANSI color codes applied to headers, keys, and values.

Actual Behavior

In src/cleveragents/cli/formatting.py, the format_output() function handles the color format as:

if fmt == OutputFormat.COLOR.value:
    return _format_plain(safe_data)

This simply delegates to _format_plain(), which produces plain text with no ANSI color codes. The color format is therefore indistinguishable from the plain format.

Additionally, ColorMaterializer exists in src/cleveragents/cli/output/materializers.py but format_output() does not use it — it bypasses the materializer framework entirely for the color format.

Steps to Reproduce

from cleveragents.cli.formatting import format_output
data = {'version': '1.0.0', 'channel': 'stable', 'python': '3.13.0'}
plain_result = format_output(data, 'plain')
color_result = format_output(data, 'color')
assert plain_result == color_result  # This passes — they are identical
# Expected: color_result contains ANSI escape codes
# Actual: color_result is identical to plain_result (no ANSI codes)

Expected Behavior

agents version --format color should produce plain text with ANSI color codes (e.g., \033[34mVersion:\033[0m 1.0.0), making keys/headers visually distinct in color-capable terminals.

Severity

Medium — The color format is intended for terminals that support color but not advanced rendering (e.g., CI/CD pipelines with color support). Without ANSI codes, it provides no benefit over plain.

Code Location

  • src/cleveragents/cli/formatting.pyformat_output() function, the color branch (~line 175)
  • src/cleveragents/cli/output/materializers.pyColorMaterializer (exists but is unused by format_output())

Subtasks

  • Investigate ColorMaterializer in src/cleveragents/cli/output/materializers.py and confirm it correctly applies ANSI codes to headers, keys, and values per the spec
  • Update format_output() in src/cleveragents/cli/formatting.py to route the color branch through ColorMaterializer instead of _format_plain()
  • Ensure ANSI escape codes are applied to headers, keys, and values (e.g., \033[34mKey:\033[0m value)
  • Write Behave unit tests in features/ covering the color format output (assert ANSI codes present, assert distinct from plain output)
  • Write Robot Framework integration tests in robot/ for agents <cmd> --format color end-to-end
  • Verify all nox sessions pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)

Definition of Done

  • format_output(data, 'color') produces output containing ANSI escape codes for keys/headers/values
  • format_output(data, 'color') output is not identical to format_output(data, 'plain') output
  • ColorMaterializer is wired into format_output() for the color branch
  • Behave unit tests added in features/ covering the corrected color format behavior
  • Robot Framework integration tests added in robot/ for --format color CLI flag
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests)
  • Coverage >= 97% (nox -e coverage_report)
  • Commit created with exact message: fix(cli): color format should apply ANSI color codes to keys and values
  • Commit footer includes ISSUES CLOSED: #<this issue number>
  • Branch fix/cli-color-format-ansi-codes pushed and PR merged

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

## Metadata - **Branch**: `fix/cli-color-format-ansi-codes` - **Commit Message**: `fix(cli): color format should apply ANSI color codes to keys and values` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Description The spec (§Output Rendering Framework, §Format Descriptions) defines the `color` format as: > **`color`**: Plain scrolling text with ANSI color codes applied to headers, keys, and values. ### Actual Behavior In `src/cleveragents/cli/formatting.py`, the `format_output()` function handles the `color` format as: ```python if fmt == OutputFormat.COLOR.value: return _format_plain(safe_data) ``` This simply delegates to `_format_plain()`, which produces plain text with **no ANSI color codes**. The `color` format is therefore indistinguishable from the `plain` format. Additionally, `ColorMaterializer` exists in `src/cleveragents/cli/output/materializers.py` but `format_output()` does not use it — it bypasses the materializer framework entirely for the `color` format. ### Steps to Reproduce ```python from cleveragents.cli.formatting import format_output data = {'version': '1.0.0', 'channel': 'stable', 'python': '3.13.0'} plain_result = format_output(data, 'plain') color_result = format_output(data, 'color') assert plain_result == color_result # This passes — they are identical # Expected: color_result contains ANSI escape codes # Actual: color_result is identical to plain_result (no ANSI codes) ``` ### Expected Behavior `agents version --format color` should produce plain text with ANSI color codes (e.g., `\033[34mVersion:\033[0m 1.0.0`), making keys/headers visually distinct in color-capable terminals. ### Severity **Medium** — The `color` format is intended for terminals that support color but not advanced rendering (e.g., CI/CD pipelines with color support). Without ANSI codes, it provides no benefit over `plain`. ### Code Location - `src/cleveragents/cli/formatting.py` — `format_output()` function, the `color` branch (~line 175) - `src/cleveragents/cli/output/materializers.py` — `ColorMaterializer` (exists but is unused by `format_output()`) ## Subtasks - [ ] Investigate `ColorMaterializer` in `src/cleveragents/cli/output/materializers.py` and confirm it correctly applies ANSI codes to headers, keys, and values per the spec - [ ] Update `format_output()` in `src/cleveragents/cli/formatting.py` to route the `color` branch through `ColorMaterializer` instead of `_format_plain()` - [ ] Ensure ANSI escape codes are applied to headers, keys, and values (e.g., `\033[34mKey:\033[0m value`) - [ ] Write Behave unit tests in `features/` covering the `color` format output (assert ANSI codes present, assert distinct from `plain` output) - [ ] Write Robot Framework integration tests in `robot/` for `agents <cmd> --format color` end-to-end - [ ] Verify all nox sessions pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) ## Definition of Done - [ ] `format_output(data, 'color')` produces output containing ANSI escape codes for keys/headers/values - [ ] `format_output(data, 'color')` output is **not** identical to `format_output(data, 'plain')` output - [ ] `ColorMaterializer` is wired into `format_output()` for the `color` branch - [ ] Behave unit tests added in `features/` covering the corrected `color` format behavior - [ ] Robot Framework integration tests added in `robot/` for `--format color` CLI flag - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`) - [ ] Coverage >= 97% (`nox -e coverage_report`) - [ ] Commit created with exact message: `fix(cli): color format should apply ANSI color codes to keys and values` - [ ] Commit footer includes `ISSUES CLOSED: #<this issue number>` - [ ] Branch `fix/cli-color-format-ansi-codes` pushed and PR merged --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:14:43 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium (confirmed)
  • Milestone: v3.7.0 (confirmed — Output Rendering Pipeline Epic #936)
  • MoSCoW: Should Have — The color format is spec-defined as "plain text with ANSI color codes." Currently it's identical to plain, making it useless. Important for CI/CD pipelines that support color.
  • Parent Epic: #936 (confirmed correct)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium (confirmed) - **Milestone**: v3.7.0 (confirmed — Output Rendering Pipeline Epic #936) - **MoSCoW**: Should Have — The `color` format is spec-defined as "plain text with ANSI color codes." Currently it's identical to `plain`, making it useless. Important for CI/CD pipelines that support color. - **Parent Epic**: #936 (confirmed correct) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Closing as duplicate of #1827. Both issues describe the same bug: --format color renders plain text without ANSI color codes. Issue #1827 was filed earlier (milestone v3.5.0) and is the canonical bug report with State/Verified. Note: #2101 was also a duplicate of #1827 and was already closed.

Please track this work in #1827.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Closing as duplicate of #1827. Both issues describe the same bug: `--format color` renders plain text without ANSI color codes. Issue #1827 was filed earlier (milestone v3.5.0) and is the canonical bug report with `State/Verified`. Note: #2101 was also a duplicate of #1827 and was already closed. Please track this work in #1827. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
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#2120
No description provided.