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): persist --no-http2 override through install apply (#1676)
Rod Boev6fb5f3bc3dfa
diff --git a/headroom/cli/install.py b/headroom/cli/install.pyindex 40da76f52..66221fd36 100644--- a/headroom/cli/install.py+++ b/headroom/cli/install.py@@ -202,6 +202,11 @@ def _reject_task_lifecycle(manifest: DeploymentManifest, action: str) -> None:show_default=True,help="Docker image to use when runtime=docker or preset=persistent-docker.",)+ "--no-http2",+ is_flag=True,+ help="Disable HTTP/2 in the persistent runtime (enabled by default).",+)def install_apply(preset: str,runtime: str,@@ -218,6 +223,7 @@ def install_apply(telemetry: bool,no_telemetry: bool,image: str,+ no_http2: bool,) -> None:"""Install a persistent Headroom deployment."""@@ -245,6 +251,7 @@ def install_apply(memory_enabled=memory,telemetry_enabled=telemetry and not no_telemetry,image=image,+ no_http2=no_http2,)try:diff --git a/headroom/install/planner.py b/headroom/install/planner.pyindex 60899e548..d2f6e9cce 100644--- a/headroom/install/planner.py+++ b/headroom/install/planner.py@@ -119,6 +119,7 @@ def build_manifest(memory_enabled: bool,telemetry_enabled: bool,image: str,+ no_http2: bool = False,) -> DeploymentManifest:"""Create a normalized deployment manifest."""@@ -166,6 +167,8 @@ def build_manifest(proxy_args.extend(["--anyllm-provider", anyllm_provider])if region:proxy_args.extend(["--region", region])+ if no_http2:+ proxy_args.append("--no-http2")container_name = f"headroom-{normalized_profile}"return DeploymentManifest(diff --git a/tests/test_cli/test_install_cli.py b/tests/test_cli/test_install_cli.pyindex 07ffe3e0f..2ba8b5577 100644--- a/tests/test_cli/test_install_cli.py+++ b/tests/test_cli/test_install_cli.py@@ -52,6 +52,53 @@ def test_install_apply_starts_service_supervisor(monkeypatch) -> None:assert calls == ["save", "start_service"]+def test_install_apply_forwards_no_http2_to_build_manifest(monkeypatch) -> None:+ runner = CliRunner()+ captured: dict[str, object] = {}++ class Manifest:+ profile = "default"+ preset = "persistent-service"+ runtime_kind = "python"+ supervisor_kind = "service"+ scope = "user"+ health_url = "http://127.0.0.1:8787/readyz"+ targets = ["claude"]+ mutations = []+ artifacts = []++ manifest = Manifest()++ def fake_build_manifest(**kwargs):+ captured.update(kwargs)+ return manifest++ monkeypatch.setattr("headroom.cli.install.build_manifest", fake_build_manifest)+ monkeypatch.setattr("headroom.cli.install.load_manifest", lambda profile: None)+ monkeypatch.setattr("headroom.cli.install.apply_mutations", lambda deployment: [])+ monkeypatch.setattr("headroom.cli.install.install_supervisor", lambda deployment: [])+ monkeypatch.setattr("headroom.cli.install.save_manifest", lambda deployment: None)+ monkeypatch.setattr("headroom.cli.install.start_supervisor", lambda deployment: None)+ monkeypatch.setattr("headroom.cli.install.start_detached_agent", lambda profile: None)+ monkeypatch.setattr(+ "headroom.cli.install.wait_ready", lambda deployment, timeout_seconds=45: True+ )++ result = runner.invoke(main, ["install", "apply", "--no-http2"])++ assert result.exit_code == 0, result.output+ assert captured["no_http2"] is True+++def test_install_apply_help_lists_no_http2() -> None:+ runner = CliRunner()++ result = runner.invoke(main, ["install", "apply", "--help"])++ assert result.exit_code == 0, result.output+ assert "--no-http2" in result.output++def test_install_status_includes_backend_from_health_probe(monkeypatch) -> None:runner = CliRunner()diff --git a/tests/test_install/test_planner.py b/tests/test_install/test_planner.pyindex 2832bb08c..1eac07d5e 100644--- a/tests/test_install/test_planner.py+++ b/tests/test_install/test_planner.py@@ -102,3 +102,47 @@ def test_resolve_targets_manual_dedupes_and_filters_invalid() -> None:)assert targets == [ToolTarget.CLAUDE.value, ToolTarget.COPILOT.value]+++def test_build_manifest_omits_no_http2_by_default() -> None:+ manifest = build_manifest(+ profile="default",+ preset=InstallPreset.PERSISTENT_SERVICE.value,+ runtime_kind="python",+ scope="user",+ provider_mode="manual",+ targets=["claude"],+ port=8787,+ backend="anthropic",+ anyllm_provider=None,+ region=None,+ proxy_mode="token",+ memory_enabled=False,+ telemetry_enabled=True,+ image="ghcr.io/chopratejas/headroom:latest",+ )++ assert "--no-http2" not in manifest.proxy_args+++def test_build_manifest_persists_no_http2_override() -> None:+ manifest = build_manifest(+ profile="default",+ preset=InstallPreset.PERSISTENT_SERVICE.value,+ runtime_kind="python",+ scope="user",+ provider_mode="manual",+ targets=["claude"],+ port=8787,+ backend="anthropic",+ anyllm_provider=None,+ region=None,+ proxy_mode="token",+ memory_enabled=False,+ telemetry_enabled=True,+ image="ghcr.io/chopratejas/headroom:latest",+ no_http2=True,+ )++ assert manifest.proxy_args.count("--no-http2") == 1+ assert "HEADROOM_HTTP2" not in manifest.base_env