Skip to content

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.

fix(openclaw): detect uv-installed headroom binary in ~/.local/bin (#1459)

Krishnaadaeb88a4d55
diff --git a/plugins/openclaw/src/proxy-manager.ts b/plugins/openclaw/src/proxy-manager.ts
index aa0fda4f9..2abab5ce1 100644
--- a/plugins/openclaw/src/proxy-manager.ts
+++ b/plugins/openclaw/src/proxy-manager.ts
@@ -11,6 +11,7 @@ import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
+import os from "os";
export interface ProxyManagerConfig {
proxyUrl?: string;
@@ -258,12 +259,27 @@ export class ProxyManager {
checkCommand: process.platform === "win32" ? "where.exe" : "sh",
checkArgs: process.platform === "win32"
? ["headroom"]
- : ["-lc", "command -v headroom >/dev/null 2>&1"],
+ : ["-c", "command -v headroom >/dev/null 2>&1"],
useShell: process.platform === "win32",
checkUseShell: false,
});
- // 4) Local npm install (inside plugin install path)
+ // 4) uv tool install path (~/.local/bin/headroom)
+ const uvBin = join(
+ os.homedir(),
+ ".local", "bin", "headroom"
+ );
+ if (existsSync(uvBin)) {
+ specs.push({
+ label: `uv tool: ${uvBin}`,
+ command: uvBin,
+ args: commonArgs,
+ checkCommand: uvBin,
+ checkArgs: ["--version"],
+ });
+ }
+
+ // 5) Local npm install (inside plugin install path)
const moduleDir = dirname(fileURLToPath(import.meta.url)); // .../dist
const packageRoot = dirname(moduleDir);
const localBinDir = join(packageRoot, "node_modules", ".bin");