@elvatis_com/openclaw-cli-bridge-elvatis 1.7.3 → 1.7.4

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,13 +1,13 @@
1
1
  # DASHBOARD.md — openclaw-cli-bridge-elvatis
2
2
 
3
- _Last updated: 2026-03-12_
3
+ _Last updated: 2026-03-13_
4
4
 
5
5
  <!-- SECTION: plugin_status -->
6
6
  ## Plugin Status
7
7
 
8
8
  | Component | Version | Build | Tests | Status |
9
9
  |-----------|---------|-------|-------|--------|
10
- | openclaw-cli-bridge-elvatis | 1.4.0 | ✅ | ✅ 96/96 | ✅ Stable |
10
+ | openclaw-cli-bridge-elvatis | 1.7.3 | ✅ | ✅ 96/96 | ✅ Stable |
11
11
  <!-- /SECTION: plugin_status -->
12
12
 
13
13
  <!-- SECTION: release_state -->
@@ -16,7 +16,7 @@ _Last updated: 2026-03-12_
16
16
  | Platform | Published Version | Status |
17
17
  |----------|------------------|--------|
18
18
  | GitHub | v1.3.5 | ✅ Tagged + Release |
19
- | Local | 1.4.0 | ⏳ Built + tested, pending push |
19
+ | Local | 1.7.3 | ⏳ Built, pending push |
20
20
  <!-- /SECTION: release_state -->
21
21
 
22
22
  <!-- SECTION: open_tasks -->
@@ -30,6 +30,7 @@ _No open tasks._
30
30
 
31
31
  | Task | Title | Version |
32
32
  |------|-------|---------|
33
+ | T-013 | Fix cookie expiry tracking — longest-lived auth cookie for all 4 providers | 1.7.3 |
33
34
  | T-012 | Persistent browser fallback for Claude/Gemini/ChatGPT (no CDP required) | 1.4.0 |
34
35
  | T-011 | Session-safe staged model switching (/cli-apply, /cli-pending, --now) | 0.2.25 |
35
36
  | T-009 | Stability: sleep-resilient token refresh + stopTokenRefresh cleanup | 0.2.25 |
@@ -4,6 +4,55 @@ _Last 10 sessions. Older entries in LOG-ARCHIVE.md._
4
4
 
5
5
  ---
6
6
 
7
+ ## 2026-03-13 — Session 8 (Claude Opus 4.6)
8
+
9
+ > **Agent:** claude-opus-4-6
10
+ > **Phase:** fix
11
+ > **Commit before:** v1.7.2
12
+ > **Commit after:** v1.7.3
13
+
14
+ **T-013: Fix cookie expiry tracking — longest-lived auth cookie for all 4 providers**
15
+
16
+ ### Problem
17
+ `scanClaudeCookieExpiry()` included `__cf_bm` (Cloudflare Bot Management cookie, ~30 min lifetime)
18
+ in its cookie filter list and sorted ascending by expiry (earliest first). Result: the saved
19
+ `claude-cookie-expiry.json` always showed `cookieName: "__cf_bm"` expiring in ~30 minutes.
20
+
21
+ **Impact:**
22
+ - Every gateway startup, the cookie-first check (`expiresAt - Date.now() > 1h`) failed immediately
23
+ - Fallback browser-check (headless `.ProseMirror` selector) also failed (Cloudflare block)
24
+ - `/claude-login` added to `needsLogin[]` → WhatsApp alert sent on every restart
25
+ - Same pattern affected ChatGPT (`_puid` ~7d was picked over longer-lived session tokens),
26
+ Gemini, and Grok (all sorted ascending = shortest wins)
27
+
28
+ ### Fix (index.ts)
29
+
30
+ **`scanClaudeCookieExpiry()`** (line 152):
31
+ - Removed `__cf_bm` from cookie filter list (only `sessionKey`, `lastActiveOrg` remain)
32
+ - Reversed sort: `(b.expires) - (a.expires)` → picks longest-lived cookie
33
+ - Renamed variable `earliest` → `longest` for clarity
34
+
35
+ **`scanChatGPTCookieExpiry()`** (line 176):
36
+ - Reversed sort: now picks longest-lived of `__Secure-next-auth.session-token` / `_puid` / `oai-did`
37
+
38
+ **`scanGeminiCookieExpiry()`** (line 135):
39
+ - Reversed sort: now picks longest-lived of `__Secure-1PSID` / `__Secure-3PSID` / `SID`
40
+
41
+ **`scanCookieExpiry()` (Grok)** (line 216):
42
+ - Reversed reduce: `c.expires > min.expires` instead of `<`
43
+
44
+ **Stale files deleted:**
45
+ - `~/.openclaw/claude-cookie-expiry.json` (contained `__cf_bm` with 30-min expiry)
46
+ - `~/.openclaw/chatgpt-cookie-expiry.json` (contained `_puid` with ~7d expiry)
47
+
48
+ ### Build
49
+ - `npm run build` — ✅ (pre-existing TS errors from missing openclaw/plugin-sdk, JS emitted via `--noEmitOnError false`)
50
+
51
+ ### Version
52
+ 1.7.2 → 1.7.3
53
+
54
+ ---
55
+
7
56
  ## 2026-03-12 — Session 7 (Claude Opus 4.6)
