Skip to content

Commit 618bb0a

Browse files
committed
test(agents): use neutral tool schema fixtures
Use neutral mock plugin/tool names in tool-schema tests so the fixtures do not reference a private plugin name.
1 parent a93240e commit 618bb0a

14 files changed

Lines changed: 116 additions & 114 deletions

‎extensions/codex/src/app-server/dynamic-tools.test.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe("createCodexDynamicToolBridge", () => {
303303
tools: [
304304
createTool({ name: "message" }),
305305
createTool({
306-
name: "dofbot_move_angles",
306+
name: "fuzzplugin_move_angles",
307307
parameters: { type: "array", items: { type: "number" } },
308308
execute: badExecute,
309309
}),
@@ -324,17 +324,17 @@ describe("createCodexDynamicToolBridge", () => {
324324
expect(bridge.specs.map((tool) => tool.name)).toEqual(["message"]);
325325
expect(bridge.telemetry.quarantinedTools).toEqual([
326326
{
327-
tool: "dofbot_move_angles",
328-
violations: ['dofbot_move_angles.inputSchema.type must be "object"'],
327+
tool: "fuzzplugin_move_angles",
328+
violations: ['fuzzplugin_move_angles.inputSchema.type must be "object"'],
329329
},
330330
]);
331331
expect(warn).toHaveBeenCalledWith(
332-
expect.stringContaining("dofbot_move_angles"),
332+
expect.stringContaining("fuzzplugin_move_angles"),
333333
expect.objectContaining({
334334
tools: [
335335
{
336-
tool: "dofbot_move_angles",
337-
violations: ['dofbot_move_angles.inputSchema.type must be "object"'],
336+
tool: "fuzzplugin_move_angles",
337+
violations: ['fuzzplugin_move_angles.inputSchema.type must be "object"'],
338338
},
339339
],
340340
}),
@@ -349,9 +349,9 @@ describe("createCodexDynamicToolBridge", () => {
349349
runId: "run-1",
350350
sessionId: "session-1",
351351
sessionKey: "agent:main:session-1",
352-
toolName: "dofbot_move_angles",
352+
toolName: "fuzzplugin_move_angles",
353353
deniedReason: "unsupported_tool_schema",
354-
reason: 'dofbot_move_angles.inputSchema.type must be "object"',
354+
reason: 'fuzzplugin_move_angles.inputSchema.type must be "object"',
355355
}),
356356
);
357357

@@ -360,13 +360,13 @@ describe("createCodexDynamicToolBridge", () => {
360360
turnId: "turn-1",
361361
callId: "call-1",
362362
namespace: null,
363-
tool: "dofbot_move_angles",
363+
tool: "fuzzplugin_move_angles",
364364
arguments: {},
365365
});
366366

367367
expect(result).toEqual({
368368
success: false,
369-
contentItems: [{ type: "inputText", text: "Unknown OpenClaw tool: dofbot_move_angles" }],
369+
contentItems: [{ type: "inputText", text: "Unknown OpenClaw tool: fuzzplugin_move_angles" }],
370370
});
371371
expect(badExecute).not.toHaveBeenCalled();
372372
});

‎packages/gateway-protocol/src/schema/agents-models-skills.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ describe("ToolsEffectiveResultSchema", () => {
6060
...toolsEffectiveResult(),
6161
notices: [
6262
{
63-
id: "unsupported-tool-schema:dofbot_move_angles",
63+
id: "unsupported-tool-schema:fuzzplugin_move_angles",
6464
severity: "warning",
6565
message:
66-
'Tool "dofbot_move_angles" from plugin "dofbot" has an unsupported runtime input schema and was quarantined before model projection.',
66+
'Tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has an unsupported runtime input schema and was quarantined before model projection.',
6767
},
6868
],
6969
};
@@ -76,7 +76,7 @@ describe("ToolsEffectiveResultSchema", () => {
7676
...toolsEffectiveResult(),
7777
notices: [
7878
{
79-
id: "unsupported-tool-schema:dofbot_move_angles",
79+
id: "unsupported-tool-schema:fuzzplugin_move_angles",
8080
severity: "warning",
8181
message: "Unsupported schema.",
8282
extra: true,

‎src/agents/agent-bundle-mcp-runtime.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ describe("session MCP runtime", () => {
747747
cfg: {
748748
mcp: {
749749
servers: {
750-
dofbot: {
750+
fuzzplugin: {
751751
command: process.execPath,
752752
args: [serverPath],
753753
},
@@ -761,7 +761,7 @@ describe("session MCP runtime", () => {
761761

762762
expect(catalog.servers).toEqual({});
763763
expect(catalog.tools).toEqual([]);
764-
expect(catalog.diagnostics?.[0]?.serverName).toBe("dofbot");
764+
expect(catalog.diagnostics?.[0]?.serverName).toBe("fuzzplugin");
765765
expect(catalog.diagnostics?.[0]?.message).toContain("Invalid input: expected");
766766
expect(catalog.diagnostics?.[0]?.message).toContain("object");
767767
} finally {

‎src/agents/agent-bundle-mcp-tools.materialize.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ describe("createBundleMcpToolRuntime", () => {
167167
it("preserves catalog diagnostics when MCP servers fail tool listing", async () => {
168168
const diagnostics = [
169169
{
170-
serverName: "dofbot",
171-
safeServerName: "dofbot",
172-
launchSummary: "node dofbot-mcp.mjs",
170+
serverName: "fuzzplugin",
171+
safeServerName: "fuzzplugin",
172+
launchSummary: "node fuzzplugin-mcp.mjs",
173173
message: 'tools[0].inputSchema.type expected "object"',
174174
},
175175
];

‎src/agents/embedded-agent-runner/compact.hooks.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ describe("compactEmbeddedAgentSessionDirect hooks", () => {
473473
execute: async () => ({ text: "ok" }),
474474
},
475475
{
476-
name: "dofbot_move_angles",
477-
label: "Dofbot Move Angles",
476+
name: "fuzzplugin_move_angles",
477+
label: "FuzzPlugin Move Angles",
478478
description: "Move robot joints.",
479479
parameters: { type: "array", items: { type: "number" } },
480480
execute: async () => ({ text: "bad" }),

‎src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ describe("runEmbeddedAttempt context engine sessionKey forwarding", () => {
294294
execute: async () => ({ text: "ok" }),
295295
},
296296
{
297-
name: "dofbot_move_angles",
298-
label: "Dofbot Move Angles",
297+
name: "fuzzplugin_move_angles",
298+
label: "FuzzPlugin Move Angles",
299299
description: "Move robot joints.",
300300
parameters: {
301301
type: "object",

‎src/agents/tool-schema-projection.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ describe("runtime tool input schema projection", () => {
2929
expect(
3030
inspectRuntimeToolInputSchemas([
3131
{
32-
name: "dofbot_move_angles",
32+
name: "fuzzplugin_move_angles",
3333
parameters: { type: "array", items: { type: "number" } },
3434
},
3535
] as never),
3636
).toEqual([
3737
{
38-
toolName: "dofbot_move_angles",
38+
toolName: "fuzzplugin_move_angles",
3939
toolIndex: 0,
40-
violations: ['dofbot_move_angles.parameters.type must be "object"'],
40+
violations: ['fuzzplugin_move_angles.parameters.type must be "object"'],
4141
},
4242
]);
4343
});
@@ -86,17 +86,17 @@ describe("runtime tool input schema projection", () => {
8686
parameters: { type: "object", properties: {} },
8787
};
8888
const broken = {
89-
name: "dofbot_move_angles",
89+
name: "fuzzplugin_move_angles",
9090
parameters: { type: "array", items: { type: "number" } },
9191
};
9292

9393
expect(filterRuntimeCompatibleTools([healthy, broken])).toEqual({
9494
tools: [healthy],
9595
diagnostics: [
9696
{
97-
toolName: "dofbot_move_angles",
97+
toolName: "fuzzplugin_move_angles",
9898
toolIndex: 1,
99-
violations: ['dofbot_move_angles.parameters.type must be "object"'],
99+
violations: ['fuzzplugin_move_angles.parameters.type must be "object"'],
100100
},
101101
],
102102
});

‎src/agents/tools-effective-inventory.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ describe("resolveEffectiveToolInventory", () => {
321321
tools: [
322322
mockTool({ name: "exec", label: "Exec", description: "Run shell commands" }),
323323
mockTool({
324-
name: "dofbot_move_angles",
325-
label: "Dofbot Move Angles",
324+
name: "fuzzplugin_move_angles",
325+
label: "FuzzPlugin Move Angles",
326326
description: "Move robot joints",
327327
parameters: {
328328
type: "object",
@@ -332,18 +332,18 @@ describe("resolveEffectiveToolInventory", () => {
332332
},
333333
}),
334334
],
335-
pluginMeta: { dofbot_move_angles: { pluginId: "dofbot" } },
335+
pluginMeta: { fuzzplugin_move_angles: { pluginId: "fuzzplugin" } },
336336
});
337337

338338
const result = resolveEffectiveToolInventoryLocal7({ cfg: {} });
339339

340340
expect(result.groups.flatMap((group) => group.tools.map((tool) => tool.id))).toEqual(["exec"]);
341341
expect(result.notices).toEqual([
342342
{
343-
id: "unsupported-tool-schema:dofbot_move_angles",
343+
id: "unsupported-tool-schema:fuzzplugin_move_angles",
344344
severity: "warning",
345345
message:
346-
'Tool "dofbot_move_angles" from plugin "dofbot" has an unsupported runtime input schema (dofbot_move_angles.parameters.properties.target.$dynamicRef) and was quarantined before model projection. Fix or disable the owner, or remove the tool from active allowlists.',
346+
'Tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has an unsupported runtime input schema (fuzzplugin_move_angles.parameters.properties.target.$dynamicRef) and was quarantined before model projection. Fix or disable the owner, or remove the tool from active allowlists.',
347347
},
348348
]);
349349
});

‎src/commands/doctor/repair-sequencing.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,16 @@ describe("doctor repair sequencing", () => {
434434

435435
it("emits active tool schema projection warnings during doctor repair", async () => {
436436
mocks.collectActiveToolSchemaProjectionWarnings.mockReturnValueOnce([
437-
'- agents.main: active tool "dofbot_move_angles" from plugin "dofbot" has unsupported runtime input schema.',
437+
'- agents.main: active tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema.',
438438
]);
439439

440440
const result = await runDoctorRepairSequence({
441441
state: {
442442
cfg: {
443-
tools: { allow: ["dofbot_move_angles"] },
443+
tools: { allow: ["fuzzplugin_move_angles"] },
444444
} as OpenClawConfig,
445445
candidate: {
446-
tools: { allow: ["dofbot_move_angles"] },
446+
tools: { allow: ["fuzzplugin_move_angles"] },
447447
} as OpenClawConfig,
448448
pendingChanges: false,
449449
fixHints: [],
@@ -453,11 +453,11 @@ describe("doctor repair sequencing", () => {
453453

454454
expect(result.changeNotes).toStrictEqual([]);
455455
expect(result.warningNotes).toContain(
456-
'- agents.main: active tool "dofbot_move_angles" from plugin "dofbot" has unsupported runtime input schema.',
456+
'- agents.main: active tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema.',
457457
);
458458
expect(mocks.collectActiveToolSchemaProjectionWarnings).toHaveBeenCalledWith({
459459
cfg: {
460-
tools: { allow: ["dofbot_move_angles"] },
460+
tools: { allow: ["fuzzplugin_move_angles"] },
461461
},
462462
env: process.env,
463463
});

‎src/commands/doctor/shared/active-tool-schema-warnings.test.ts‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,31 @@ describe("active tool schema doctor warnings", () => {
8585
it("warns with plugin ownership for active tools blocked by runtime projection", () => {
8686
toolState.tools = [
8787
tool("message", { type: "object", properties: {} }),
88-
tool("dofbot_move_angles", { type: "array", items: { type: "number" } }),
88+
tool("fuzzplugin_move_angles", { type: "array", items: { type: "number" } }),
8989
];
90-
toolState.pluginIds = { dofbot_move_angles: "dofbot" };
90+
toolState.pluginIds = { fuzzplugin_move_angles: "fuzzplugin" };
9191

9292
expect(
9393
collectActiveToolSchemaProjectionWarnings({
9494
cfg: {
9595
plugins: {
9696
entries: {
97-
dofbot: { enabled: true },
97+
fuzzplugin: { enabled: true },
9898
},
9999
},
100100
},
101101
env: { HOME: "/tmp/openclaw-test" },
102102
}),
103103
).toEqual([
104-
'- agents.main: active tool "dofbot_move_angles" from plugin "dofbot" has unsupported runtime input schema (dofbot_move_angles.parameters.type must be "object"). OpenClaw will quarantine this tool at runtime; fix or disable the plugin, or remove the tool from active allowlists.',
104+
'- agents.main: active tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema (fuzzplugin_move_angles.parameters.type must be "object"). OpenClaw will quarantine this tool at runtime; fix or disable the plugin, or remove the tool from active allowlists.',
105105
]);
106106
});
107107

108108
it("does not validate disabled plugin mode", () => {
109-
toolState.tools = [tool("dofbot_move_angles", { type: "array", items: { type: "number" } })];
110-
toolState.pluginIds = { dofbot_move_angles: "dofbot" };
109+
toolState.tools = [
110+
tool("fuzzplugin_move_angles", { type: "array", items: { type: "number" } }),
111+
];
112+
toolState.pluginIds = { fuzzplugin_move_angles: "fuzzplugin" };
111113

112114
expect(
113115
collectActiveToolSchemaProjectionWarnings({
@@ -121,7 +123,7 @@ describe("active tool schema doctor warnings", () => {
121123

122124
it("validates provider-normalized runtime schemas before reporting doctor health", () => {
123125
const healthyTool = tool("message", { type: "object", properties: {} });
124-
const dynamicTool = tool("dofbot_move_angles", { type: "object", properties: {} });
126+
const dynamicTool = tool("fuzzplugin_move_angles", { type: "object", properties: {} });
125127
toolState.runtimeModel = {
126128
id: "gpt-5.5",
127129
name: "GPT-5.5",
@@ -131,7 +133,7 @@ describe("active tool schema doctor warnings", () => {
131133
compat: { unsupportedToolSchemaKeywords: ["$dynamicRef"] },
132134
};
133135
toolState.tools = [healthyTool, dynamicTool];
134-
toolState.pluginIds = { dofbot_move_angles: "dofbot" };
136+
toolState.pluginIds = { fuzzplugin_move_angles: "fuzzplugin" };
135137
toolState.normalizeTools.mockImplementation(({ tools, modelApi, model }) => {
136138
if (
137139
modelApi !== "openai-responses" ||
@@ -141,8 +143,8 @@ describe("active tool schema doctor warnings", () => {
141143
return tools;
142144
}
143145
return tools.map((entry) =>
144-
entry.name === "dofbot_move_angles"
145-
? tool("dofbot_move_angles", {
146+
entry.name === "fuzzplugin_move_angles"
147+
? tool("fuzzplugin_move_angles", {
146148
type: "object",
147149
properties: {
148150
target: { $dynamicRef: "#target" },
@@ -162,14 +164,14 @@ describe("active tool schema doctor warnings", () => {
162164
},
163165
plugins: {
164166
entries: {
165-
dofbot: { enabled: true },
167+
fuzzplugin: { enabled: true },
166168
},
167169
},
168170
},
169171
env: { HOME: "/tmp/openclaw-test" },
170172
}),
171173
).toEqual([
172-
'- agents.main: active tool "dofbot_move_angles" from plugin "dofbot" has unsupported runtime input schema (dofbot_move_angles.parameters.properties.target.$dynamicRef). OpenClaw will quarantine this tool at runtime; fix or disable the plugin, or remove the tool from active allowlists.',
174+
'- agents.main: active tool "fuzzplugin_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema (fuzzplugin_move_angles.parameters.properties.target.$dynamicRef). OpenClaw will quarantine this tool at runtime; fix or disable the plugin, or remove the tool from active allowlists.',
173175
]);
174176
expect(toolState.createTools).toHaveBeenCalledWith(
175177
expect.objectContaining({
@@ -223,7 +225,7 @@ describe("active tool schema doctor warnings", () => {
223225

224226
expect(
225227
collectActiveToolSchemaProjectionWarnings({
226-
cfg: { plugins: { entries: { dofbot: { enabled: true } } } },
228+
cfg: { plugins: { entries: { fuzzplugin: { enabled: true } } } },
227229
env: { HOME: "/tmp/openclaw-test" },
228230
}),
229231
).toEqual([

0 commit comments

Comments
 (0)