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

推荐订阅源

罗磊的独立博客
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
WordPress大学
WordPress大学
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
博客园 - Franky
博客园 - 司徒正美
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
Jina AI
Jina AI
Last Week in AI
Last Week in AI
雷峰网
雷峰网
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
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
test: avoid codex heartbeat lifecycle timeout · openclaw/...
steipete · 2026-05-24 · via Recent Commits to openclaw:main

@@ -555,6 +555,31 @@ async function buildDynamicToolsForTest(

555555

});

556556

}

557557558+

async function createCodexToolBridgeForTest(

559+

params: EmbeddedRunAttemptParams,

560+

workspaceDir: string,

561+

options: Partial<

562+

Pick<

563+

Parameters<typeof testing.buildDynamicTools>[0],

564+

"forceHeartbeatTool" | "ignoreRuntimePlan"

565+

>

566+

> = {},

567+

) {

568+

const signal = new AbortController().signal;

569+

const tools = await buildDynamicToolsForTest(params, workspaceDir, options);

570+

const registeredTools = await buildDynamicToolsForTest(params, workspaceDir, {

571+

...options,

572+

forceHeartbeatTool: true,

573+

ignoreRuntimePlan: true,

574+

});

575+

return createCodexDynamicToolBridge({

576+

tools,

577+

registeredTools,

578+

signal,

579+

directToolNames: testing.shouldForceMessageTool(params) ? ["message"] : [],

580+

});

581+

}

582+558583

function filterAllowedRuntimeToolNamesForTest(

559584

params: EmbeddedRunAttemptParams,

560585

tools: RuntimeDynamicToolForTest[],

@@ -2358,14 +2383,18 @@ describe("runCodexAppServerAttempt", () => {

23582383

? [createRuntimeDynamicTool("heartbeat_respond")]

23592384

: []),

23602385

]);

2361-

