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(cli): wire --http2/--no-http2 (HEADROOM_HTTP2) into proxy command (#1373)
gglucasse06b61671f5c
diff --git a/headroom/cli/proxy.py b/headroom/cli/proxy.pyindex 336557949..fb28ab35f 100644--- a/headroom/cli/proxy.py+++ b/headroom/cli/proxy.py@@ -177,6 +177,17 @@ def dashboard(port: int, no_open: bool) -> None:envvar="HEADROOM_MAX_KEEPALIVE",help="Maximum upstream keep-alive connections (default: 100, env: HEADROOM_MAX_KEEPALIVE)",)+ "--http2/--no-http2",+ "http2",+ default=True,+ envvar="HEADROOM_HTTP2",+ help=(+ "Use HTTP/2 to upstream providers (default: on, env: HEADROOM_HTTP2). "+ "Disable to force HTTP/1.1, which avoids shared-connection TLS corruption "+ "(SSLV3_ALERT_BAD_RECORD_MAC) when many concurrent streams are cancelled."+ ),+)@click.option("--keepalive-expiry","keepalive_expiry",@@ -791,6 +802,7 @@ def proxy(max_connections: int,max_keepalive_connections: int,keepalive_expiry: float,+ http2: bool,intercept_tool_results: bool,no_optimize: bool,no_cache: bool,@@ -1041,6 +1053,7 @@ def proxy(max_connections=max_connections,max_keepalive_connections=max_keepalive_connections,keepalive_expiry=keepalive_expiry,+ http2=http2,log_file=None if is_stateless else log_file,log_full_messages=log_messagesor os.environ.get("HEADROOM_LOG_MESSAGES", "").lower() in ("true", "1", "yes", "on"),