@elvatis_com/openclaw-cli-bridge-elvatis 0.2.20 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,15 @@
1
1
  # STATUS.md — openclaw-cli-bridge-elvatis
2
2
 
3
- _Last updated: 2026-03-08 by Akido (claude-sonnet-4-6)_
3
+ _Last updated: 2026-03-11 by Akido (claude-sonnet-4-6)_
4
4
 
5
- ## Current Version: 0.2.19 — STABLE
5
+ ## Current Version: 0.2.21 — STABLE
6
6
 
7
7
  ## What is done
8
8
 
9
9
  - ✅ Repo: `https://github.com/elvatis/openclaw-cli-bridge-elvatis`
10
- - ✅ npm: `@@@@elvatis_com/openclaw-cli-bridge-elvatis@0.2.19`
11
- - ✅ ClawHub: `openclaw-cli-bridge-elvatis@0.2.19`
10
+ - ✅ npm: `@elvatis_com/openclaw-cli-bridge-elvatis@0.2.21`
11
+ - ✅ ClawHub: `openclaw-cli-bridge-elvatis@0.2.21`
12
+ - ✅ **v0.2.21 fix:** `buildMinimalEnv()` forwards `XDG_RUNTIME_DIR` + `DBUS_SESSION_BUS_ADDRESS` — fixes Claude Code OAuth (Gnome Keyring) 401 timeout
12
13
  - ✅ Phase 1: `openai-codex` provider via `~/.codex/auth.json` (no re-login)
13
14
  - ✅ Phase 2: Local OpenAI-compatible proxy on `127.0.0.1:31337` (Gemini + Claude CLI)
14
15
  - ✅ Phase 3: 10 slash commands (`/cli-sonnet`, `/cli-opus`, `/cli-haiku`, `/cli-gemini`, `/cli-gemini-flash`, `/cli-gemini3`, `/cli-codex`, `/cli-codex-mini`, `/cli-back`, `/cli-test`)
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > OpenClaw plugin that bridges locally installed AI CLIs (Codex, Gemini, Claude Code) as model providers — with slash commands for instant model switching, restore, health testing, and model listing.
4
4
 
5
- **Current version:** `0.2.20`
5
+ **Current version:** `0.2.22`
6
6
 
7
7
  ---
8
8
 
@@ -263,6 +263,12 @@ Slash commands (requireAuth=false, gateway commands.allowFrom is the auth layer)
263
263
  **Cause:** Gateway injects large values into `process.env` at runtime. Spreading it into `spawn()` exceeds Linux's `ARG_MAX` (~2MB).
264
264
  **Fix:** `buildMinimalEnv()` — only passes `HOME`, `PATH`, `USER`, and auth keys.
265
265
 
266
+ ### Claude Code 401 / timeout on OAuth login (fixed in v0.2.21)
267
+ **Symptom:** `/cli-test cli-claude/*` times out after 30s; logs show `401 Invalid authentication credentials`.
268
+ **Cause:** `buildMinimalEnv()` did not forward `XDG_RUNTIME_DIR` and `DBUS_SESSION_BUS_ADDRESS` to the spawned `claude` subprocess. Claude Code authenticated via `claude.ai` OAuth (Claude Max plan) stores its tokens in the system keyring (Gnome Keyring / libsecret) and needs these env vars to access it.
269
+ **Affects:** Only systems using `claude auth` OAuth login (Claude Max / Teams). API-key users (`ANTHROPIC_API_KEY`) are not affected.
270
+ **Fix:** Added `XDG_RUNTIME_DIR` and `DBUS_SESSION_BUS_ADDRESS` to the forwarded env keys in `buildMinimalEnv()`.
271
+
266
272
  ### Gemini agentic mode / hangs (fixed in v0.2.4)
267
273
  **Symptom:** Gemini hangs, returns wrong answers, or says "directory does not exist".
268
274
  **Cause:** `@file` syntax (`gemini -p @/tmp/xxx.txt`) triggers agentic mode — Gemini scans the working directory for project context and treats prompts as task instructions.
@@ -281,6 +287,12 @@ npm test # vitest run (45 tests)
281
287
 