const harness = createStartedThreadHarness(async (method) => {

2386+

const request = vi.fn(async (method: string) => {

2387+

if (method === "thread/start") {

2388+

return threadStartResult("thread-1");

2389+

}

23622390

if (method === "thread/resume") {

23632391

return threadStartResult("thread-1");

23642392

}

2365-

return undefined;

2393+

throw new Error(`unexpected method: ${method}`);

23662394

});

23672395

const sessionFile = path.join(tempDir, "session.jsonl");

23682396

const workspaceDir = path.join(tempDir, "workspace");

2397+

const appServer = createThreadLifecycleAppServerOptions();

23692398

const createRunParams = (trigger?: EmbeddedRunAttemptParams["trigger"]) => {

23702399

const params = createParams(sessionFile, workspaceDir);

23712400

params.disableTools = false;

@@ -2378,16 +2407,26 @@ describe("runCodexAppServerAttempt", () => {

23782407

}

23792408

return params;

23802409

};

2410+

const startOrResume = async (params: EmbeddedRunAttemptParams) => {

2411+

const toolBridge = await createCodexToolBridgeForTest(params, workspaceDir);

2412+

return startOrResumeThread({

2413+

client: { request } as never,

2414+

params,

2415+

cwd: workspaceDir,

2416+

dynamicTools: toolBridge.specs,

2417+

appServer,

2418+

developerInstructions: testing.buildDeveloperInstructions(params, {

2419+

dynamicTools: toolBridge.availableSpecs,

2420+

}),

2421+

nativeCodeModeEnabled: true,

2422+

userMcpServersEnabled: false,

2423+

});

2424+

};

238124252382-

const normalRun = runCodexAppServerAttempt(createRunParams(), {

2383-

pluginConfig: { appServer: { mode: "yolo" } },

2384-

});

2385-

await harness.waitForMethod("turn/start", 120_000);

2386-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2387-

await normalRun;

2426+

await startOrResume(createRunParams());

238824272389-

const startRequest = harness.requests.find((entry) => entry.method === "thread/start");

2390-

const startParams = startRequest?.params as

2428+

const startRequest = request.mock.calls.find(([method]) => method === "thread/start");

2429+

const startParams = startRequest?.[1] as

23912430

| { dynamicTools?: Array<{ name?: string }>; developerInstructions?: string }

23922431

| undefined;

23932432

const registeredToolNames = startParams?.dynamicTools?.map((tool) => tool.name) ?? [];

@@ -2401,32 +2440,14 @@ describe("runCodexAppServerAttempt", () => {

24012440

"Deferred searchable OpenClaw dynamic tools available: heartbeat_respond",

24022441

);

240324422404-

const heartbeatRun = runCodexAppServerAttempt(createRunParams("heartbeat"), {

2405-

pluginConfig: { appServer: { mode: "yolo" } },

2406-

});

2407-

await vi.waitFor(

2408-

() => {

2409-

expect(harness.requests.filter((entry) => entry.method === "turn/start")).toHaveLength(2);

2410-

},

2411-

{ interval: 1, timeout: 120_000 },

2412-

);

2413-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2414-

await heartbeatRun;

2443+

await startOrResume(createRunParams("heartbeat"));

2444+

await startOrResume(createRunParams());

241524452416-

const nextNormalRun = runCodexAppServerAttempt(createRunParams(), {

2417-

pluginConfig: { appServer: { mode: "yolo" } },

2418-

});

2419-

await vi.waitFor(

2420-

() => {

2421-

expect(harness.requests.filter((entry) => entry.method === "turn/start")).toHaveLength(3);

2422-

},

2423-

{ interval: 1, timeout: 120_000 },

2424-

);

2425-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2426-

await nextNormalRun;

2427-2428-

expect(harness.requests.filter((entry) => entry.method === "thread/start")).toHaveLength(1);

2429-

expect(harness.requests.filter((entry) => entry.method === "thread/resume")).toHaveLength(2);

2446+

expect(request.mock.calls.map(([method]) => method)).toEqual([

2447+

"thread/start",

2448+

"thread/resume",

2449+

"thread/resume",

2450+

]);

24302451

});

2431245224322453

it("keeps the persistent dynamic schema stable across heartbeat-only turns", async () => {

@@ -2437,14 +2458,18 @@ describe("runCodexAppServerAttempt", () => {

24372458

? [createRuntimeDynamicTool("heartbeat_respond")]

24382459

: []),

24392460

]);

2440-

const harness = createStartedThreadHarness(async (method) => {

2461+

const request = vi.fn(async (method: string) => {

2462+

if (method === "thread/start") {

2463+

return threadStartResult("thread-1");

2464+

}

24412465

if (method === "thread/resume") {

24422466

return threadStartResult("thread-1");

24432467

}

2444-

return undefined;

2468+

throw new Error(`unexpected method: ${method}`);

24452469

});

24462470

const sessionFile = path.join(tempDir, "session.jsonl");

24472471

const workspaceDir = path.join(tempDir, "workspace");

2472+

const appServer = createThreadLifecycleAppServerOptions();

24482473

const createRunParams = (trigger?: EmbeddedRunAttemptParams["trigger"]) => {

24492474

const params = createParams(sessionFile, workspaceDir);

24502475

params.disableTools = false;

@@ -2464,41 +2489,29 @@ describe("runCodexAppServerAttempt", () => {

24642489

}

24652490

return params;

24662491

};

2492+

const startOrResume = async (params: EmbeddedRunAttemptParams) => {

2493+

const toolBridge = await createCodexToolBridgeForTest(params, workspaceDir);

2494+

return startOrResumeThread({

2495+

client: { request } as never,

2496+

params,

2497+

cwd: workspaceDir,

2498+

dynamicTools: toolBridge.specs,

2499+

appServer,

2500+

developerInstructions: testing.buildDeveloperInstructions(params, {

2501+

dynamicTools: toolBridge.availableSpecs,

2502+

}),

2503+

nativeCodeModeEnabled: true,

2504+

userMcpServersEnabled: false,

2505+

});

2506+

};

246725072468-

const normalRun = runCodexAppServerAttempt(createRunParams(), {

2469-

pluginConfig: { appServer: { mode: "yolo" } },

2470-

});

2471-

await harness.waitForMethod("turn/start", 120_000);

2472-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2473-

await normalRun;

2474-2475-

const heartbeatRun = runCodexAppServerAttempt(createRunParams("heartbeat"), {

2476-

pluginConfig: { appServer: { mode: "yolo" } },

2477-

});

2478-

await vi.waitFor(

2479-

() => {

2480-

expect(harness.requests.filter((entry) => entry.method === "turn/start")).toHaveLength(2);

2481-

},

2482-

{ interval: 1, timeout: 120_000 },

2483-

);

2484-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2485-

await heartbeatRun;

2486-2487-

const nextNormalRun = runCodexAppServerAttempt(createRunParams(), {

2488-

pluginConfig: { appServer: { mode: "yolo" } },

2489-

});

2490-

await vi.waitFor(

2491-

() => {

2492-

expect(harness.requests.filter((entry) => entry.method === "turn/start")).toHaveLength(3);

2493-

},

2494-

{ interval: 1, timeout: 120_000 },

2495-

);

2496-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2497-

await nextNormalRun;

2508+

await startOrResume(createRunParams());

2509+

await startOrResume(createRunParams("heartbeat"));

2510+

await startOrResume(createRunParams());

2498251124992512

expect(

2500-

harness.requests

2501-

.map((entry) => entry.method)

2513+

request.mock.calls

2514+

.map(([method]) => method)

25022515

.filter((method) => method === "thread/start" || method === "thread/resume"),

25032516

).toEqual(["thread/start", "thread/resume", "thread/resume"]);

25042517

});