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 review regressions in compare, wrap, and Docker
JerrettDavisca7384402b88
diff --git a/Dockerfile b/Dockerfileindex c75a79f04..6a5981a6a 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,5 +1,6 @@ARG PYTHON_VERSION=3.11ARG DISTROLESS_IMAGE=gcr.io/distroless/python3-debian13+ARG PYTHON_SITE_PACKAGES=/usr/local/lib/python${PYTHON_VERSION}/site-packages# ---- Build stage: compile native extensions, build wheel ----FROM python:${PYTHON_VERSION}-slim AS builder@@ -31,12 +32,13 @@ RUN --mount=type=cache,target=/root/.cache/uv \FROM python:${PYTHON_VERSION}-slim AS runtime-slim-baseARG RUNTIME_USER=nonroot+ARG PYTHON_SITE_PACKAGESRUN apt-get update && \apt-get install -y --no-install-recommends curl && \rm -rf /var/lib/apt/lists/*-COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages+COPY --from=builder ${PYTHON_SITE_PACKAGES} ${PYTHON_SITE_PACKAGES}COPY --from=builder /usr/local/bin/headroom /usr/local/bin/headroomRUN mkdir -p /home/nonroot /data && \@@ -64,8 +66,9 @@ CMD ["--host", "0.0.0.0", "--port", "8787"]FROM ${DISTROLESS_IMAGE} AS runtime-slimARG RUNTIME_USER=nonroot+ARG PYTHON_SITE_PACKAGES-COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages+COPY --from=builder ${PYTHON_SITE_PACKAGES} ${PYTHON_SITE_PACKAGES}USER ${RUNTIME_USER}WORKDIR /app@@ -73,7 +76,7 @@ WORKDIR /appENV HEADROOM_HOST=0.0.0.0 \PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1 \- PYTHONPATH=/usr/local/lib/python3.11/site-packages+ PYTHONPATH=${PYTHON_SITE_PACKAGES}EXPOSE 8787diff --git a/benchmarks/claude_session_branch_compare.py b/benchmarks/claude_session_branch_compare.pyindex f807158d4..003b08a37 100644--- a/benchmarks/claude_session_branch_compare.py+++ b/benchmarks/claude_session_branch_compare.py@@ -202,7 +202,7 @@ def _run_branch_benchmark(try:command = _build_benchmark_command(python_executable=args.python,- script_path=repo_root / "benchmarks" / "claude_session_mode_benchmark.py",+ script_path=worktree_dir / "benchmarks" / "claude_session_mode_benchmark.py",root=args.root,output_dir=branch_output_dir,max_sessions=args.max_sessions,@@ -213,7 +213,7 @@ def _run_branch_benchmark()env = os.environ.copy()env["PYTHONPATH"] = os.pathsep.join(- [str(worktree_dir), str(repo_root), env.get("PYTHONPATH", "")]+ [str(worktree_dir), env.get("PYTHONPATH", "")]).rstrip(os.pathsep)subprocess.run(command, cwd=worktree_dir, check=True, env=env)return _load_branch_result(repo_root, ref, label, branch_output_dir)diff --git a/headroom/cli/wrap.py b/headroom/cli/wrap.pyindex 1ed11b71f..afe05a5d9 100644--- a/headroom/cli/wrap.py+++ b/headroom/cli/wrap.py@@ -906,7 +906,7 @@ def openclaw()npm_bin = shutil.which("npm")- if not skip_build and not npm_bin:+ if local_source_mode and not skip_build and not npm_bin:raise click.ClickException("'npm' not found in PATH. Install Node/npm or rerun with --skip-build.")