Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

fix: check feature configuration before reusing persistent deployments (#1330)

Carlos Duplar Mello5d17e9addc38
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8147af13c..ad9ae9612 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -726,6 +726,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug Fixes
+* **wrap:** check feature configuration before reusing persistent deployments. A persistent proxy started for one use case (e.g. `--backend anthropic`) would be silently reused for another (e.g. `--subscription --provider-type openai`) causing 401 auth failures because `_ensure_proxy()` only checked health + version, skipping the feature configuration check (memory, openai_api_url, learn, code_graph).
* **codex:** respect `CODEX_HOME` when `headroom wrap codex` writes provider, MCP, memory, backup, and global `AGENTS.md` config, and warn when `unwrap codex` may be looking at the default Codex home because `CODEX_HOME` is unset.
* **proxy:** multi-worker CCR warning is now conditional on backend — when `HEADROOM_CCR_BACKEND` is unset (default `InMemoryBackend`, per-process), the startup warning includes CCR retrieval failures and suggests `HEADROOM_CCR_BACKEND=sqlite`; when a cross-worker backend is already configured, the warning covers only the remaining per-worker stores (compression cache, prefix tracker, TOIN, CostTracker). Updated `RUST_DEV.md` to accurately document Python `CompressionStore` as per-process by default.
* **deps:** move `gunicorn` to `[proxy-prod]` extra with `sys_platform != 'win32'` guard; removed from `[proxy]` to avoid forcing a Unix-only package on dev, CI, and Windows users ([#537](https://github.com/chopratejas/headroom/pull/537))
diff --git a/tests/test_cli/test_wrap_persistent.py b/tests/test_cli/test_wrap_persistent.py
index 6f242f03e..3a7793438 100644
--- a/tests/test_cli/test_wrap_persistent.py
+++ b/tests/test_cli/test_wrap_persistent.py
@@ -799,6 +799,7 @@ def test_ensure_proxy_restarts_persistent_deployment_for_memory_mismatch(monkeyp
# Proxy should be killed and restarted due to memory mismatch
assert calls[0] == ("kill", 12345, 8787)
assert calls[1][0] == "start"
+ assert calls[1][2]["memory"] is True
def test_ensure_proxy_restarts_recovered_persistent_for_openai_api_url_mismatch(