From b752dd485fc59e0c74728ae77c893d0d0981d2ef Mon Sep 17 00:00:00 2001 From: CleverThis Date: Mon, 13 Apr 2026 18:17:53 +0000 Subject: [PATCH] fix(cli): --format color now emits ANSI-coloured output instead of plain text Route the COLOR format option through format_output_session (which uses ColorMaterializer) instead of _format_plain. Previously --format color produced identical output to --format plain because both were routed to the same plain-text formatter. All other formats (plain, json, yaml, rich, table) remain unaffected. Updated CHANGELOG.md with the fix entry and CONTRIBUTORS.md with HAL 9000 contribution details. ISSUES CLOSED: #7910 --- CHANGELOG.md | 5 +++++ CONTRIBUTORS.md | 1 + src/cleveragents/cli/formatting.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17eb03aef..a2a1900d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -172,6 +172,11 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). instead of silently racing. Lock is acquired before phase transition and released in a `finally` block to ensure cleanup even on error. +- **`--format color` ANSI Output** (#7910): Fixed `format_output` routing the `color` format + option to `_format_plain`, which produced plain uncoloured text instead of ANSI escape + sequences. The `color` format is now routed to `format_output_session` which uses the + `ColorMaterializer` to emit proper ANSI-coloured output. `--format plain` and all other + formats remain unaffected. - **Validation Gate Empty-Run Guard** (#7508): Fixed `ApplyValidationSummary.all_required_passed` returning `True` when zero validations were run, silently bypassing the apply gate. The property now returns `False` when the validation result set is empty (`is_empty` is `True`), ensuring diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0c7246a22..cb09b3a56 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -18,3 +18,4 @@ Below are some of the specific details of various contributions. * HAL 9000 has contributed automated implementation, bug fixes, and feature development as part of the CleverAgents automation pool. * HAL 9000 has contributed the plan concurrency race-condition fix (#7989): wired `LockService` into the plan lifecycle, guarding `execute_plan()` and `apply_plan()` with plan-level advisory locks and unique per-invocation owner identities to prevent silent concurrent state corruption. * This project was made possible thanks to considerable donation of time, money, and resources by CleverThis, Inc. +* HAL 9000 has contributed automated bug fixes, CLI output formatting improvements, and ongoing maintenance as part of the CleverAgents automation system. diff --git a/src/cleveragents/cli/formatting.py b/src/cleveragents/cli/formatting.py index cd0be666a..7cd90b5a0 100644 --- a/src/cleveragents/cli/formatting.py +++ b/src/cleveragents/cli/formatting.py @@ -317,7 +317,7 @@ def format_output( if fmt == OutputFormat.TABLE.value: return _format_table(safe_data) if fmt == OutputFormat.COLOR.value: - return _format_plain(safe_data) + return format_output_session(safe_data, fmt) # ``rich`` and any unknown value fall back to JSON return _format_json(safe_data) -- 2.52.0