code-context-engine icon indicating copy to clipboard operation
code-context-engine copied to clipboard

compression.output config key is parsed but never read by the retrieval path

Open itsandyking opened this issue 4 months ago • 1 comments

Summary

The compression.output config key (documented in Config as off | lite | standard | max) is parsed and stored but never read by the retrieval path. Setting it has no effect on what cce search or the MCP server returns.

Reproduce

cd <project>
printf 'compression:\n  output: max\n' > .context-engine.yaml
cce search --top-k 10 "some query" | wc -c
rm .context-engine.yaml
cce search --top-k 10 "some query" | wc -c

Both return byte-identical output (829 chars in my case), and both report the same ✓ 10 results 1925 tokens served.

Cause

$ grep -rn "output_compression" context_engine --include="*.py"
context_engine/config.py:58:    output_compression: str = "standard"  # off | lite | standard | max
context_engine/config.py:128:    "output_compression": str,
context_engine/config.py:152:        ("compression", "output"): "output_compression",
context_engine/memory/db.py:...  (savings ledger only)

Every reference is either config plumbing or the savings ledger histogram. Nothing in retrieval/ or compression/ consumes it.

Impact

cce status shows Compression standard / Compress truncation, which reflect compression_level and the Ollama-availability fallback — not output_compression. So there is no surface where a user can tell the setting is inert. Anyone tuning output size via this key is changing nothing.

Suggested fix

Either wire it into the result-formatting path, or drop it from Config and the docs so the remaining lever (compression.level + Ollama) is unambiguous.

Environment: macOS 27 (arm64), Python 3.12, code-context-engine 0.4.25.

itsandyking avatar Aug 02 '26 19:08 itsandyking

Thanks for the detailed report. Investigated and found the config key IS read by the MCP server path:

  • mcp_server.py:414 reads config.output_compression at startup
  • _apply_output_compression() appends [Respond using {level} output compression] to every tool response
  • set_output_compression MCP tool persists changes to state.json

The cce search CLI shows raw retrieval results (for diagnostics), so it intentionally doesn't apply the output compression directive since there's no AI model receiving the output.

The real gap was that cce status didn't display the active output level, making it impossible to verify the setting. Fix in #154: adds an Output line showing the active level (from state.json or config fallback).

rajkumarsakthivel avatar Aug 02 '26 20:08 rajkumarsakthivel