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(ci): switch e2e runtime to python:3.11-slim (trixie, glibc 2.41)
chopratejas73a4782917cf
diff --git a/e2e/init/Dockerfile b/e2e/init/Dockerfileindex d51fa20dd..3dd825712 100644--- a/e2e/init/Dockerfile+++ b/e2e/init/Dockerfile@@ -22,11 +22,16 @@ COPY crates/ crates/COPY headroom/ headroom/ENV PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1+# Build for Python 3.11 to match Stage 2's `python:3.11-slim` runtime.RUN /opt/python/cp311-cp311/bin/pip install 'maturin>=1.5,<2.0' && \/opt/python/cp311-cp311/bin/maturin build --release --out /dist --interpreter python3.11-# ─── Stage 2: node-based init e2e runtime ──────────────────────────────────-FROM node:22-bookworm+# ─── Stage 2: python runtime ───────────────────────────────────────────────+# `python:3.11-slim` (now trixie, glibc 2.41) — see e2e/wrap/Dockerfile+# for why we need glibc ≥ 2.38 (the wheel's `_core.so` references C23+# symbols that bookworm's 2.36 doesn't export). The init e2e harness+# only needs python (no node) — `headroom init -g <target>` is Python.+FROM python:3.11-slimENV DEBIAN_FRONTEND=noninteractive \PATH="/opt/headroom-venv/bin:${PATH}" \@@ -38,11 +43,7 @@ ENV DEBIAN_FRONTEND=noninteractive \RUN apt-get update && \apt-get install -y --no-install-recommends \ca-certificates \- git \- python3 \- python3-pip \- python3-venv && \- ln -sf /usr/bin/python3 /usr/local/bin/python && \+ git && \rm -rf /var/lib/apt/lists/*WORKDIR /workspace@@ -61,7 +62,7 @@ COPY e2e/_lib ./e2e/_libCOPY e2e/init ./e2e/initRUN python -m venv /opt/headroom-venv && \- /opt/headroom-venv/bin/python -m pip install --upgrade "pip<25" && \+ /opt/headroom-venv/bin/python -m pip install --upgrade pip && \/opt/headroom-venv/bin/python -m pip install "$(ls /tmp/wheels/headroom_ai-*.whl)[proxy]" && \/opt/headroom-venv/bin/python -c "from headroom._core import DiffCompressor; print('headroom._core OK')"diff --git a/e2e/wrap/Dockerfile b/e2e/wrap/Dockerfileindex e974f7010..1881ff2e6 100644--- a/e2e/wrap/Dockerfile+++ b/e2e/wrap/Dockerfile@@ -33,14 +33,27 @@ COPY headroom/ headroom/# Build the wheel with maturin. PYO3_USE_ABI3_FORWARD_COMPATIBILITY allows# building against Python 3.14+ until we bump pyo3 past 0.22.ENV PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1+# Build for Python 3.11 — aider-chat==0.86.2 requires Python <3.12, and+# trixie's default python3.13 is too new for aider. The manylinux image+# has python interpreters for every version at /opt/python/cpXY-cpXY/.+# Stage 2 uses `python:3.11-slim` (now trixie-based, glibc 2.41).RUN /opt/python/cp311-cp311/bin/pip install 'maturin>=1.5,<2.0' && \/opt/python/cp311-cp311/bin/maturin build --release --out /dist --interpreter python3.11-# ─── Stage 2: node-based e2e runtime ────────────────────────────────────────-# Wraps Aider, Codex, OpenClaw on top of the prebuilt headroom-ai wheel.-# No rust/maturin needed at this stage — we just `pip install` the wheel-# from stage 1.-FROM node:22-bookworm+# ─── Stage 2: python+node runtime ───────────────────────────────────────────+# Base on `python:3.11-slim` (now trixie, glibc 2.41) instead of+# `node:22-bookworm` (glibc 2.36): the wheel's `_core.so` references+# three glibc 2.38+ C23 wrappers (`__isoc23_strtol{,l,ul}`) that one of+# our transitive C/C++ deps emits during cc-rs compilation even when+# built inside manylinux_2_28 (probably libstdc++'s `<cstdlib>` resolving+# `std::strtoll` to the C23 variant when the toolchain has newer+# headers). Bookworm's libc.so.6 doesn't export these wrappers, so+# `import headroom._core` fails at runtime. Trixie's glibc 2.41 does.+#+# We need Python 3.11 here (aider-chat==0.86.2 requires Python <3.12).+# Trixie's default `python3` is 3.13 — too new for aider. python:3.11-slim+# gives us Python 3.11 + trixie glibc + apt access for installing Node.+FROM python:3.11-slimENV DEBIAN_FRONTEND=noninteractive \AIDER_CHAT_VERSION=0.86.2 \@@ -52,15 +65,17 @@ ENV DEBIAN_FRONTEND=noninteractive \PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1+# Install Node.js 22 from NodeSource (matches what node:22-trixie gives,+# but layered onto python:3.11-slim so we get py3.11 + node22 + glibc 2.41+# in one image). Also install git for any package that clones at install.RUN apt-get update && \apt-get install -y --no-install-recommends \ca-certificates \curl \git \- python3 \- python3-pip \- python3-venv && \- ln -sf /usr/bin/python3 /usr/local/bin/python && \+ gnupg && \+ curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \+ apt-get install -y --no-install-recommends nodejs && \rm -rf /var/lib/apt/lists/*WORKDIR /workspace