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

推荐订阅源

博客园_首页
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
量子位
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
V
Visual Studio Blog
雷峰网
雷峰网
T
Tailwind CSS Blog
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
U
Unit 42
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog

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
test: add focused seams for faster isolated tests · openc...
steipete · 2026-05-06 · via Recent Commits to openclaw:main

@@ -1,3 +1,4 @@

1+

import { AsyncLocalStorage } from "node:async_hooks";

12

import { createHash } from "node:crypto";

23

import fs from "node:fs/promises";

34

import path from "node:path";

@@ -46,8 +47,8 @@ import {

4647

resolveCodexAppServerAuthProfileIdForAgent,

4748

} from "./auth-bridge.js";

4849

import {

49-

createCodexAppServerClientFactoryTestHooks,

5050

defaultCodexAppServerClientFactory,

51+

type CodexAppServerClientFactory,

5152

} from "./client-factory.js";

5253

import {

5354

isCodexAppServerApprovalRequest,

@@ -126,8 +127,16 @@ const CODEX_BOOTSTRAP_CONTEXT_ORDER = new Map<string, number>([

126127

type OpenClawCodingToolsOptions = NonNullable<

127128

Parameters<(typeof import("openclaw/plugin-sdk/agent-harness"))["createOpenClawCodingTools"]>[0]

128129

>;

130+

type OpenClawCodingToolsFactory =

131+

(typeof import("openclaw/plugin-sdk/agent-harness"))["createOpenClawCodingTools"];

129132130-

let clientFactory = defaultCodexAppServerClientFactory;

133+

const testClientFactoryStorage = new AsyncLocalStorage<CodexAppServerClientFactory | undefined>();

134+

const clientFactory = defaultCodexAppServerClientFactory;

135+

let openClawCodingToolsFactoryForTests: OpenClawCodingToolsFactory | undefined;

136+137+

function resolveCodexAppServerClientFactory(): CodexAppServerClientFactory {

138+

return testClientFactoryStorage.getStore() ?? clientFactory;

139+

}

131140132141

function emitCodexAppServerEvent(

133142

params: EmbeddedRunAttemptParams,

@@ -351,7 +360,7 @@ export async function runCodexAppServerAttempt(

351360

} = {},

352361

): Promise<EmbeddedRunAttemptResult> {

353362

const attemptStartedAt = Date.now();

354-

const attemptClientFactory = clientFactory;

363+

const attemptClientFactory = resolveCodexAppServerClientFactory();

355364

const pluginConfig = readCodexPluginConfig(options.pluginConfig);

356365

const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig });

357366

const resolvedWorkspace = resolveUserPath(params.workspaceDir);

@@ -1478,7 +1487,9 @@ async function buildDynamicTools(input: DynamicToolBuildParams) {

14781487

}

14791488

const modelHasVision = params.model.input?.includes("image") ?? false;

14801489

const agentDir = params.agentDir ?? resolveAgentDir(params.config ?? {}, input.sessionAgentId);

1481-

const { createOpenClawCodingTools } = await import("openclaw/plugin-sdk/agent-harness");

1490+

const createOpenClawCodingTools =

1491+

openClawCodingToolsFactoryForTests ??

1492+

(await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;

14821493

const allTools = createOpenClawCodingTools({

14831494

agentId: input.sessionAgentId,

14841495

...buildEmbeddedAttemptToolRunContext(params),

@@ -1963,7 +1974,16 @@ export const __testing = {

19631974

buildDynamicTools,

19641975

filterToolsForVisionInputs,

19651976

handleDynamicToolCallWithTimeout,

1966-

...createCodexAppServerClientFactoryTestHooks((factory) => {

1967-

clientFactory = factory;

1968-

}),

1977+

setOpenClawCodingToolsFactoryForTests(factory: OpenClawCodingToolsFactory): void {

1978+

openClawCodingToolsFactoryForTests = factory;

1979+

},

1980+

resetOpenClawCodingToolsFactoryForTests(): void {

1981+

openClawCodingToolsFactoryForTests = undefined;

1982+

},

1983+

setCodexAppServerClientFactoryForTests(factory: CodexAppServerClientFactory): void {

1984+

testClientFactoryStorage.enterWith(factory);

1985+

},

1986+

resetCodexAppServerClientFactoryForTests(): void {

1987+

testClientFactoryStorage.enterWith(undefined);

1988+

},

19691989

} as const;