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.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
fix(install): default docker image to headroomlabs-ai GHCR registry (#1867) (#2039)
Shubham Srivastavac3db8e47f8dd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 99f6848b5..d494772c3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -102,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Bug Fixes+* **install:** default the docker image to `ghcr.io/headroomlabs-ai/headroom:latest` instead of the dead `ghcr.io/chopratejas/headroom:latest`. After the repo moved to the `headroomlabs-ai` org, GHCR did not redirect the old package, so `headroom install` / `headroom init` and the install scripts pulled a frozen `0.27.0` image while current releases publish to the new path ([#1867](https://github.com/headroomlabs-ai/headroom/issues/1867)).* **transforms/content-router:** stop a profile-derived `read_protection_window` kwarg from weakening an explicit `--protect-tool-results` guarantee. `ContentRouter.apply()` computes `read_protection_window` from `protect_recent_reads_fraction`, where `0.0` (the sentinel `--protect-tool-results` sets) means "protect all excluded-tool output regardless of conversation depth" per #1374's documented contract — but the method then unconditionally overwrote that window with a `read_protection_window` kwarg whenever one was present. `proxy_pipeline_kwargs()` supplies that kwarg on every request from the active `AgentSavingsProfile.protect_recent` (the default `coding` profile sets `protect_recent=2`), so in practice only the last 2 messages ever kept read-protection and older excluded-tool output silently fell through to lossy compression. The runtime kwarg may now only narrow the window when `protect_recent_reads_fraction > 0`; it can no longer shrink the "protect everything" guarantee set by `--protect-tool-results`.* **memory:** include the Ollama server URL in the embedder cache key so a second backend can't get an embedder bound to the wrong server. `_create_embedder` cached by `(backend, model)` only, but the Ollama embedder is constructed with `base_url=config.ollama_base_url`. Two configs in the same process that shared a backend and model but pointed at different Ollama servers (e.g. a per-project storage router) collided on one cache slot, so the second silently reused the first's embedder and embedded against the wrong host. The cache key now also includes `ollama_base_url`.* **tokenizers:** use `o200k_base` for the gpt-4.1 / gpt-4.5 / o4 families in `get_encoding_for_model`. `gpt-4.1*` and `gpt-4.5*` matched the broad `gpt-4` prefix and were encoded with `cl100k_base`, and `o4*` matched no prefix and fell through to the `cl100k_base` default — all three use `o200k_base`, so their token counts were computed with the wrong vocabulary. Added explicit `gpt-4.1`/`gpt-4.5` prefixes ahead of `gpt-4` and an `o4` prefix; `gpt-4` and `gpt-3.5` snapshots still resolve to `cl100k_base`.diff --git a/docker/docker-compose.native.yml b/docker/docker-compose.native.ymlindex b379938e2..0c1fd6c1d 100644--- a/docker/docker-compose.native.yml+++ b/docker/docker-compose.native.yml@@ -1,6 +1,6 @@services:cli:- image: ${HEADROOM_IMAGE:-ghcr.io/chopratejas/headroom:latest}+ image: ${HEADROOM_IMAGE:-ghcr.io/headroomlabs-ai/headroom:latest}entrypoint: ["headroom"]working_dir: /workspacestdin_open: true@@ -24,7 +24,7 @@ services:command: ["--help"]proxy:- image: ${HEADROOM_IMAGE:-ghcr.io/chopratejas/headroom:latest}+ image: ${HEADROOM_IMAGE:-ghcr.io/headroomlabs-ai/headroom:latest}entrypoint: ["headroom", "proxy"]working_dir: /workspacerestart: unless-stoppeddiff --git a/headroom/cli/init.py b/headroom/cli/init.pyindex 13c1d1315..85cf7882c 100644--- a/headroom/cli/init.py+++ b/headroom/cli/init.py@@ -541,7 +541,7 @@ def _ensure_runtime_manifest(proxy_mode="token",memory_enabled=memory,telemetry_enabled=True,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",)manifest.supervisor_kind = SupervisorKind.NONE.valuemanifest.artifacts = []@@ -577,7 +577,7 @@ def _env_manifest(values: dict[str, str]) -> Any:proxy_mode="token",memory_enabled=False,telemetry_enabled=True,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",)diff --git a/headroom/cli/install.py b/headroom/cli/install.pyindex 249550d27..3a16594df 100644--- a/headroom/cli/install.py+++ b/headroom/cli/install.py@@ -213,7 +213,7 @@ def _reject_task_lifecycle(manifest: DeploymentManifest, action: str) -> None:)@click.option("--image",- default="ghcr.io/chopratejas/headroom:latest",+ default="ghcr.io/headroomlabs-ai/headroom:latest",show_default=True,help="Docker image to use when runtime=docker or preset=persistent-docker.",)diff --git a/headroom/install/models.py b/headroom/install/models.pyindex 08ec50a44..dc5f0bd85 100644--- a/headroom/install/models.py+++ b/headroom/install/models.py@@ -104,7 +104,7 @@ class DeploymentManifest:memory_enabled: bool = Falsememory_db_path: str = ""telemetry_enabled: bool = True- image: str = "ghcr.io/chopratejas/headroom:latest"+ image: str = "ghcr.io/headroomlabs-ai/headroom:latest"service_name: str = "headroom"container_name: str = "headroom-persistent"health_url: str = "http://127.0.0.1:8787/readyz"diff --git a/scripts/install.ps1 b/scripts/install.ps1index adfa9f902..3454e099b 100644--- a/scripts/install.ps1+++ b/scripts/install.ps1@@ -1,6 +1,6 @@$ErrorActionPreference = 'Stop'-$ImageDefault = 'ghcr.io/chopratejas/headroom:latest'+$ImageDefault = 'ghcr.io/headroomlabs-ai/headroom:latest'$InstallImage = if ($env:HEADROOM_DOCKER_IMAGE) { $env:HEADROOM_DOCKER_IMAGE } else { $ImageDefault }$InstallDir = Join-Path $HOME '.local\bin'if (-not (Test-Path (Join-Path $HOME '.local'))) {@@ -616,7 +616,7 @@ function Show-InstallApplyHelp {' --mode TEXT Proxy optimization mode. [default: token]',' --memory Enable persistent memory in the runtime.',' --no-telemetry Disable anonymous telemetry in the runtime.',- ' --image TEXT Docker image to use. [default: HEADROOM_DOCKER_IMAGE or ghcr.io/chopratejas/headroom:latest]',+ ' --image TEXT Docker image to use. [default: HEADROOM_DOCKER_IMAGE or ghcr.io/headroomlabs-ai/headroom:latest]',' -?, --help Show this message and exit.')Write-Host ($lines -join [Environment]::NewLine)diff --git a/scripts/install.sh b/scripts/install.shindex 18edc2e45..a98fe2b96 100644--- a/scripts/install.sh+++ b/scripts/install.sh@@ -2,7 +2,7 @@set -euo pipefail-IMAGE_DEFAULT="ghcr.io/chopratejas/headroom:latest"+IMAGE_DEFAULT="ghcr.io/headroomlabs-ai/headroom:latest"INSTALL_IMAGE="${HEADROOM_DOCKER_IMAGE:-${IMAGE_DEFAULT}}"INSTALL_DIR="${HOME}/.local/bin"if [[ ! -d "${HOME}/.local" ]]; then@@ -602,7 +602,7 @@ Options:--mode TEXT Proxy optimization mode. [default: token]--memory Enable persistent memory in the runtime.--no-telemetry Disable anonymous telemetry in the runtime.- --image TEXT Docker image to use. [default: HEADROOM_DOCKER_IMAGE or ghcr.io/chopratejas/headroom:latest]+ --image TEXT Docker image to use. [default: HEADROOM_DOCKER_IMAGE or ghcr.io/headroomlabs-ai/headroom:latest]-?, --help Show this message and exit.EOF}diff --git a/tests/test_install/test_planner.py b/tests/test_install/test_planner.pyindex 37ee39016..d4ae1561f 100644--- a/tests/test_install/test_planner.py+++ b/tests/test_install/test_planner.py@@ -34,7 +34,7 @@ def test_build_manifest_for_persistent_docker_sets_expected_defaults() -> None:proxy_mode="token",memory_enabled=True,telemetry_enabled=False,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",)assert manifest.supervisor_kind == "none"@@ -63,7 +63,7 @@ def test_build_manifest_uses_provider_slice_env_builders_for_all_supported_targeproxy_mode="token",memory_enabled=False,telemetry_enabled=True,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",)# telemetry_enabled=True must write the explicit opt-in value + flag.@@ -122,7 +122,7 @@ def test_build_manifest_omits_no_http2_by_default() -> None:proxy_mode="token",memory_enabled=False,telemetry_enabled=True,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",)assert "--no-http2" not in manifest.proxy_args@@ -143,7 +143,7 @@ def test_build_manifest_persists_no_http2_override() -> None:proxy_mode="token",memory_enabled=False,telemetry_enabled=True,- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",no_http2=True,)diff --git a/tests/test_install/test_runtime.py b/tests/test_install/test_runtime.pyindex d28f38e6b..ad54d1357 100644--- a/tests/test_install/test_runtime.py+++ b/tests/test_install/test_runtime.py@@ -44,7 +44,7 @@ def test_build_runtime_command_for_docker_includes_deployment_env(port=8787,host="127.0.0.1",backend="anthropic",- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",base_env={"HEADROOM_PORT": "8787"},proxy_args=["--host", "127.0.0.1", "--port", "8787"],)@@ -56,7 +56,7 @@ def test_build_runtime_command_for_docker_includes_deployment_env(assert "HEADROOM_DEPLOYMENT_PROFILE=default" in joinedassert "HEADROOM_DEPLOYMENT_PRESET=persistent-docker" in joinedassert "127.0.0.1:8787:8787" in joined- assert "ghcr.io/chopratejas/headroom:latest" in command+ assert "ghcr.io/headroomlabs-ai/headroom:latest" in command# Canonical Headroom filesystem contract (issue #175) forwarded into# the container.assert "HEADROOM_WORKSPACE_DIR=/tmp/headroom-home/.headroom" in command@@ -121,7 +121,7 @@ def test_build_runtime_command_for_docker_matches_wrapper_parity(port=8787,host="127.0.0.1",backend="anthropic",- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",base_env={"HEADROOM_PORT": "8787"},proxy_args=["--host", "127.0.0.1", "--port", "8787"],)@@ -157,7 +157,7 @@ def test_build_runtime_command_for_docker_does_not_duplicate_entrypoint(port=8787,host="127.0.0.1",backend="anthropic",- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",base_env={"HEADROOM_PORT": "8787"},proxy_args=["--host", "127.0.0.1", "--port", "8787", "--backend", "anthropic"],)@@ -266,7 +266,7 @@ def test_build_runtime_command_python_and_docker_user(monkeypatch, tmp_path: Patport=8787,host="127.0.0.1",backend="anthropic",- image="ghcr.io/chopratejas/headroom:latest",+ image="ghcr.io/headroomlabs-ai/headroom:latest",base_env={"HEADROOM_PORT": "8787"},proxy_args=["--host", "127.0.0.1", "--port", "8787"],)