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

推荐订阅源

罗磊的独立博客
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
U
Unit 42
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
腾讯CDC
I
InfoQ
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
fix: force message through empty allowlists · openclaw/op...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

File tree

  • extensions/codex/src/app-server

  • src/agents

    • pi-embedded-runner/run

Original file line numberDiff line numberDiff line change

@@ -918,6 +918,37 @@ describe("runCodexAppServerAttempt", () => {

918918

expect(dynamicToolNames).toContain("music_generate");

919919

});

920920
921+

it("keeps forced message dynamic tool when toolsAllow is empty", async () => {

922+

__testing.setOpenClawCodingToolsFactoryForTests(() => [

923+

createRuntimeDynamicTool("message"),

924+

createRuntimeDynamicTool("music_generate"),

925+

]);

926+

const harness = createStartedThreadHarness();

927+

const params = createParams(

928+

path.join(tempDir, "session.jsonl"),

929+

path.join(tempDir, "workspace"),

930+

);

931+

params.disableTools = false;

932+

params.runtimePlan = createCodexRuntimePlanFixture();

933+

params.sourceReplyDeliveryMode = "message_tool_only";

934+

params.toolsAllow = [];

935+
936+

const run = runCodexAppServerAttempt(params, {

937+

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

938+

});

939+

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

940+

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

941+

await run;

942+
943+

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

944+

const dynamicToolNames =

945+

(

946+

startRequest?.params as { dynamicTools?: Array<{ name?: string }> } | undefined

947+

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

948+
949+

expect(dynamicToolNames).toEqual(["message"]);

950+

});

951+
921952

it("starts Codex threads with searchable OpenClaw dynamic tools by default", async () => {

922953

__testing.setOpenClawCodingToolsFactoryForTests(() => [

923954

createRuntimeDynamicTool("message"),

Original file line numberDiff line numberDiff line change

@@ -2344,9 +2344,12 @@ function includeForcedMessageToolAllow(

23442344

if (!shouldForceMessageTool(params)) {

23452345

return toolsAllow;

23462346

}

2347-

if (!toolsAllow?.length) {

2347+

if (toolsAllow === undefined) {

23482348

return toolsAllow;

23492349

}

2350+

if (toolsAllow.length === 0) {

2351+

return ["message"];

2352+

}

23502353

const normalized = new Set(toolsAllow.map((name) => normalizeCodexDynamicToolName(name)));

23512354

return normalized.has("message") ? toolsAllow : [...toolsAllow, "message"];

23522355

}

Original file line numberDiff line numberDiff line change

@@ -59,6 +59,18 @@ describe("applyEmbeddedAttemptToolsAllow", () => {

5959

]);

6060

});

6161
62+

it("materializes forced message tool through empty runtime allowlists", () => {

63+

const tools = [{ name: "music_generate" }, { name: "message" }];

64+

const toolsAllow = mergeForcedEmbeddedAttemptToolsAllow([], {

65+

forceMessageTool: true,

66+

});

67+
68+

expect(toolsAllow).toEqual(["message"]);

69+

expect(applyEmbeddedAttemptToolsAllow(tools, toolsAllow).map((tool) => tool.name)).toEqual([

70+

"message",

71+

]);

72+

});

73+
6274

it("normalizes explicit toolsAllow entries before filtering", () => {

6375

const tools = [{ name: "cron" }, { name: "read" }, { name: "message" }];

6476

@@ -155,6 +167,24 @@ describe("resolveEmbeddedAttemptToolConstructionPlan", () => {

155167

});

156168

});

157169
170+

it("constructs message tool for forced message delivery on explicit no-tools runs", () => {

171+

expectConstructionPlan(

172+

resolveEmbeddedAttemptToolConstructionPlan({ toolsAllow: [], forceMessageTool: true }),

173+

{

174+

constructTools: true,

175+

includeCoreTools: true,

176+

runtimeToolAllowlist: ["message"],

177+

coding: {

178+

includeBaseCodingTools: false,

179+

includeShellTools: false,

180+

includeChannelTools: false,

181+

includeOpenClawTools: true,

182+

includePluginTools: false,

183+

},

184+

},

185+

);

186+

});

187+
158188

it("materializes only plugin candidates for plugin-only allowlists", () => {

159189

expectConstructionPlan(

160190

resolveEmbeddedAttemptToolConstructionPlan({ toolsAllow: ["memory_search"] }),

Original file line numberDiff line numberDiff line change

@@ -113,9 +113,16 @@ export function mergeForcedEmbeddedAttemptToolsAllow(

113113

toolsAllow: string[] | undefined,

114114

params: { forceMessageTool?: boolean },

115115

): string[] | undefined {

116-

if (!params.forceMessageTool || !toolsAllow?.length || hasWildcardToolAllowlist(toolsAllow)) {

116+

if (

117+

!params.forceMessageTool ||

118+

toolsAllow === undefined ||

119+

hasWildcardToolAllowlist(toolsAllow)

120+

) {

117121

return toolsAllow;

118122

}

123+

if (toolsAllow.length === 0) {

124+

return ["message"];

125+

}

119126

const normalized = new Set(toolsAllow.map((entry) => normalizeToolName(entry)));

120127

return normalized.has("message") ? toolsAllow : [...toolsAllow, "message"];

121128

}

Original file line numberDiff line numberDiff line change

@@ -39,12 +39,19 @@ describe("extractToolResultMediaPaths", () => {

3939

attachments: [

4040

{ type: "audio", path: "/tmp/song.mp3", mimeType: "audio/mpeg" },

4141

{ type: "image", url: "https://example.test/cover.png" },

42+

{ type: "file", media: "/tmp/stems.zip" },

43+

{ type: "file", fileUrl: "https://example.test/stems.zip" },

4244

],

4345

},

4446

},

4547

}),

4648

).toEqual({

47-

mediaUrls: ["/tmp/song.mp3", "https://example.test/cover.png"],

49+

mediaUrls: [

50+

"/tmp/song.mp3",

51+

"https://example.test/cover.png",

52+

"/tmp/stems.zip",

53+

"https://example.test/stems.zip",

54+

],

4855

});

4956

});

5057
Original file line numberDiff line numberDiff line change

@@ -379,10 +379,12 @@ function collectStructuredMediaUrls(media: Record<string, unknown>): string[] {

379379

return;

380380

}

381381

const attachment = value as Record<string, unknown>;

382+

pushString(attachment.media);

382383

pushString(attachment.path);

383384

pushString(attachment.url);

384385

pushString(attachment.mediaUrl);

385386

pushString(attachment.filePath);

387+

pushString(attachment.fileUrl);

386388

};

387389

if (typeof media.mediaUrl === "string" && media.mediaUrl.trim()) {

388390

urls.push(media.mediaUrl.trim());