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

推荐订阅源

The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
The Cloudflare Blog
G
Google Developers Blog
博客园_首页
Martin Fowler
Martin Fowler
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
D
Docker
C
Check Point Blog
T
Tailwind CSS Blog
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
GbyAI
GbyAI

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: pin Codex side question calls · openclaw/openclaw@e...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -252,76 +252,96 @@ describe("runCodexAppServerSideQuestion", () => {

252252

const result = await runCodexAppServerSideQuestion(sideParams());

253253254254

expect(result).toEqual({ text: "Side answer." });

255-

expect(client.request).toHaveBeenNthCalledWith(

256-

1,

257-

"thread/fork",

258-

expect.objectContaining({

259-

threadId: "parent-thread",

260-

model: "gpt-5.5",

261-

approvalPolicy: "on-request",

262-

sandbox: "workspace-write",

263-

ephemeral: true,

264-

threadSource: "user",

265-

}),

266-

expect.any(Object),

267-

);

268-

expect(client.request.mock.calls[0]?.[1]).not.toHaveProperty("dynamicTools");

269-

expect(client.request.mock.calls[0]?.[1]).not.toHaveProperty("modelProvider");

270-

expect(client.request).toHaveBeenNthCalledWith(

271-

2,

272-

"thread/inject_items",

273-

expect.objectContaining({

274-

threadId: "side-thread",

275-

items: [expect.objectContaining({ type: "message", role: "user" })],

276-

}),

277-

expect.any(Object),

255+

const forkCall = client.request.mock.calls[0];

256+

expect(forkCall?.[0]).toBe("thread/fork");

257+

const forkParams = forkCall?.[1] as Record<string, unknown> | undefined;

258+

expect(Object.keys(forkParams ?? {}).sort()).toEqual([

259+

"approvalPolicy",

260+

"approvalsReviewer",

261+

"config",

262+

"cwd",

263+

"developerInstructions",

264+

"ephemeral",

265+

"model",

266+

"sandbox",

267+

"threadId",

268+

"threadSource",

269+

]);

270+

expect(forkParams?.threadId).toBe("parent-thread");

271+

expect(forkParams?.model).toBe("gpt-5.5");

272+

expect(forkParams?.approvalPolicy).toBe("on-request");

273+

expect(forkParams?.sandbox).toBe("workspace-write");

274+

expect(forkParams?.ephemeral).toBe(true);

275+

expect(forkParams?.threadSource).toBe("user");

276+

expect(forkParams?.approvalsReviewer).toBe("user");

277+

expect(forkParams?.cwd).toBe("/tmp/workspace");

278+

expect(forkParams?.config).toEqual({

279+

"features.code_mode": true,

280+

"features.code_mode_only": true,

281+

});

282+

expect(forkParams?.developerInstructions).toContain("You are in a side conversation");

283+

expect(forkParams?.developerInstructions).toContain(

284+

"Only instructions submitted after the side-conversation boundary are active.",

278285

);

279-

const injectedItem = (

280-

client.request.mock.calls.find(([method]) => method === "thread/inject_items")?.[1] as {

281-

items?: Array<{ content?: Array<{ text?: string }> }>;

282-

}

283-

)?.items?.[0];

286+

expect(forkCall?.[2]).toEqual({ timeoutMs: 60_000, signal: undefined });

287+288+

const injectCall = client.request.mock.calls[1];

289+

expect(injectCall?.[0]).toBe("thread/inject_items");

290+

const injectParams = injectCall?.[1] as

291+

| { threadId?: string; items?: Array<{ type?: string; role?: string; content?: unknown }> }

292+

| undefined;

293+

expect(injectParams?.threadId).toBe("side-thread");

294+

expect(injectParams?.items).toHaveLength(1);

295+

expect(injectParams?.items?.[0]?.type).toBe("message");

296+

expect(injectParams?.items?.[0]?.role).toBe("user");

297+

expect(injectCall?.[2]).toEqual({ timeoutMs: 60_000, signal: undefined });

298+

const injectedItem = injectParams?.items?.[0] as

299+

| { content?: Array<{ text?: string }> }

300+

| undefined;

284301

const injectedText = injectedItem?.content?.[0]?.text;

285302

expect(injectedText).toContain(

286303

"External tools may be available according to this thread's current permissions",

287304

);

288305

expect(injectedText).toContain(

289306

"unless the user explicitly asks for that mutation after this boundary",

290307

);

291-

expect(client.request).toHaveBeenCalledWith(

308+

const turnStartCall = client.request.mock.calls.find(([method]) => method === "turn/start");

309+

expect(turnStartCall).toEqual([

292310

"turn/start",

293-

expect.objectContaining({

311+

{

294312

threadId: "side-thread",

295313

input: [{ type: "text", text: "What changed?", text_elements: [] }],

314+

cwd: "/tmp/workspace",

296315

model: "gpt-5.5",

297-

}),

298-

expect.any(Object),

299-

);

300-

const turnStartParams = client.request.mock.calls.find(

301-

([method]) => method === "turn/start",

302-

)?.[1] as Record<string, unknown> | undefined;

316+

effort: null,

317+

collaborationMode: {

318+

mode: "default",

319+

settings: {

320+

model: "gpt-5.5",

321+

reasoning_effort: null,

322+

developer_instructions: null,

323+

},

324+

},

325+

},

326+

{ timeoutMs: 60_000, signal: undefined },

327+

]);

328+

const turnStartParams = turnStartCall?.[1] as Record<string, unknown> | undefined;

303329

expect(turnStartParams).not.toHaveProperty("approvalPolicy");

304330

expect(turnStartParams).not.toHaveProperty("sandboxPolicy");

305-

expect(client.request).toHaveBeenLastCalledWith(

331+

expect(client.request.mock.calls.at(-1)).toEqual([

306332

"thread/unsubscribe",

307333

{ threadId: "side-thread" },

308-

expect.any(Object),

309-

);

310-

expect(client.request).not.toHaveBeenCalledWith(

311-

"turn/interrupt",

312-

expect.anything(),

313-

expect.anything(),

314-

);

315-

expect(createOpenClawCodingToolsMock).toHaveBeenCalledWith(

316-

expect.objectContaining({

317-

agentDir: "/tmp/agent",

318-

workspaceDir: "/tmp/workspace",

319-

sessionId: "session-1",

320-

modelProvider: "openai",

321-

modelId: "gpt-5.5",

322-

requireExplicitMessageTarget: true,

323-

}),

324-

);

334+

{ timeoutMs: 60_000 },

335+

]);

336+

expect(client.request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

337+338+

const [toolOptions] = createOpenClawCodingToolsMock.mock.calls[0] ?? [];

339+

expect(toolOptions).toHaveProperty("agentDir", "/tmp/agent");

340+

expect(toolOptions).toHaveProperty("workspaceDir", "/tmp/workspace");

341+

expect(toolOptions).toHaveProperty("sessionId", "session-1");

342+

expect(toolOptions).toHaveProperty("modelProvider", "openai");

343+

expect(toolOptions).toHaveProperty("modelId", "gpt-5.5");

344+

expect(toolOptions).toHaveProperty("requireExplicitMessageTarget", true);

325345

});

326346327347

it("bridges side-thread dynamic tool requests to OpenClaw tools", async () => {

@@ -362,12 +382,13 @@ describe("runCodexAppServerSideQuestion", () => {

362382

const result = await runCodexAppServerSideQuestion(sideParams());

363383364384

expect(result).toEqual({ text: "Tool answer." });

365-

expect(toolExecuteMock).toHaveBeenCalledWith(

366-

"tool-1",

367-

{ topic: "AGENTS.md" },

368-

expect.any(AbortSignal),

369-

undefined,

370-

);

385+

const [toolCallId, toolArguments, toolSignal, toolOptions] =

386+

toolExecuteMock.mock.calls[0] ?? [];

387+

expect(toolExecuteMock).toHaveBeenCalledTimes(1);

388+

expect(toolCallId).toBe("tool-1");

389+

expect(toolArguments).toEqual({ topic: "AGENTS.md" });

390+

expect(toolSignal).toBeInstanceOf(AbortSignal);

391+

expect(toolOptions).toBeUndefined();

371392

expect(toolResponse).toEqual({

372393

success: true,

373394

contentItems: [{ type: "inputText", text: "tool output" }],

@@ -549,15 +570,11 @@ describe("runCodexAppServerSideQuestion", () => {

549570

}),

550571

),

551572

).rejects.toThrow("Codex /btw was aborted.");

552-

expect(client.request).toHaveBeenCalledWith(

553-

"turn/interrupt",

554-

{ threadId: "side-thread", turnId: "turn-1" },

555-

expect.any(Object),

556-

);

557-

expect(client.request).toHaveBeenCalledWith(

558-

"thread/unsubscribe",

559-

{ threadId: "side-thread" },

560-

expect.any(Object),

573+

expect(client.request.mock.calls.filter(([method]) => method === "turn/interrupt")).toEqual([

574+

["turn/interrupt", { threadId: "side-thread", turnId: "turn-1" }, { timeoutMs: 60_000 }],

575+

]);

576+

expect(client.request.mock.calls.filter(([method]) => method === "thread/unsubscribe")).toEqual(

577+

[["thread/unsubscribe", { threadId: "side-thread" }, { timeoutMs: 60_000 }]],

561578

);

562579

});

563580

});