From ebd07eb139dba1083f432d20b540854604b42513 Mon Sep 17 00:00:00 2001 From: rajkumarsakthivel Date: Sun, 2 Aug 2026 21:06:23 +0100 Subject: [PATCH 1/2] fix(status): show active output compression level in cce status (#153) The output compression config key (compression.output) was wired into the MCP server but cce status didn't display it, making it impossible to verify the setting took effect. Add the output level line to cce status output, reading from state.json (which set_output_compression persists to) with config as fallback. --- src/context_engine/cli.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/context_engine/cli.py b/src/context_engine/cli.py index b001520..eb37519 100644 --- a/src/context_engine/cli.py +++ b/src/context_engine/cli.py @@ -1158,6 +1158,18 @@ def status(ctx: click.Context, output_json: bool, oneline: bool) -> None: lines.append(f" {ollama_bullet} {label('Ollama')} {ollama_status}") lines.append(f" {BULLET} {label('Compress')} {value(compression_mode)}") + # Output compression level + out_level = getattr(config, "output_compression", "standard") + # state.json may override the config default (set_output_compression persists here) + state_path = project_storage_dir(config, _safe_cwd()) / "state.json" + if state_path.exists(): + try: + state = json.loads(state_path.read_text(encoding="utf-8")) + out_level = state.get("output_level", out_level) + except (json.JSONDecodeError, OSError): + pass + lines.append(f" {BULLET} {label('Output')} {value(out_level)}") + # Token savings stats_path = project_storage_dir(config, _safe_cwd()) / "stats.json" lines.append("") From dc1e642ce287dcbf00809406811ebe8baf714d60 Mon Sep 17 00:00:00 2001 From: rajkumarsakthivel Date: Sun, 2 Aug 2026 21:17:46 +0100 Subject: [PATCH 2/2] fix: validate output level against supported set, reuse storage dir Clamp output level to LEVELS (off/lite/standard/max) so corrupted state.json or invalid config doesn't display a bogus level. Reuse the project_storage_dir() result for both state.json and stats.json. --- src/context_engine/cli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/context_engine/cli.py b/src/context_engine/cli.py index eb37519..2340d32 100644 --- a/src/context_engine/cli.py +++ b/src/context_engine/cli.py @@ -1159,19 +1159,23 @@ def status(ctx: click.Context, output_json: bool, oneline: bool) -> None: lines.append(f" {BULLET} {label('Compress')} {value(compression_mode)}") # Output compression level + from context_engine.compression.output_rules import LEVELS as _OUT_LEVELS out_level = getattr(config, "output_compression", "standard") # state.json may override the config default (set_output_compression persists here) - state_path = project_storage_dir(config, _safe_cwd()) / "state.json" + storage = project_storage_dir(config, _safe_cwd()) + state_path = storage / "state.json" if state_path.exists(): try: state = json.loads(state_path.read_text(encoding="utf-8")) out_level = state.get("output_level", out_level) except (json.JSONDecodeError, OSError): pass + if out_level not in _OUT_LEVELS: + out_level = "standard" lines.append(f" {BULLET} {label('Output')} {value(out_level)}") # Token savings - stats_path = project_storage_dir(config, _safe_cwd()) / "stats.json" + stats_path = storage / "stats.json" lines.append("") lines.append(section("Token Savings")) lines.append("")