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

推荐订阅源

Recent Announcements
Recent Announcements
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园 - Franky
M
MIT News - Artificial intelligence
U
Unit 42
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
J
Java Code Geeks
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
V
V2EX

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
[codex] Make external CLI credential discovery explicit (...
steipete · 2026-05-01 · via Recent Commits to openclaw:main

@@ -10,6 +10,7 @@ import {

1010

log,

1111

} from "./constants.js";

1212

import { overlayExternalAuthProfiles, shouldPersistExternalAuthProfile } from "./external-auth.js";

13+

import type { ExternalCliAuthDiscovery } from "./external-cli-discovery.js";

1314

import { isSafeToAdoptMainStoreOAuthIdentity } from "./oauth-shared.js";

1415

import {

1516

ensureAuthStoreFile,

@@ -38,6 +39,7 @@ import type { AuthProfileStore } from "./types.js";

3839

type LoadAuthProfileStoreOptions = {

3940

allowKeychainPrompt?: boolean;

4041

config?: OpenClawConfig;

42+

externalCli?: ExternalCliAuthDiscovery;

4143

readOnly?: boolean;

4244

syncExternalCli?: boolean;

4345

externalCliProviderIds?: Iterable<string>;

@@ -49,6 +51,13 @@ type SaveAuthProfileStoreOptions = {

4951

syncExternalCli?: boolean;

5052

};

515354+

type ResolvedExternalCliOverlayOptions = {

55+

allowKeychainPrompt?: boolean;

56+

config?: OpenClawConfig;

57+

externalCliProviderIds?: Iterable<string>;

58+

externalCliProfileIds?: Iterable<string>;

59+

};

60+5261

const loadedAuthStoreCache = new Map<

5362

string,

5463

{

@@ -183,6 +192,51 @@ function writeCachedAuthProfileStore(params: {

183192

});

184193

}

185194195+

function resolveExternalCliOverlayOptions(

196+

options: LoadAuthProfileStoreOptions | undefined,

197+

): ResolvedExternalCliOverlayOptions {

198+

const discovery = options?.externalCli;

199+

if (!discovery) {

200+

return {

201+

...(options?.allowKeychainPrompt !== undefined

202+

? { allowKeychainPrompt: options.allowKeychainPrompt }

203+

: {}),

204+

...(options?.config ? { config: options.config } : {}),

205+

...(options?.externalCliProviderIds

206+

? { externalCliProviderIds: options.externalCliProviderIds }

207+

: {}),

208+

...(options?.externalCliProfileIds

209+

? { externalCliProfileIds: options.externalCliProfileIds }

210+

: {}),

211+

};

212+

}

213+

if (discovery.mode === "none") {

214+

const config = discovery.config ?? options?.config;

215+

return {

216+

allowKeychainPrompt: false,

217+

...(config ? { config } : {}),

218+

externalCliProviderIds: [],

219+

externalCliProfileIds: [],

220+

};

221+

}

222+

if (discovery.mode === "existing") {

223+

const allowKeychainPrompt = discovery.allowKeychainPrompt ?? options?.allowKeychainPrompt;

224+

const config = discovery.config ?? options?.config;

225+

return {

226+

...(allowKeychainPrompt !== undefined ? { allowKeychainPrompt } : {}),

227+

...(config ? { config } : {}),

228+

};

229+

}

230+

const allowKeychainPrompt = discovery.allowKeychainPrompt ?? options?.allowKeychainPrompt;

231+

const config = discovery.config ?? options?.config;

232+

return {

233+

...(allowKeychainPrompt !== undefined ? { allowKeychainPrompt } : {}),

234+

...(config ? { config } : {}),

235+

...(discovery.providerIds ? { externalCliProviderIds: discovery.providerIds } : {}),

236+

...(discovery.profileIds ? { externalCliProfileIds: discovery.profileIds } : {}),

237+

};

238+

}

239+186240

function shouldKeepProfileInLocalStore(params: {

187241

store: AuthProfileStore;

188242

profileId: string;

@@ -384,23 +438,18 @@ export function loadAuthProfileStoreForRuntime(

384438

const store = loadAuthProfileStoreForAgent(agentDir, options);

385439

const authPath = resolveAuthStorePath(agentDir);

386440

const mainAuthPath = resolveAuthStorePath();

441+

const externalCli = resolveExternalCliOverlayOptions(options);

387442

if (!agentDir || authPath === mainAuthPath) {

388443

return overlayExternalAuthProfiles(store, {

389444

agentDir,

390-

allowKeychainPrompt: options?.allowKeychainPrompt,

391-

config: options?.config,

392-

externalCliProviderIds: options?.externalCliProviderIds,

393-

externalCliProfileIds: options?.externalCliProfileIds,

445+

...externalCli,

394446

});

395447

}

396448397449

const mainStore = loadAuthProfileStoreForAgent(undefined, options);

398450

return overlayExternalAuthProfiles(mergeAuthProfileStores(mainStore, store), {

399451

agentDir,

400-

allowKeychainPrompt: options?.allowKeychainPrompt,

401-

config: options?.config,

402-

externalCliProviderIds: options?.externalCliProviderIds,

403-

externalCliProfileIds: options?.externalCliProfileIds,

452+

...externalCli,

404453

});

405454

}

406455

@@ -426,18 +475,17 @@ export function ensureAuthProfileStore(

426475

options?: {

427476

allowKeychainPrompt?: boolean;

428477

config?: OpenClawConfig;

478+

externalCli?: ExternalCliAuthDiscovery;

429479

externalCliProviderIds?: Iterable<string>;

430480

externalCliProfileIds?: Iterable<string>;

431481

},

432482

): AuthProfileStore {

483+

const externalCli = resolveExternalCliOverlayOptions(options);

433484

return overlayExternalAuthProfiles(

434485

ensureAuthProfileStoreWithoutExternalProfiles(agentDir, options),

435486

{

436487

agentDir,

437-

allowKeychainPrompt: options?.allowKeychainPrompt,

438-

config: options?.config,

439-

externalCliProviderIds: options?.externalCliProviderIds,

440-

externalCliProfileIds: options?.externalCliProfileIds,

488+

...externalCli,

441489

},

442490

);

443491

}