8
57
 
9
58
  > **Agent:** claude-opus-4-6
@@ -1,13 +1,13 @@
1
1
  # NEXT_ACTIONS.md — openclaw-cli-bridge-elvatis
2
2
 
3
- _Last updated: 2026-03-12_
3
+ _Last updated: 2026-03-13_
4
4
 
5
5
  <!-- SECTION: summary -->
6
6
  ## Status Summary
7
7
 
8
8
  | Status | Count |
9
9
  |---------|-------|
10
- | Done | 12 |
10
+ | Done | 13 |
11
11
  | Ready | 0 |
12
12
  | Blocked | 0 |
13
13
  <!-- /SECTION: summary -->
@@ -30,6 +30,7 @@ _No blocked tasks._
30
30
 
31
31
  | Task | Title | Date |
32
32
  |-------|--------------------------------------------------------------------|------------|
33
+ | T-013 | Fix cookie expiry tracking — longest-lived auth cookie (all 4) | 2026-03-13 |
33
34
  | T-012 | Persistent browser fallback for Claude/Gemini/ChatGPT (no CDP) | 2026-03-12 |
34
35
  | T-011 | Session-safe staged model switching (/cli-apply, /cli-pending) | 2026-03-11 |
35
36
  | T-009 | Stability: sleep-resilient token refresh + stopTokenRefresh cleanup | 2026-03-11 |
@@ -1,14 +1,14 @@
1
1
  # STATUS — openclaw-cli-bridge-elvatis
2
2
 
3
- ## Current Version: 1.6.3
3
+ ## Current Version: 1.7.3
4
4
 
5
5
  ## All 4 Providers Available — persistent Chromium profiles
6
6
  | Provider | Status | Models | Login Cmd | Cookie Expiry |
7
7
  |---|---|---|---|---|
8
8
  | Grok | ✅ | web-grok/grok-3, grok-3-fast, grok-3-mini, grok-3-mini-fast | /grok-login | ~178d |
9
9
  | Gemini | ✅ | web-gemini/gemini-2-5-pro, gemini-2-5-flash, gemini-3-pro, gemini-3-flash | /gemini-login | ~398d |
10
- | Claude.ai | ⚠️ expired | web-claude/claude-sonnet, claude-opus, claude-haiku | /claude-login | EXPIRED |
11
- | ChatGPT | ⚠️ expiring | web-chatgpt/gpt-4o, gpt-4o-mini, gpt-4.1, o3, o4-mini, gpt-5, gpt-5-mini | /chatgpt-login | ~6d |
10
+ | Claude.ai | | web-claude/claude-sonnet, claude-opus, claude-haiku | /claude-login | ~364d |
11
+ | ChatGPT | | web-chatgpt/gpt-4o, gpt-4o-mini, gpt-4.1, o3, o4-mini, gpt-5, gpt-5-mini | /chatgpt-login | ~6d (re-run /chatgpt-login to refresh) |
12
12
 
13
13
  ## Stats
14
14
  - 22 total models (6 CLI + 16 web-session)
@@ -28,8 +28,19 @@
28
28
  - 🔴 session expired — needs /xxx-login
29
29
  - ⚪ never logged in
30
30
 
31
+ ## Cookie Expiry Tracking (fixed in v1.7.3)
32
+ All 4 providers now track the **longest-lived** auth cookie instead of the shortest:
33
+ - Claude: `sessionKey` (~1 year) — was `__cf_bm` (Cloudflare, ~30 min) causing false alerts
34
+ - ChatGPT: longest of `__Secure-next-auth.session-token` / `_puid` / `oai-did`
35
+ - Gemini: longest of `__Secure-1PSID` / `__Secure-3PSID` / `SID`
36
+ - Grok: longest of `sso` / `sso-rw`
37
+
31
38
  ## Release History
32
- - v1.6.1 (2026-03-13): Fix /bridge-status — use cookie expiry as source of truth, not in-memory context
39
+ - v1.7.3 (2026-03-13): Fix cookie expiry tracking — use longest-lived auth cookie for all 4 providers
40
+ - v1.7.2 (2026-03-13): Cookie-first startup restore (skip fragile browser selector check)
41
+ - v1.7.1 (2026-03-13): /status HTML dashboard at :31337
42
+ - v1.7.0 (2026-03-13): Startup restore timeout fix, auto-relogin, keep-alive verification, vitest suite
43
+ - v1.6.1 (2026-03-13): Fix /bridge-status — use cookie expiry as source of truth
33
44
  - v1.6.0 (2026-03-13): Persistent Chromium profiles for all 4 providers (Claude web + ChatGPT)
34
45
  - v1.5.1 (2026-03-12): Fix hardcoded plugin version
35
46
  - v1.5.0 (2026-03-12): Remove /claude-login and /chatgpt-login (pre-v1.6.0 interim)
@@ -39,7 +50,6 @@
39
50
  - v1.0.0 (2026-03-11): All 4 providers headless — 96/96 tests
40
51
 
41
52
  ## Next Steps
42
- - /claude-login needs to be run (session expired)
43
- - /chatgpt-login needs to be run in ~6 days
53
+ - /chatgpt-login should be re-run soon (~6d left on _puid cookie)
44
54
  - Gemini model switching via UI (2.5 Pro vs Flash vs 3)
45
55
  - Context-window management for long conversations
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:** `1.7.3`
5
+ **Current version:** `1.7.4`
6
6
 
7
7
  ---
8
8
 
@@ -362,8 +362,15 @@ npm test # vitest run (83 tests)
362
362
 
363
363
  ## Changelog
364
364
 
365
+ ### v1.7.4
366
+ - **docs:** Handoff docs updated (DASHBOARD, LOG, STATUS, NEXT_ACTIONS)
367
+
365
368
  ### v1.7.3
366
- - **fix:** Claude cookie expiry now uses the longest-lived auth cookie (`sessionKey`, ~1 year) instead of the earliest-expiring one. `__cf_bm` (Cloudflare, ~30 min) was previously causing false "session expired" alerts every 30 minutes.
369
+ - **fix:** Cookie expiry tracking for all 4 providers now uses the **longest-lived** auth cookie instead of the shortest. Previously, short-lived cookies caused false "session expired" alerts and unnecessary WhatsApp notifications on every gateway restart:
370
+ - **Claude:** `__cf_bm` (Cloudflare, ~30 min) removed from scan list; now tracks `sessionKey` (~1 year)
371
+ - **ChatGPT:** sort reversed; now prefers `__Secure-next-auth.session-token` over `_puid` (~7d)
372
+ - **Gemini:** sort reversed; now uses longest of `__Secure-1PSID` / `__Secure-3PSID` / `SID`
373
+ - **Grok:** sort reversed; now uses longest of `sso` / `sso-rw`
367
374
 
368
375
  ### v1.7.2
369
376
  - **fix:** Startup restore now uses cookie expiry file as primary check — if cookies are still valid (>1h left), the persistent context is launched immediately without a fragile browser selector check. This eliminates false "not logged in" errors for Grok/Claude/ChatGPT caused by slow page loads or DOM selector changes.
package/SKILL.md CHANGED
@@ -66,4 +66,4 @@ On gateway restart, if any session has expired, a **WhatsApp alert** is sent aut
66
66
 
67
67
  See `README.md` for full configuration reference and architecture diagram.
68
68
 
