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

推荐订阅源

C
Check Point Blog
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
S
SegmentFault 最新的问题
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - Franky
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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
Preserve runtime external auth snapshots (#85558) · openc...
TurboTheTurt · 2026-05-26 · via Recent Commits to openclaw:main

@@ -6,7 +6,11 @@ import { resolveOAuthDir } from "../../config/paths.js";

66

import { AUTH_STORE_VERSION } from "./constants.js";

77

import { legacyOAuthSidecarTestUtils } from "./legacy-oauth-sidecar.js";

88

import { resolveAuthStorePath } from "./paths.js";

9-

import { coercePersistedAuthProfileStore, loadPersistedAuthProfileStore } from "./persisted.js";

9+

import {

10+

coercePersistedAuthProfileStore,

11+

loadPersistedAuthProfileStore,

12+

mergeAuthProfileStores,

13+

} from "./persisted.js";

10141115

function withEnvValue(key: string, value: string | undefined): () => void {

1216

const previous = process.env[key];

@@ -212,4 +216,139 @@ describe("persisted auth profile boundary", () => {

212216

fs.rmSync(stateDir, { recursive: true, force: true });

213217

}

214218

});

219+220+

it("lets authoritative runtime external metadata remove stale base profiles", () => {

221+

const merged = mergeAuthProfileStores(

222+

{

223+

version: AUTH_STORE_VERSION,

224+

runtimeExternalProfileIds: ["anthropic:claude-cli"],

225+

runtimeExternalProfileIdsAuthoritative: true,

226+

profiles: {

227+

"anthropic:claude-cli": {

228+

type: "oauth",

229+

provider: "anthropic",

230+

access: "stale-access",

231+

refresh: "stale-refresh",

232+

expires: 1,

233+

},

234+

},

235+

order: {

236+

anthropic: ["anthropic:claude-cli"],

237+

},

238+

lastGood: {

239+

anthropic: "anthropic:claude-cli",

240+

},

241+

},

242+

{

243+

version: AUTH_STORE_VERSION,

244+

runtimeExternalProfileIds: [],

245+

runtimeExternalProfileIdsAuthoritative: true,

246+

profiles: {},

247+

},

248+

);

249+250+

expect(merged.runtimeExternalProfileIds).toEqual([]);

251+

expect(merged.runtimeExternalProfileIdsAuthoritative).toBe(true);

252+

expect(merged.profiles["anthropic:claude-cli"]).toBeUndefined();

253+

expect(merged.order?.anthropic).toBeUndefined();

254+

expect(merged.lastGood?.anthropic).toBeUndefined();

255+

});

256+257+

it("keeps override profiles when authoritative metadata removes base runtime external state", () => {

258+

const profileId = "anthropic:claude-cli";

259+

const merged = mergeAuthProfileStores(

260+

{

261+

version: AUTH_STORE_VERSION,

262+

runtimeExternalProfileIds: [profileId],

263+

runtimeExternalProfileIdsAuthoritative: true,

264+

profiles: {

265+

[profileId]: {

266+

type: "oauth",

267+

provider: "anthropic",

268+

access: "stale-access",

269+

refresh: "stale-refresh",

270+

expires: 1,

271+

},

272+

},

273+

order: {

274+

anthropic: [profileId],

275+

},

276+

lastGood: {

277+

anthropic: profileId,

278+

},

279+

},

280+

{

281+

version: AUTH_STORE_VERSION,

282+

runtimeExternalProfileIds: [],

283+

runtimeExternalProfileIdsAuthoritative: true,

284+

profiles: {

285+

[profileId]: {

286+

type: "api_key",

287+

provider: "anthropic",

288+

key: "sk-local",

289+

},

290+

},

291+

order: {

292+

anthropic: [profileId],

293+

},

294+

lastGood: {

295+

anthropic: profileId,

296+

},

297+

},

298+

);

299+300+

expect(merged.runtimeExternalProfileIds).toEqual([]);

301+

expect(merged.runtimeExternalProfileIdsAuthoritative).toBe(true);

302+

expect(merged.profiles[profileId]).toMatchObject({

303+

type: "api_key",

304+

provider: "anthropic",

305+

key: "sk-local",

306+

});

307+

expect(merged.order?.anthropic).toEqual([profileId]);

308+

expect(merged.lastGood?.anthropic).toBe(profileId);

309+

});

310+311+

it("preserves inherited base runtime external profiles during agent-store merges", () => {

312+

const profileId = "anthropic:claude-cli";

313+

const merged = mergeAuthProfileStores(

314+

{

315+

version: AUTH_STORE_VERSION,

316+

runtimeExternalProfileIds: [profileId],

317+

runtimeExternalProfileIdsAuthoritative: true,

318+

profiles: {

319+

[profileId]: {

320+

type: "oauth",

321+

provider: "anthropic",

322+

access: "main-access",

323+

refresh: "main-refresh",

324+

expires: 1,

325+

},

326+

},

327+

order: {

328+

anthropic: [profileId],

329+

},

330+

lastGood: {

331+

anthropic: profileId,

332+

},

333+

},

334+

{

335+

version: AUTH_STORE_VERSION,

336+

runtimeExternalProfileIds: [],

337+

runtimeExternalProfileIdsAuthoritative: true,

338+

profiles: {},

339+

},

340+

{ preserveBaseRuntimeExternalProfiles: true },

341+

);

342+343+

expect(merged.runtimeExternalProfileIds).toEqual([profileId]);

344+

expect(merged.runtimeExternalProfileIdsAuthoritative).toBe(true);

345+

expect(merged.profiles[profileId]).toMatchObject({

346+

type: "oauth",

347+

provider: "anthropic",

348+

access: "main-access",

349+

refresh: "main-refresh",

350+

});

351+

expect(merged.order?.anthropic).toEqual([profileId]);

352+

expect(merged.lastGood?.anthropic).toBe(profileId);

353+

});

215354

});