Skip to content

Commit d5bf98d

Browse files
gglucassclaudeJerrettDavis
authored
fix(cli): stop advertising unwired compression tuning env vars in banner (#1634)
## Description The startup banner's `Performance Tuning` section reads `HEADROOM_COMPRESSION_STABLE_AFTER_TURN` and `HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS` and prints them as active tuning knobs. Neither is consumed anywhere else — not in the Python compression path, and not in the packaged native code (verified by scanning the shipped extension modules; `headroom` ships no env-reading native lib and Kompress runs via ONNX). Setting either var changes the banner but has zero effect on behavior, which actively misleads operators trying to tune compression load. Closes # ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Performance improvement - [ ] Code refactoring (no functional changes) ## Changes Made - Removed the two unwired env vars from the banner's `Performance Tuning` section, including the fallback hint that told users to "set" them. - Kept the embedding-sidecar line (`HEADROOM_EMBEDDING_SERVER_SOCKET`), which is a real, consumed setting; the section now renders only when a real tuning value is active and is empty otherwise. - Added an Unreleased → Fixed CHANGELOG entry. ## Testing - [x] Unit tests pass (`pytest`) - [x] Linting passes (`ruff check .`) - [x] Type checking passes (`mypy headroom`) - [ ] New tests added for new functionality - [ ] Manual testing performed ### Test Output ```text $ pytest tests/test_cli_proxy_improvements.py -q 48 passed in 5.04s $ ruff check headroom/cli/proxy.py && ruff format --check headroom/cli/proxy.py All checks passed! / 1 file already formatted $ mypy headroom/cli/proxy.py Success: no issues found in 1 source file ``` ## Real Behavior Proof - Environment: macOS, Python 3.10.18, branch off upstream/main @ 0.28.0 - Exact command / steps: grepped the entire package + shipped `.so`/native modules for both env var names; only the banner referenced them. - Observed result: no consumer exists for either var; banner was the sole reader. After the change the banner no longer claims they do anything. - Not tested: N/A — this removes a false claim; no behavior to exercise beyond the existing CLI-invocation tests, which pass. ## Review Readiness - [x] I have performed a self-review - [x] This PR is ready for human review ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] I have updated the CHANGELOG.md if applicable ## Additional Notes No new test added: the fix deletes dead/misleading output rather than adding logic; a banner-string assertion would be brittle. If you'd rather *implement* these knobs than remove them (i.e. actually gate Kompress on prefix-stable-after-N-turns), I'm happy to open a separate feature PR instead — but as shipped they are pure no-ops, so this stops the banner from lying today. N/A: "new tests added", "manual testing". 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
1 parent 814ffa3 commit d5bf98d

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
`<headroom_proactive_expansion>` XML tags, giving downstream consumers
2828
(LLMs, loggers, attribution parsers) a machine-readable provenance
2929
boundary and preventing misattribution in multi-agent threads.
30+
- **cli:** the startup banner no longer advertises
31+
`HEADROOM_COMPRESSION_STABLE_AFTER_TURN` and
32+
`HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS` as tuning knobs. Both were read
33+
only to render the `Performance Tuning` banner section and were never wired
34+
into the compression path, so setting them changed the banner but had no
35+
effect on behavior. The banner now surfaces only the embedding sidecar,
36+
which is a real, consumed setting.
3037
- **memory/embedder:** cap CPU thread oversubscription in the local
3138
torch/sentence-transformers embedder. Concurrent encodes previously each
3239
fanned out to ~`os.cpu_count()` BLAS/OpenMP threads, so under load the memory

headroom/cli/proxy.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,31 +1327,16 @@ def proxy(
13271327
context_tool_line = f" Context Tool: {_selected_context_tool()}"
13281328

13291329
# Performance tuning section — only shown when at least one tuning var is active.
1330-
_stable_turn = _get_env_int_optional("HEADROOM_COMPRESSION_STABLE_AFTER_TURN") or 0
1331-
_stale_turns = _get_env_int_optional("HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS") or 0
13321330
_embed_socket = os.environ.get("HEADROOM_EMBEDDING_SERVER_SOCKET") or (
13331331
embedding_server and (embedding_server_socket or f"/tmp/headroom-embed-{port}.sock")
13341332
)
13351333
_tuning_lines: list[str] = []
1336-
if _stable_turn:
1337-
_tuning_lines.append(
1338-
f" Prefix stability: conservative for first {_stable_turn} turns"
1339-
f" (HEADROOM_COMPRESSION_STABLE_AFTER_TURN={_stable_turn})"
1340-
)
1341-
if _stale_turns:
1342-
_tuning_lines.append(
1343-
f" Stale read compression: reads older than {_stale_turns} turns eligible"
1344-
f" (HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS={_stale_turns})"
1345-
)
13461334
if _embed_socket:
13471335
_tuning_lines.append(f" Embedding sidecar: {_embed_socket}")
13481336
if _tuning_lines:
13491337
tuning_section = "\nPerformance Tuning:\n" + "\n".join(_tuning_lines)
13501338
else:
1351-
tuning_section = (
1352-
"\nPerformance Tuning: (all defaults — set HEADROOM_COMPRESSION_STABLE_AFTER_TURN"
1353-
" / HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS to tune)"
1354-
)
1339+
tuning_section = ""
13551340

13561341
click.echo(f"""
13571342
╔═══════════════════════════════════════════════════════════════════════╗

0 commit comments

Comments
 (0)