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

推荐订阅源

P
Proofpoint News Feed
V
V2EX
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
The Cloudflare Blog
T
Tailwind CSS Blog
H
Help Net Security
腾讯CDC
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
C
Check Point Blog
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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: select Codex OAuth profile for bound app-server turn...
keshavbotage · 2026-05-04 · via Recent Commits to openclaw:main

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

2525

} from "./protocol.js";

2626

import {

2727

clearCodexAppServerBinding,

28+

isCodexAppServerNativeAuthProfileId,

2829

readCodexAppServerBinding,

2930

writeCodexAppServerBinding,

3031

type CodexAppServerThreadBinding,

@@ -57,19 +58,24 @@ export async function startOrResumeThread(params: {

5758

await clearCodexAppServerBinding(params.params.sessionFile);

5859

} else {

5960

try {

61+

const authProfileId = params.params.authProfileId ?? binding.authProfileId;

6062

const response = assertCodexThreadResumeResponse(

6163

await params.client.request(

6264

"thread/resume",

6365

buildThreadResumeParams(params.params, {

6466

threadId: binding.threadId,

67+

authProfileId,

6568

appServer: params.appServer,

6669

developerInstructions: params.developerInstructions,

6770

config: params.config,

6871

}),

6972

),

7073

);

71-

const boundAuthProfileId = params.params.authProfileId ?? binding.authProfileId;

72-

const fallbackModelProvider = resolveCodexAppServerModelProvider(params.params.provider);

74+

const boundAuthProfileId = authProfileId;

75+

const fallbackModelProvider = resolveCodexAppServerModelProvider({

76+

provider: params.params.provider,

77+

authProfileId: boundAuthProfileId,

78+

});

7379

await writeCodexAppServerBinding(params.params.sessionFile, {

7480

threadId: response.thread.id,

7581

cwd: params.cwd,

@@ -112,7 +118,10 @@ export async function startOrResumeThread(params: {

112118

}),

113119

),

114120

);

115-

const modelProvider = resolveCodexAppServerModelProvider(params.params.provider);

121+

const modelProvider = resolveCodexAppServerModelProvider({

122+

provider: params.params.provider,

123+

authProfileId: params.params.authProfileId,

124+

});

116125

const createdAt = new Date().toISOString();

117126

await writeCodexAppServerBinding(params.params.sessionFile, {

118127

threadId: response.thread.id,

@@ -147,7 +156,10 @@ export function buildThreadStartParams(

147156

config?: JsonObject;

148157

},

149158

): CodexThreadStartParams {

150-

const modelProvider = resolveCodexAppServerModelProvider(params.provider);

159+

const modelProvider = resolveCodexAppServerModelProvider({

160+

provider: params.provider,

161+

authProfileId: params.authProfileId,

162+

});

151163

return {

152164

model: params.modelId,

153165

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

@@ -169,12 +181,16 @@ export function buildThreadResumeParams(

169181

params: EmbeddedRunAttemptParams,

170182

options: {

171183

threadId: string;

184+

authProfileId?: string;

172185

appServer: CodexAppServerRuntimeOptions;

173186

developerInstructions?: string;

174187

config?: JsonObject;

175188

},

176189

): CodexThreadResumeParams {

177-

const modelProvider = resolveCodexAppServerModelProvider(params.provider);

190+

const modelProvider = resolveCodexAppServerModelProvider({

191+

provider: params.provider,

192+

authProfileId: options.authProfileId ?? params.authProfileId,

193+

});

178194

return {

179195

threadId: options.threadId,

180196

model: params.modelId,

@@ -326,14 +342,28 @@ function buildUserInput(

326342

];

327343

}

328344329-

function resolveCodexAppServerModelProvider(provider: string): string | undefined {

330-

const normalized = provider.trim();

331-

if (!normalized || normalized === "codex") {

345+

function resolveCodexAppServerModelProvider(params: {

346+

provider: string;

347+

authProfileId?: string;

348+

}): string | undefined {

349+

const normalized = params.provider.trim();

350+

const normalizedLower = normalized.toLowerCase();

351+

if (!normalized || normalizedLower === "codex") {

332352

// `codex` is OpenClaw's virtual provider; let Codex app-server keep its

333353

// native provider/auth selection instead of forcing the legacy OpenAI path.

334354

return undefined;

335355

}

336-

return normalized === "openai-codex" ? "openai" : normalized;

356+

if (

357+

isCodexAppServerNativeAuthProfileId(params.authProfileId) &&

358+

(normalizedLower === "openai" || normalizedLower === "openai-codex")

359+

) {

360+

// When OpenClaw is forwarding ChatGPT/Codex OAuth, forcing the public

361+

// OpenAI model provider makes app-server call api.openai.com without the

362+

// ChatGPT bearer and fails with "Missing bearer or basic authentication".

363+

// Omit the provider so app-server keeps its native account-backed route.

364+

return undefined;

365+

}

366+

return normalizedLower === "openai-codex" ? "openai" : normalized;

337367

}

338368339369

// Modern Codex models (gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.2) use the