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
feat(deploy): Add turnkey deploy command (#1404)
JD Davis560ffae10331
diff --git a/README.md b/README.mdindex 933690958..73cf7fa8e 100644--- a/README.md+++ b/README.md@@ -94,6 +94,7 @@ pip install "headroom-ai[all]" # Python — ships the `headroom` CLInpm install headroom-ai # TypeScript SDK only — no `headroom` CLI# 2 — Pick your mode (the `headroom` commands below come from the uv or pip install)+headroom deploy # turnkey local deployment + agent configheadroom wrap claude # wrap a coding agentheadroom proxy --port 8787 # drop-in proxy, zero code changes# or: from headroom import compress # inline library@@ -104,7 +105,7 @@ headroom perfheadroom dashboard # live savings dashboard (proxy must be running)```-To use headroom, it is recommended you launch a wrapped agent session each time so that all necessary setup is completed. When wrapping a coding agent, headroom starts a local proxy, sets up an MCP server that provides tools such as rtk and tokensave, and launches a coding agent session configured to proxy requests to headroom.+To use headroom, it is recommended you launch a wrapped agent session each time so that all necessary setup is completed. When wrapping a coding agent, headroom starts a local proxy, sets up an MCP server that provides tools such as rtk and tokensave, and launches a coding agent session configured to proxy requests to headroom.The `headroom` CLI ships **only** via the PyPI package. The npm `headroom-ai` is the TypeScript SDK — a library you import (`import { compress } from 'headroom-ai'`), not a CLI, so it provides no `headroom` command.diff --git a/docs/content/docs/persistent-installs.mdx b/docs/content/docs/persistent-installs.mdxindex b2d991843..e00c2f8d2 100644--- a/docs/content/docs/persistent-installs.mdx+++ b/docs/content/docs/persistent-installs.mdx@@ -5,12 +5,15 @@ description: Install Headroom as a durable local runtime — background service,Headroom can be installed as a durable local runtime instead of only being started ad hoc with `headroom proxy` or `headroom wrap ...`.-Use the Python-native `headroom install` CLI when you want supported tools to keep talking to an always-on proxy at `http://127.0.0.1:8787` and have `wrap` reuse or recover that deployment instead of starting a second ephemeral proxy.+Use `headroom deploy` when you want the one-line path: Headroom chooses the best local runtime it can run on the current host, configures detected tools, starts the proxy at `http://127.0.0.1:8787`, and stores the deployment profile for later lifecycle commands.++Use the lower-level Python-native `headroom install` CLI when you need to force a specific service, task, Docker, scope, or provider target. Both surfaces create profiles that `wrap` can reuse or recover instead of starting a second ephemeral proxy.## Runtime matrix| Mode | What stays running | Primary entrypoint ||---|---|---|+| Turnkey Deploy | Docker, scheduled watchdog, or detached runtime selected for this host | `headroom deploy` || Persistent Service | Native background service | `headroom install apply --preset persistent-service` || Persistent Task | Scheduled watchdog + on-demand runner | `headroom install apply --preset persistent-task` || Persistent Docker | Restartable Docker container | `headroom install apply --preset persistent-docker` |@@ -21,6 +24,15 @@ Use the Python-native `headroom install` CLI when you want supported tools to ke## Quick examples+### Turnkey local deployment++```bash+headroom deploy+headroom install status+```++`deploy` prefers the most capable restartable path it can prove is available. On NVIDIA workstations with Docker GPU support, such as an RTX 4090 host with the NVIDIA container runtime installed, it uses Docker GPU passthrough. Otherwise it prefers plain Docker, then the native scheduled watchdog for the host when available (`launchd`, Task Scheduler, or cron). If no supported supervisor is present, it still starts a managed detached Python runtime instead of failing on missing platform services.+### Persistent service on the local machine```bashdiff --git a/headroom/cli/install.py b/headroom/cli/install.pyindex ad6ed4827..f2b2c7189 100644--- a/headroom/cli/install.py+++ b/headroom/cli/install.py@@ -4,10 +4,13 @@ from __future__ import annotationsimport shutilimport subprocess+import sysfrom copy import deepcopy+from dataclasses import dataclassimport click+from headroom._subprocess import runfrom headroom.install.health import probe_json, probe_readyfrom headroom.install.models import (ConfigScope,@@ -44,6 +47,17 @@ from headroom.install.supervisors import (from .main import main+@dataclass(frozen=True)+class TurnkeyPlan:+ """Resolved runtime strategy for one-line deployments."""++ preset: str+ runtime: str+ supervisor_kind: str | None+ reason: str+ base_env: dict[str, str] | None = None++@main.group()def install() -> None:"""Install and manage persistent Headroom deployments."""@@ -155,6 +169,192 @@ def _reject_task_lifecycle(manifest: DeploymentManifest, action: str) -> None:)+def _command_available(command: str) -> bool:+ return shutil.which(command) is not None+++def _probe_command(command: list[str]) -> subprocess.CompletedProcess[str] | None:+ try:+ return run(+ command,+ capture_output=True,+ check=False,+ text=True,+ timeout=3,+ )+ except (OSError, subprocess.SubprocessError, subprocess.TimeoutExpired):+ return None+++def _detect_nvidia_gpu_names() -> list[str]:+ if not _command_available("nvidia-smi"):+ return []+ result = _probe_command(["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"])+ if result is None or result.returncode != 0:+ return []+ return [line.strip() for line in result.stdout.splitlines() if line.strip()]+++def _docker_supports_nvidia_gpus() -> bool:+ if not _command_available("docker"):+ return False+ result = _probe_command(["docker", "info", "--format", "{{json .Runtimes}}"])+ if result is None or result.returncode != 0:+ return False+ return "nvidia" in result.stdout.lower()+++def _select_turnkey_plan(*, prefer_docker: bool = True) -> TurnkeyPlan:+ """Choose the most portable available deployment strategy for this host."""++ gpu_names = _detect_nvidia_gpu_names()+ if prefer_docker and gpu_names and _docker_supports_nvidia_gpus():+ gpu_summary = ", ".join(gpu_names[:2])+ if len(gpu_names) > 2:+ gpu_summary += f", +{len(gpu_names) - 2} more"+ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_DOCKER.value,+ runtime=RuntimeKind.DOCKER.value,+ supervisor_kind=SupervisorKind.NONE.value,+ reason=f"NVIDIA GPU available ({gpu_summary}); using Docker GPU passthrough.",+ base_env={"HEADROOM_DOCKER_GPUS": "all"},+ )++ if prefer_docker and _command_available("docker"):+ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_DOCKER.value,+ runtime=RuntimeKind.DOCKER.value,+ supervisor_kind=SupervisorKind.NONE.value,+ reason="Docker is available, so Headroom can run in a restartable container.",+ )++ if sys.platform == "darwin" and _command_available("launchctl"):+ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_TASK.value,+ runtime=RuntimeKind.PYTHON.value,+ supervisor_kind=SupervisorKind.TASK.value,+ reason="launchd is available for scheduled health recovery.",+ )++ if sys.platform.startswith("win") and _command_available("schtasks"):+ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_TASK.value,+ runtime=RuntimeKind.PYTHON.value,+ supervisor_kind=SupervisorKind.TASK.value,+ reason="Windows Task Scheduler is available for scheduled health recovery.",+ )++ if sys.platform.startswith("linux") and _command_available("crontab"):+ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_TASK.value,+ runtime=RuntimeKind.PYTHON.value,+ supervisor_kind=SupervisorKind.TASK.value,+ reason="cron is available for scheduled health recovery.",+ )++ return TurnkeyPlan(+ preset=InstallPreset.PERSISTENT_TASK.value,+ runtime=RuntimeKind.PYTHON.value,+ supervisor_kind=SupervisorKind.NONE.value,+ reason="No supported supervisor was detected; Headroom will start a managed detached runtime.",+ )+++def _build_deployment_manifest(+ *,+ preset: str,+ runtime: str,+ scope: str,+ provider_mode: str,+ targets: tuple[str, ...],+ profile: str,+ port: int,+ backend: str,+ anyllm_provider: str | None,+ region: str | None,+ proxy_mode: str,+ memory: bool,+ telemetry: bool,+ no_telemetry: bool,+ image: str,+ no_http2: bool,+ code_aware: bool | None = None,+ intercept_tool_results: bool = False,+ protect_tool_results: str | None = None,+ bedrock_profile: str | None = None,+ extra_env: dict[str, str] | None = None,+ supervisor_kind: str | None = None,+ extra_base_env: dict[str, str] | None = None,+) -> DeploymentManifest:+ manifest = build_manifest(+ profile=profile,+ preset=preset,+ runtime_kind=runtime,+ scope=scope,+ provider_mode=provider_mode,+ targets=list(targets),+ port=port,+ backend=backend,+ anyllm_provider=anyllm_provider,+ region=region,+ proxy_mode=proxy_mode,+ memory_enabled=memory,+ telemetry_enabled=telemetry and not no_telemetry,+ image=image,+ no_http2=no_http2,+ code_aware=code_aware,+ intercept_tool_results=intercept_tool_results,+ protect_tool_results=protect_tool_results,+ bedrock_profile=bedrock_profile,+ extra_env=extra_env or {},+ )+ if supervisor_kind is not None:+ manifest.supervisor_kind = supervisor_kind+ if extra_base_env:+ manifest.base_env.update(extra_base_env)+ return manifest+++def _apply_manifest(manifest: DeploymentManifest) -> None:+ try:+ existing = load_manifest(manifest.profile)+ except ManifestError as e:+ # A corrupt existing manifest shouldn't block a fresh apply; overwrite it.+ click.echo(f"Warning: {e}; overwriting.")+ existing = None+ if existing is not None:+ click.echo(f"Updating existing deployment profile '{manifest.profile}'...")+ _remove_deployment(existing)++ try:+ manifest.artifacts = install_supervisor(manifest)+ save_manifest(manifest)+ _start_deployment(manifest)+ _activate_deployment_mutations(manifest)+ except Exception as exc:+ _remove_deployment(manifest)+ if existing is not None:+ click.echo(f"Restoring previous deployment '{manifest.profile}'...")+ _restore_deployment(existing)+ # Surface non-Click errors (OSError, CalledProcessError, ...) as a clean+ # message rather than a raw traceback; Click errors pass through as-is.+ if isinstance(exc, click.ClickException | click.Abort):+ raise+ raise click.ClickException(+ f"Failed to install deployment '{manifest.profile}': {exc}"+ ) from exc+++def _echo_installed(manifest: DeploymentManifest, *, prefix: str = "Installed persistent") -> None:+ click.echo(+ f"{prefix} deployment '{manifest.profile}' "+ f"({manifest.preset}, runtime={manifest.runtime_kind}, scope={manifest.scope})."+ )+ click.echo(f"Health: {manifest.health_url}")+ if manifest.targets:+ click.echo(f"Targets: {', '.join(manifest.targets)}")++@install.command("apply")@click.option("--preset",@@ -323,20 +523,21 @@ def install_apply(key, _, value = item.partition("=")parsed_env[key] = value- manifest = build_manifest(+ manifest = _build_deployment_manifest(profile=profile,preset=preset,- runtime_kind=runtime,+ runtime=runtime,scope=scope,provider_mode=provider_mode,- targets=list(targets),+ targets=targets,port=port,backend=backend,anyllm_provider=anyllm_provider,region=region,proxy_mode=proxy_mode,- memory_enabled=memory,- telemetry_enabled=telemetry and not no_telemetry,+ memory=memory,+ telemetry=telemetry,+ no_telemetry=no_telemetry,image=image,no_http2=no_http2,code_aware=code_aware,@@ -346,39 +547,122 @@ def install_apply(extra_env=parsed_env,)- try:- existing = load_manifest(profile)- except ManifestError as e:- # A corrupt existing manifest shouldn't block a fresh apply; overwrite it.- click.echo(f"Warning: {e}; overwriting.")- existing = None- if existing is not None:- click.echo(f"Updating existing deployment profile '{profile}'...")- _remove_deployment(existing)+ _apply_manifest(manifest)+ _echo_installed(manifest)- try:- manifest.artifacts = install_supervisor(manifest)- save_manifest(manifest)- _start_deployment(manifest)- _activate_deployment_mutations(manifest)- except Exception as exc:- _remove_deployment(manifest)- if existing is not None:- click.echo(f"Restoring previous deployment '{profile}'...")- _restore_deployment(existing)- # Surface non-Click errors (OSError, CalledProcessError, …) as a clean- # message rather than a raw traceback; Click errors pass through as-is.- if isinstance(exc, click.ClickException | click.Abort):- raise- raise click.ClickException(f"Failed to install deployment '{profile}': {exc}") from exc- click.echo(- f"Installed persistent deployment '{profile}' "- f"({manifest.preset}, runtime={manifest.runtime_kind}, scope={manifest.scope})."[email protected]("deploy")[email protected]("--profile", default="default", show_default=True, help="Deployment profile name.")+ "--port", "-p", default=8787, type=int, show_default=True, help="Persistent proxy port."+)+ "--backend",+ default="anthropic",+ show_default=True,+ help="Proxy backend for the persistent runtime.",+)+ "--anyllm-provider",+ default=None,+ help="Provider for any-llm backends when --backend anyllm is used.",+)[email protected]("--region", default=None, help="Cloud region for Bedrock / Vertex style backends.")+ "--mode", "proxy_mode", default="token", show_default=True, help="Proxy optimization mode."+)+ "--scope",+ type=click.Choice([scope.value for scope in ConfigScope]),+ default=ConfigScope.USER.value,+ show_default=True,+ help="Where to apply persistent configuration.",+)+ "--providers",+ "provider_mode",+ type=click.Choice([mode.value for mode in ProviderSelectionMode]),+ default=ProviderSelectionMode.AUTO.value,+ show_default=True,+ help="Target selection mode for direct tool configuration.",+)+ "--target",+ "targets",+ multiple=True,+ type=click.Choice(["claude", "copilot", "codex", "aider", "cursor", "openclaw", "opencode"]),+ help="Tool target to configure when --providers manual is used.",+)[email protected]("--memory", is_flag=True, help="Enable persistent memory in the proxy runtime.")+ "--telemetry",+ is_flag=True,+ help="Opt in to anonymous telemetry in the runtime (off by default).",+)+ "--no-telemetry",+ is_flag=True,+ help="Force anonymous telemetry off in the runtime (already the default).",+)+ "--image",+ default="ghcr.io/chopratejas/headroom:latest",+ show_default=True,+ help="Docker image to use when Docker is selected.",+)+ "--no-docker",+ is_flag=True,+ help="Use the native Python runtime even when Docker is installed.",+)+ "--no-http2",+ is_flag=True,+ help="Disable HTTP/2 in the persistent runtime (enabled by default).",+)+def deploy(+ profile: str,+ port: int,+ backend: str,+ anyllm_provider: str | None,+ region: str | None,+ proxy_mode: str,+ scope: str,+ provider_mode: str,+ targets: tuple[str, ...],+ memory: bool,+ telemetry: bool,+ no_telemetry: bool,+ image: str,+ no_docker: bool,+ no_http2: bool,+) -> None:+ """Deploy a turnkey local Headroom proxy and configure detected tools."""++ plan = _select_turnkey_plan(prefer_docker=not no_docker)+ click.echo(f"Selected {plan.preset} ({plan.runtime}): {plan.reason}")+ manifest = _build_deployment_manifest(+ profile=profile,+ preset=plan.preset,+ runtime=plan.runtime,+ scope=scope,+ provider_mode=provider_mode,+ targets=targets,+ port=port,+ backend=backend,+ anyllm_provider=anyllm_provider,+ region=region,+ proxy_mode=proxy_mode,+ memory=memory,+ telemetry=telemetry,+ no_telemetry=no_telemetry,+ image=image,+ no_http2=no_http2,+ supervisor_kind=plan.supervisor_kind,+ extra_base_env=plan.base_env,)- click.echo(f"Health: {manifest.health_url}")- if manifest.targets:- click.echo(f"Targets: {', '.join(manifest.targets)}")+ _apply_manifest(manifest)+ _echo_installed(manifest, prefix="Deployed turnkey")@install.command("status")diff --git a/headroom/install/runtime.py b/headroom/install/runtime.pyindex a0dbe4b59..43bf89243 100644--- a/headroom/install/runtime.py+++ b/headroom/install/runtime.py@@ -132,6 +132,9 @@ def build_runtime_command(manifest: DeploymentManifest) -> list[str]:"--volume",f"{_mount_source(home, '.config/opencode')}:{container_home}/.config/opencode",]+ docker_gpus = manifest.base_env.get("HEADROOM_DOCKER_GPUS", "").strip()+ if docker_gpus:+ command.extend(["--gpus", docker_gpus])if not _is_windows():getuid = getattr(os, "getuid", None)getgid = getattr(os, "getgid", None)diff --git a/tests/test_cli/test_install_cli.py b/tests/test_cli/test_install_cli.pyindex 95c05046f..46590c132 100644--- a/tests/test_cli/test_install_cli.py+++ b/tests/test_cli/test_install_cli.py@@ -540,6 +540,16 @@ def test_install_apply_uses_docker_runtime_for_persistent_docker(monkeypatch) ->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.probe_ready", lambda url: False)+ monkeypatch.setattr("headroom.cli.install.runtime_status", lambda deployment: "stopped")++ import contextlib++ @contextlib.contextmanager+ def fake_lock(profile):+ yield True++ monkeypatch.setattr("headroom.cli.install.acquire_runtime_start_lock", fake_lock)monkeypatch.setattr("headroom.cli.install.start_persistent_docker",lambda deployment: calls.append("start_docker"),@@ -565,6 +575,175 @@ def test_install_apply_uses_docker_runtime_for_persistent_docker(monkeypatch) ->assert calls == ["start_docker"]+def test_deploy_prefers_docker_when_available(monkeypatch) -> None:+ runner = CliRunner()+ captured: dict[str, object] = {}+ calls: list[str] = []++ class Manifest:+ profile = "default"+ preset = "persistent-docker"+ runtime_kind = "docker"+ supervisor_kind = "none"+ scope = "user"+ health_url = "http://127.0.0.1:8787/readyz"+ targets = ["claude", "codex"]+ mutations = []+ artifacts = []++ def fake_build(**kwargs):+ captured.update(kwargs)+ return Manifest()++ monkeypatch.setattr(+ "headroom.cli.install._command_available", lambda command: command == "docker"+ )+ monkeypatch.setattr(+ "headroom.cli.install.shutil.which",+ lambda name, *args, **kwargs: "/usr/local/bin/docker" if name == "docker" else None,+ )+ monkeypatch.setattr("headroom.cli.install.build_manifest", fake_build)+ 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.probe_ready", lambda url: False)+ monkeypatch.setattr("headroom.cli.install.runtime_status", lambda deployment: "stopped")++ import contextlib++ @contextlib.contextmanager+ def fake_lock(profile):+ yield True++ monkeypatch.setattr("headroom.cli.install.acquire_runtime_start_lock", fake_lock)+ monkeypatch.setattr(+ "headroom.cli.install.start_persistent_docker",+ lambda deployment: calls.append("start_docker"),+ )+ monkeypatch.setattr(+ "headroom.cli.install.wait_ready", lambda deployment, timeout_seconds=45: True+ )++ result = runner.invoke(main, ["deploy"])++ assert result.exit_code == 0, result.output+ assert "Selected persistent-docker" in result.output+ assert "Deployed turnkey deployment 'default'" in result.output+ assert captured["preset"] == "persistent-docker"+ assert captured["runtime_kind"] == "docker"+ assert calls == ["start_docker"]+++def test_deploy_prefers_gpu_docker_when_available(monkeypatch) -> None:+ runner = CliRunner()+ captured: dict[str, object] = {}++ class Manifest:+ profile = "default"+ preset = "persistent-docker"+ runtime_kind = "docker"+ supervisor_kind = "none"+ scope = "user"+ health_url = "http://127.0.0.1:8787/readyz"+ targets: list[str] = []+ base_env: dict[str, str] = {}+ mutations = []+ artifacts = []++ manifest = Manifest()++ def fake_build(**kwargs):+ captured.update(kwargs)+ return manifest++ monkeypatch.setattr("headroom.cli.install._detect_nvidia_gpu_names", lambda: ["RTX 4090"])+ monkeypatch.setattr("headroom.cli.install._docker_supports_nvidia_gpus", lambda: True)+ monkeypatch.setattr(+ "headroom.cli.install.shutil.which",+ lambda name, *args, **kwargs: "/usr/local/bin/docker" if name == "docker" else None,+ )+ monkeypatch.setattr("headroom.cli.install.build_manifest", fake_build)+ 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.probe_ready", lambda url: False)+ monkeypatch.setattr("headroom.cli.install.runtime_status", lambda deployment: "stopped")++ import contextlib++ @contextlib.contextmanager+ def fake_lock(profile):+ yield True++ monkeypatch.setattr("headroom.cli.install.acquire_runtime_start_lock", fake_lock)+ monkeypatch.setattr("headroom.cli.install.start_persistent_docker", lambda deployment: None)+ monkeypatch.setattr(+ "headroom.cli.install.wait_ready", lambda deployment, timeout_seconds=45: True+ )++ result = runner.invoke(main, ["deploy"])++ assert result.exit_code == 0, result.output+ assert "RTX 4090" in result.output+ assert captured["preset"] == "persistent-docker"+ assert captured["runtime_kind"] == "docker"+ assert manifest.base_env["HEADROOM_DOCKER_GPUS"] == "all"+++def test_deploy_falls_back_to_detached_python_without_supervisor(monkeypatch) -> None:+ runner = CliRunner()+ calls: list[str] = []++ class Manifest:+ profile = "default"+ preset = "persistent-task"+ runtime_kind = "python"+ supervisor_kind = "task"+ scope = "user"+ health_url = "http://127.0.0.1:8787/readyz"+ targets: list[str] = []+ mutations = []+ artifacts = []++ manifest = Manifest()++ monkeypatch.setattr("headroom.cli.install._command_available", lambda command: False)+ monkeypatch.setattr("headroom.cli.install.build_manifest", lambda **_: 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: calls.append(f"supervisor:{deployment.supervisor_kind}") or [],+ )+ monkeypatch.setattr("headroom.cli.install.save_manifest", lambda deployment: None)+ monkeypatch.setattr("headroom.cli.install.probe_ready", lambda url: False)+ monkeypatch.setattr("headroom.cli.install.runtime_status", lambda deployment: "stopped")++ import contextlib++ @contextlib.contextmanager+ def fake_lock(profile):+ yield True++ monkeypatch.setattr("headroom.cli.install.acquire_runtime_start_lock", fake_lock)+ monkeypatch.setattr(+ "headroom.cli.install.start_detached_agent",+ lambda profile: calls.append(f"agent:{profile}"),+ )+ monkeypatch.setattr(+ "headroom.cli.install.wait_ready", lambda deployment, timeout_seconds=45: True+ )++ result = runner.invoke(main, ["deploy", "--no-docker"])++ assert result.exit_code == 0, result.output+ assert "No supported supervisor was detected" in result.output+ assert manifest.supervisor_kind == "none"+ assert calls == ["supervisor:none", "agent:default"]++def test_install_remove_continues_when_runtime_teardown_errors(monkeypatch) -> None:runner = CliRunner()calls: list[str] = []diff --git a/tests/test_install/test_runtime.py b/tests/test_install/test_runtime.pyindex e013c65c9..efdc8c494 100644--- a/tests/test_install/test_runtime.py+++ b/tests/test_install/test_runtime.py@@ -63,6 +63,32 @@ def test_build_runtime_command_for_docker_includes_deployment_env(assert "HEADROOM_CONFIG_DIR=/tmp/headroom-home/.headroom/config" in command+def test_build_runtime_command_for_docker_includes_gpu_passthrough(+ monkeypatch, tmp_path: Path+) -> None:+ monkeypatch.setattr(Path, "home", lambda: tmp_path)++ manifest = DeploymentManifest(+ profile="default",+ preset="persistent-docker",+ runtime_kind="docker",+ supervisor_kind="none",+ scope="user",+ provider_mode="manual",+ targets=["claude"],+ port=8787,+ host="127.0.0.1",+ backend="anthropic",+ image="ghcr.io/chopratejas/headroom:latest",+ base_env={"HEADROOM_PORT": "8787", "HEADROOM_DOCKER_GPUS": "all"},+ proxy_args=["--host", "127.0.0.1", "--port", "8787"],+ )++ command = build_runtime_command(manifest)++ assert command[command.index("--gpus") + 1] == "all"++def test_build_runtime_command_docker_manifest_env_beats_host_passthrough(monkeypatch, tmp_path: Path) -> None: