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
style: apply ruff formatting for wrap openclaw changes
JerrettDavis490cf15a5702
diff --git a/headroom/cli/wrap.py b/headroom/cli/wrap.pyindex 769ac7e9a..1cd115349 100644--- a/headroom/cli/wrap.py+++ b/headroom/cli/wrap.py@@ -417,7 +417,9 @@ def _resolve_openclaw_extensions_dir(openclaw_bin: str) -> Path:result = _run_checked([openclaw_bin, "config", "file"], action="openclaw config file")config_path_str = result.stdout.strip().splitlines()[-1].strip()if not config_path_str:- raise click.ClickException("Unable to resolve OpenClaw config path from `openclaw config file`.")+ raise click.ClickException(+ "Unable to resolve OpenClaw config path from `openclaw config file`."+ )config_path = Path(config_path_str).expanduser()return config_path.parent / "extensions"@@ -888,9 +890,7 @@ def openclaw("""openclaw_bin = shutil.which("openclaw")if not openclaw_bin:- raise click.ClickException(- "'openclaw' not found in PATH. Install OpenClaw CLI first."- )+ raise click.ClickException("'openclaw' not found in PATH. Install OpenClaw CLI first.")plugin_dir = plugin_path.resolve() if plugin_path else Nonelocal_source_mode = plugin_dir is not Nonediff --git a/tests/test_cli/test_wrap_openclaw.py b/tests/test_cli/test_wrap_openclaw.pyindex 6cba09dfd..f8947bd06 100644--- a/tests/test_cli/test_wrap_openclaw.py+++ b/tests/test_cli/test_wrap_openclaw.py@@ -67,8 +67,7 @@ def test_wrap_openclaw_default_installs_from_npm_and_restarts(runner: CliRunner)install_call = next(cfor c in calls- if c["cmd"][:4]- == ["openclaw", "plugins", "install", "--dangerously-force-unsafe-install"]+ if c["cmd"][:4] == ["openclaw", "plugins", "install", "--dangerously-force-unsafe-install"])assert install_call["cwd"] is None@@ -77,7 +76,11 @@ def test_wrap_openclaw_default_installs_from_npm_and_restarts(runner: CliRunner)assert ["npm", "run", "build"] not in cmds# Verify config payload includes enabled + expected defaults- set_entry = next(c for c in calls if c["cmd"][:4] == ["openclaw", "config", "set", "plugins.entries.headroom"])+ set_entry = next(+ c+ for c in calls+ if c["cmd"][:4] == ["openclaw", "config", "set", "plugins.entries.headroom"]+ )payload = json.loads(set_entry["cmd"][4])assert payload["enabled"] is Trueassert payload["config"]["proxyPort"] == 8787@@ -116,7 +119,9 @@ def test_wrap_openclaw_skip_build_and_no_restart(runner: CliRunner, plugin_dir:assert ["openclaw", "gateway", "restart"] not in cmds-def test_wrap_openclaw_local_source_mode_builds_and_links(runner: CliRunner, plugin_dir: Path) -> None:+def test_wrap_openclaw_local_source_mode_builds_and_links(+ runner: CliRunner, plugin_dir: Path+) -> None:calls: list[dict] = []def which(name: str) -> str | None: