惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
爱范儿
爱范儿
GbyAI
GbyAI
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
C
Check Point Blog
H
Help Net Security
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Y
Y Combinator Blog
U
Unit 42
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
S
SegmentFault 最新的问题
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(auth): add force re-login recovery and fallback auth ...
MertBasar0 · 2026-06-01 · via Recent Commits to openclaw:main
11

import { describe, expect, it } from "vitest";

22

import { classifyFailoverSignal } from "./embedded-agent-helpers/errors.js";

33

import {

4+

buildFailoverRemediationHint,

5+

buildProviderReauthCommand,

46

coerceToFailoverError,

57

describeFailoverError,

68

FailoverError,

@@ -1240,3 +1242,72 @@ describe("failover-error", () => {

12401242

});

12411243

});

12421244

});

1245+1246+

describe("buildFailoverRemediationHint", () => {

1247+

it("returns a copy-pasteable login command for auth failures", () => {

1248+

const err = new FailoverError("missing token", {

1249+

reason: "auth",

1250+

provider: "anthropic",

1251+

model: "claude-opus-4-7",

1252+

});

1253+

expect(buildFailoverRemediationHint(err)).toBe(

1254+

"Re-authenticate with: openclaw models auth login --provider 'anthropic' --force",

1255+

);

1256+

});

1257+1258+

it("returns a hint for auth_permanent as well", () => {

1259+

const err = new FailoverError("revoked", {

1260+

reason: "auth_permanent",

1261+

provider: "google-gemini-cli",

1262+

model: "gemini-3.1-pro-preview",

1263+

});

1264+

expect(buildFailoverRemediationHint(err)).toBe(

1265+

"Re-authenticate with: openclaw models auth login --provider 'google-gemini-cli' --force",

1266+

);

1267+

});

1268+1269+

it("quotes provider ids that contain shell metacharacters", () => {

1270+

expect(buildProviderReauthCommand("custom;touch /tmp/pwned")).toBe(

1271+

"openclaw models auth login --provider 'custom;touch /tmp/pwned' --force",

1272+

);

1273+

expect(buildProviderReauthCommand("custom'provider")).toBe(

1274+

"openclaw models auth login --provider 'custom'\\''provider' --force",

1275+

);

1276+

});

1277+1278+

it("refuses control characters in rendered provider commands", () => {

1279+

expect(buildProviderReauthCommand("custom\nprovider")).toBeUndefined();

1280+

});

1281+1282+

it("wraps rendered provider commands in the standard CLI formatter", () => {

1283+

expect(buildProviderReauthCommand("anthropic", { OPENCLAW_PROFILE: "work" })).toBe(

1284+

"openclaw --profile work models auth login --provider 'anthropic' --force",

1285+

);

1286+

expect(buildProviderReauthCommand("anthropic", { OPENCLAW_CONTAINER_HINT: "dev" })).toBe(

1287+

"openclaw --container dev models auth login --provider 'anthropic' --force",

1288+

);

1289+

});

1290+1291+

it("returns undefined for non-auth reasons", () => {

1292+

const err = new FailoverError("429", {

1293+

reason: "rate_limit",

1294+

provider: "openai",

1295+

model: "gpt-5",

1296+

});

1297+

expect(buildFailoverRemediationHint(err)).toBeUndefined();

1298+

});

1299+1300+

it("returns undefined when provider is not attributed", () => {

1301+

const err = new FailoverError("no token", {

1302+

reason: "auth",

1303+

model: "claude-opus-4-7",

1304+

});

1305+

expect(buildFailoverRemediationHint(err)).toBeUndefined();

1306+

});

1307+1308+

it("returns undefined for non-FailoverError inputs", () => {

1309+

expect(buildFailoverRemediationHint(new Error("oops"))).toBeUndefined();

1310+

expect(buildFailoverRemediationHint(undefined)).toBeUndefined();

1311+

expect(buildFailoverRemediationHint("just a string")).toBeUndefined();

1312+

});

1313+

});