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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
L
LangChain Blog
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
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
feat(agents): support Codex app-server runs · openclaw/op...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

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

2121

} from "../agent-scope.js";

2222

import {

2323

type AuthProfileFailureReason,

24+

type AuthProfileStore,

2425

markAuthProfileFailure,

2526

resolveAuthProfileEligibility,

2627

markAuthProfileGood,

@@ -38,6 +39,7 @@ import {

3839

FailoverError,

3940

resolveFailoverStatus,

4041

} from "../failover-error.js";

42+

import { selectAgentHarness } from "../harness/selection.js";

4143

import { LiveSessionModelSwitchError } from "../live-model-switch-error.js";

4244

import { shouldSwitchToLiveModel, clearLiveModelSwitchPending } from "../live-model-switch.js";

4345

import {

@@ -140,6 +142,13 @@ type ApiKeyInfo = ResolvedProviderAuth;

140142141143

const MAX_SAME_MODEL_IDLE_TIMEOUT_RETRIES = 1;

142144145+

function createEmptyAuthProfileStore(): AuthProfileStore {

146+

return {

147+

version: 1,

148+

profiles: {},

149+

};

150+

}

151+143152

function buildTraceToolSummary(params: {

144153

toolMetas: Array<{ toolName: string; meta?: string }>;

145154

hadFailure: boolean;

@@ -291,7 +300,6 @@ export async function runEmbeddedPiAgent(

291300

agentId: params.agentId,

292301

sessionKey: normalizedSessionKey,

293302

});

294-

await ensureOpenClawModelsJson(params.config, agentDir);

295303

const resolvedSessionKey = normalizedSessionKey;

296304

const hookRunner = getGlobalHookRunner();

297305

const hookCtx = {

@@ -318,12 +326,28 @@ export async function runEmbeddedPiAgent(

318326

provider = hookSelection.provider;

319327

modelId = hookSelection.modelId;

320328

const legacyBeforeAgentStartResult = hookSelection.legacyBeforeAgentStartResult;

329+

const agentHarness = selectAgentHarness({

330+

provider,

331+

modelId,

332+

config: params.config,

333+

agentId: params.agentId,

334+

sessionKey: params.sessionKey,

335+

agentHarnessId: params.agentHarnessId,

336+

});

337+

const pluginHarnessOwnsTransport = agentHarness.id !== "pi";

338+

if (!pluginHarnessOwnsTransport) {

339+

await ensureOpenClawModelsJson(params.config, agentDir);

340+

}

321341322342

const { model, error, authStorage, modelRegistry } = await resolveModelAsync(

323343

provider,

324344

modelId,

325345

agentDir,

326346

params.config,

347+

// Plugin harnesses may expose synthetic providers that PI cannot

348+

// discover safely; resolve their model metadata without touching PI

349+

// auth/model stores.

350+

{ skipPiDiscovery: pluginHarnessOwnsTransport },

327351

);

328352

if (!model) {

329353

throw new FailoverError(error ?? `Unknown model: ${provider}/${modelId}`, {

@@ -343,9 +367,11 @@ export async function runEmbeddedPiAgent(

343367

const ctxInfo = resolvedRuntimeModel.ctxInfo;

344368

let effectiveModel = resolvedRuntimeModel.effectiveModel;

345369346-

const authStore = ensureAuthProfileStore(agentDir, {

347-

allowKeychainPrompt: false,

348-

});

370+

const authStore = pluginHarnessOwnsTransport

371+

? createEmptyAuthProfileStore()

372+

: ensureAuthProfileStore(agentDir, {

373+

allowKeychainPrompt: false,

374+

});

349375

const preferredProfileId = params.authProfileId?.trim();

350376

let lockedProfileId = params.authProfileIdSource === "user" ? preferredProfileId : undefined;

351377

if (lockedProfileId) {

@@ -444,7 +470,12 @@ export async function runEmbeddedPiAgent(

444470

log,

445471

});

446472447-

await initializeAuthProfile();

473+

// Plugin harnesses own their model transport/auth. Running PI's generic

474+

// auth bootstrap here can turn synthetic provider markers into real

475+

// vendor-token refresh attempts before the plugin gets control.

476+

if (!pluginHarnessOwnsTransport) {

477+

await initializeAuthProfile();

478+

}

448479

const { sessionAgentId } = resolveSessionAgentIds({

449480

sessionKey: params.sessionKey,

450481

config: params.config,

@@ -731,7 +762,10 @@ export async function runEmbeddedPiAgent(

731762

disableTools: params.disableTools,

732763

provider,

733764

modelId,

734-

agentHarnessId: params.agentHarnessId,

765+

// Use the harness selected before model/auth setup for the actual

766+

// attempt too. Otherwise plugin-owned transports can skip PI auth

767+

// bootstrap but drift back to PI when the attempt is created.

768+

agentHarnessId: agentHarness.id,

735769

model: applyAuthHeaderOverride(

736770

applyLocalNoAuthHeaderOverride(effectiveModel, apiKeyInfo),

737771

// When runtime auth exchange produced a different credential