69
- **Version:** 1.7.3
69
+ **Version:** 1.7.4
package/index.ts CHANGED
@@ -132,9 +132,10 @@ async function scanGeminiCookieExpiry(ctx: BrowserContext): Promise<GeminiExpiry
132
132
  const cookies = await ctx.cookies(["https://gemini.google.com", "https://accounts.google.com"]);
133
133
  const auth = cookies.filter(c => ["__Secure-1PSID", "__Secure-3PSID", "SID"].includes(c.name) && c.expires && c.expires > 0);
134
134
  if (!auth.length) return null;
135
- auth.sort((a, b) => (a.expires ?? 0) - (b.expires ?? 0));
136
- const earliest = auth[0];
137
- return { expiresAt: (earliest.expires ?? 0) * 1000, loginAt: Date.now(), cookieName: earliest.name };
135
+ // Use the longest-lived auth cookie for expiry tracking
136
+ auth.sort((a, b) => (b.expires ?? 0) - (a.expires ?? 0));
137
+ const longest = auth[0];
138
+ return { expiresAt: (longest.expires ?? 0) * 1000, loginAt: Date.now(), cookieName: longest.name };
138
139
  } catch { return null; }
139
140
  }
140
141
  // ── Claude cookie expiry helpers ─────────────────────────────────────────────
@@ -173,9 +174,11 @@ async function scanChatGPTCookieExpiry(ctx: BrowserContext): Promise<ChatGPTExpi
173
174
  const cookies = await ctx.cookies(["https://chatgpt.com", "https://auth0.openai.com"]);
174
175
  const auth = cookies.filter(c => ["__Secure-next-auth.session-token", "_puid", "oai-did"].includes(c.name) && c.expires && c.expires > 0);
175
176
  if (!auth.length) return null;
176
- auth.sort((a, b) => (a.expires ?? 0) - (b.expires ?? 0));
177
- const earliest = auth[0];
178
- return { expiresAt: (earliest.expires ?? 0) * 1000, loginAt: Date.now(), cookieName: earliest.name };
177
+ // Use the LONGEST-lived auth cookie for expiry tracking _puid (~7d) is
178
+ // much shorter than __Secure-next-auth.session-token and triggers false alerts.
179
+ auth.sort((a, b) => (b.expires ?? 0) - (a.expires ?? 0));
180
+ const longest = auth[0];
181
+ return { expiresAt: (longest.expires ?? 0) * 1000, loginAt: Date.now(), cookieName: longest.name };
179
182
  } catch { return null; }
180
183
  }
181
184
 
@@ -211,7 +214,8 @@ async function scanCookieExpiry(ctx: import("playwright").BrowserContext): Promi
211
214
  const cookies = await ctx.cookies(["https://grok.com", "https://x.ai"]);
212
215
  const authCookies = cookies.filter((c) => ["sso", "sso-rw"].includes(c.name) && c.expires > 0);
213
216
  if (authCookies.length === 0) return null;
214
- const earliest = authCookies.reduce((min, c) => (c.expires < min.expires ? c : min));
217
+ // Use the longest-lived auth cookie for expiry tracking
218
+ const earliest = authCookies.reduce((min, c) => (c.expires > min.expires ? c : min));
215
219
  return {
216
220
  expiresAt: earliest.expires * 1000,
217
221
  loginAt: Date.now(),
@@ -914,7 +918,7 @@ function proxyTestRequest(
914
918
  const plugin = {
915
919
  id: "openclaw-cli-bridge-elvatis",
916
920
  name: "OpenClaw CLI Bridge",
917
- version: "1.7.3",
921
+ version: "1.7.4",
918
922
  description:
919
923
  "Phase 1: openai-codex auth bridge. " +
920
924
  "Phase 2: HTTP proxy for gemini/claude CLIs. " +
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-cli-bridge-elvatis",
3
3
  "name": "OpenClaw CLI Bridge",
4
- "version": "1.7.3",
4
+ "version": "1.7.4",
5
5
  "license": "MIT",
6
6
  "description": "Phase 1: openai-codex auth bridge. Phase 2: local HTTP proxy routing model calls through gemini/claude CLIs (vllm provider).",
7
7
  "providers": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvatis_com/openclaw-cli-bridge-elvatis",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
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": {