282
288
  ## Changelog
283
289
 
290
+ ### v0.2.22
291
+ - **fix:** `runClaude()` now detects expired/invalid OAuth tokens immediately (401 in stderr) and throws a clear actionable error instead of waiting for the 30s proxy timeout. Error message includes the exact re-login command.
292
+
293
+ ### v0.2.21
294
+ - **fix:** `buildMinimalEnv()` now forwards `XDG_RUNTIME_DIR` and `DBUS_SESSION_BUS_ADDRESS` to Claude Code subprocesses — required for Gnome Keyring / libsecret access when Claude Code is authenticated via `claude.ai` OAuth (Claude Max). Without these, the spawned `claude` process cannot read its OAuth token from the system keyring, resulting in `401 Invalid authentication credentials` and a 30-second timeout on `/cli-test` and all `/cli-claude/*` requests.
295
+
284
296
  ### v0.2.20
285
297
  - **fix:** `formatPrompt` now defensively coerces `content` to string via `contentToString()` — prevents `[object Object]` reaching the CLI when WhatsApp group messages contain structured content objects instead of plain strings
286
298
  - **feat:** `ChatMessage.content` now accepts `string | ContentPart[] | unknown` (OpenAI multimodal content arrays supported)
package/SKILL.md CHANGED
@@ -53,4 +53,4 @@ Each command runs `openclaw models set <model>` atomically and replies with a co
53
53
 
54
54
  See `README.md` for full configuration reference and architecture diagram.
55
55
 
56
- **Version:** 0.2.20
56
+ **Version:** 0.2.22
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-cli-bridge-elvatis",
3
3
  "name": "OpenClaw CLI Bridge",
4
- "version": "0.2.20",
4
+ "version": "0.2.22",
5
5
  "description": "Phase 1: openai-codex auth bridge. Phase 2: local HTTP proxy routing model calls through gemini/claude CLIs (vllm provider).",
6
6
  "providers": [
7
7
  "openai-codex"
@@ -36,4 +36,4 @@
36
36
  }
37
37
  }
38
38
  }
39
- }
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvatis_com/openclaw-cli-bridge-elvatis",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Bridges gemini, claude, and codex CLI tools as OpenClaw model providers. Reads existing CLI auth without re-login.",
5
5
  "type": "module",
6
6
  "openclaw": {
@@ -19,4 +19,4 @@
19
19
  "typescript": "^5.9.3",
20
20
  "vitest": "^4.0.18"
21
21
  }
22
- }
22
+ }
package/src/cli-runner.ts CHANGED
@@ -125,6 +125,9 @@ function buildMinimalEnv(): Record<string, string> {
125
125
  "XDG_CONFIG_HOME",
126
126
  "XDG_DATA_HOME",
127
127
  "XDG_CACHE_HOME",
128
+ // Required for Claude Code OAuth (Gnome Keyring / libsecret access)
129
+ "XDG_RUNTIME_DIR",
130
+ "DBUS_SESSION_BUS_ADDRESS",
128
131
  ]) {
129
132
  const v = pick(key);
130
133
  if (v) env[key] = v;
@@ -261,7 +264,16 @@ export async function runClaude(
261
264
  const result = await runCli("claude", args, prompt, timeoutMs);
262
265
 
263
266
  if (result.exitCode !== 0 && result.stdout.length === 0) {
264
- throw new Error(`claude exited ${result.exitCode}: ${result.stderr || "(no output)"}`);
267
+ const stderr = result.stderr || "(no output)";
268
+ // Detect expired/invalid OAuth token early and give a clear actionable message
269
+ // instead of letting the caller time out after 30s.
270
+ if (stderr.includes("401") || stderr.includes("Invalid authentication credentials") || stderr.includes("authentication_error")) {
271
+ throw new Error(
272
+ "Claude CLI OAuth token expired or invalid. " +
273
+ "Re-login required: run `claude auth logout && claude auth login` in a terminal, then retry."
274
+ );
275
+ }
276
+ throw new Error(`claude exited ${result.exitCode}: ${stderr}`);
265
277
  }
266
278
 
267
279
  return result.stdout;