Skip to content

Commit 7657b14

Browse files
committed
test(agents): use synthetic tool schema fixtures
1 parent 8d3fe21 commit 7657b14

14 files changed

Lines changed: 118 additions & 120 deletions

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

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
2-
import {
3-
onInternalDiagnosticEvent,
4-
waitForDiagnosticEventsDrained,
5-
type DiagnosticEventPayload,
6-
} from "openclaw/plugin-sdk/diagnostic-runtime";
72
import type { AnyAgentTool } from "openclaw/plugin-sdk/agent-harness";
83
import {
94
HEARTBEAT_RESPONSE_TOOL_NAME,
105
embeddedAgentLog,
116
wrapToolWithBeforeToolCallHook,
127
} from "openclaw/plugin-sdk/agent-harness-runtime";
8+
import {
9+
onInternalDiagnosticEvent,
10+
waitForDiagnosticEventsDrained,
11+
type DiagnosticEventPayload,
12+
} from "openclaw/plugin-sdk/diagnostic-runtime";
1313
import {
1414
initializeGlobalHookRunner,
1515
resetGlobalHookRunner,
@@ -309,7 +309,7 @@ describe("createCodexDynamicToolBridge", () => {
309309
tools: [
310310
createTool({ name: "message" }),
311311
createTool({
312-
name: "dofbot_move_angles",
312+
name: "fuzz_move_angles",
313313
parameters: { type: "array", items: { type: "number" } },
314314
execute: badExecute,
315315
}),
@@ -330,25 +330,23 @@ describe("createCodexDynamicToolBridge", () => {
330330
expect(bridge.specs.map((tool) => tool.name)).toEqual(["message"]);
331331
expect(bridge.telemetry.quarantinedTools).toEqual([
332332
{
333-
tool: "dofbot_move_angles",
334-
violations: ['dofbot_move_angles.inputSchema.type must be "object"'],
333+
tool: "fuzz_move_angles",
334+
violations: ['fuzz_move_angles.inputSchema.type must be "object"'],
335335
},
336336
]);
337337
expect(warn).toHaveBeenCalledWith(
338-
expect.stringContaining("dofbot_move_angles"),
338+
expect.stringContaining("fuzz_move_angles"),
339339
expect.objectContaining({
340340
tools: [
341341
{
342-
tool: "dofbot_move_angles",
343-
violations: ['dofbot_move_angles.inputSchema.type must be "object"'],
342+
tool: "fuzz_move_angles",
343+
violations: ['fuzz_move_angles.inputSchema.type must be "object"'],
344344
},
345345
],
346346
}),
347347
);
348348
const blockedEvents = diagnosticEvents.filter(
349-
(
350-
event,
351-
): event is Extract<DiagnosticEventPayload, { type: "tool.execution.blocked" }> =>
349+
(event): event is Extract<DiagnosticEventPayload, { type: "tool.execution.blocked" }> =>
352350
event.type === "tool.execution.blocked",
353351
);
354352
expect(blockedEvents).toContainEqual(
@@ -357,9 +355,9 @@ describe("createCodexDynamicToolBridge", () => {
357355
runId: "run-1",
358356
sessionId: "session-1",
359357
sessionKey: "agent:main:session-1",
360-
toolName: "dofbot_move_angles",
358+
toolName: "fuzz_move_angles",
361359
deniedReason: "unsupported_tool_schema",
362-
reason: 'dofbot_move_angles.inputSchema.type must be "object"',
360+
reason: 'fuzz_move_angles.inputSchema.type must be "object"',
363361
}),
364362
);
365363

@@ -368,13 +366,13 @@ describe("createCodexDynamicToolBridge", () => {
368366
turnId: "turn-1",
369367
callId: "call-1",
370368
namespace: null,
371-
tool: "dofbot_move_angles",
369+
tool: "fuzz_move_angles",
372370
arguments: {},
373371
});
374372

375373
expect(result).toEqual({
376374
success: false,
377-
contentItems: [{ type: "inputText", text: "Unknown OpenClaw tool: dofbot_move_angles" }],
375+
contentItems: [{ type: "inputText", text: "Unknown OpenClaw tool: fuzz_move_angles" }],
378376
});
379377
expect(badExecute).not.toHaveBeenCalled();
380378
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ describe("ToolsEffectiveResultSchema", () => {
3131
...toolsEffectiveResult(),
3232
notices: [
3333
{
34-
id: "unsupported-tool-schema:dofbot_move_angles",
34+
id: "unsupported-tool-schema:fuzz_move_angles",
3535
severity: "warning",
3636
message:
37-
'Tool "dofbot_move_angles" from plugin "dofbot" has an unsupported runtime input schema and was quarantined before model projection.',
37+
'Tool "fuzz_move_angles" from plugin "fuzzplugin" has an unsupported runtime input schema and was quarantined before model projection.',
3838
},
3939
],
4040
};
@@ -47,7 +47,7 @@ describe("ToolsEffectiveResultSchema", () => {
4747
...toolsEffectiveResult(),
4848
notices: [
4949
{
50-
id: "unsupported-tool-schema:dofbot_move_angles",
50+
id: "unsupported-tool-schema:fuzz_move_angles",
5151
severity: "warning",
5252
message: "Unsupported schema.",
5353
extra: true,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ describe("session MCP runtime", () => {
675675
cfg: {
676676
mcp: {
677677
servers: {
678-
dofbot: {
678+
fuzzplugin: {
679679
command: process.execPath,
680680
args: [serverPath],
681681
},
@@ -689,7 +689,7 @@ describe("session MCP runtime", () => {
689689

690690
expect(catalog.servers).toEqual({});
691691
expect(catalog.tools).toEqual([]);
692-
expect(catalog.diagnostics?.[0]?.serverName).toBe("dofbot");
692+
expect(catalog.diagnostics?.[0]?.serverName).toBe("fuzzplugin");
693693
expect(catalog.diagnostics?.[0]?.message).toContain("Invalid input: expected");
694694
expect(catalog.diagnostics?.[0]?.message).toContain("object");
695695
} finally {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ describe("createBundleMcpToolRuntime", () => {
144144
it("preserves catalog diagnostics when MCP servers fail tool listing", async () => {
145145
const diagnostics = [
146146
{
147-
serverName: "dofbot",
148-
safeServerName: "dofbot",
149-
launchSummary: "node dofbot-mcp.mjs",
147+
serverName: "fuzzplugin",
148+
safeServerName: "fuzzplugin",
149+
launchSummary: "node fuzzplugin-mcp.mjs",
150150
message: 'tools[0].inputSchema.type expected "object"',
151151
},
152152
];

‎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: "fuzz_move_angles",
477+
label: "Fuzz 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
@@ -274,8 +274,8 @@ describe("runEmbeddedAttempt context engine sessionKey forwarding", () => {
274274
execute: async () => ({ text: "ok" }),
275275
},
276276
{
277-
name: "dofbot_move_angles",
278-
label: "Dofbot Move Angles",
277+
name: "fuzz_move_angles",
278+
label: "Fuzz Move Angles",
279279
description: "Move robot joints.",
280280
parameters: {
281281
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: "fuzz_move_angles",
3333
parameters: { type: "array", items: { type: "number" } },
3434
},
3535
] as never),
3636
).toEqual([
3737
{
38-
toolName: "dofbot_move_angles",
38+
toolName: "fuzz_move_angles",
3939
toolIndex: 0,
40-
violations: ['dofbot_move_angles.parameters.type must be "object"'],
40+
violations: ['fuzz_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: "fuzz_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: "fuzz_move_angles",
9898
toolIndex: 1,
99-
violations: ['dofbot_move_angles.parameters.type must be "object"'],
99+
violations: ['fuzz_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
@@ -316,8 +316,8 @@ describe("resolveEffectiveToolInventory", () => {
316316
tools: [
317317
mockTool({ name: "exec", label: "Exec", description: "Run shell commands" }),
318318
mockTool({
319-
name: "dofbot_move_angles",
320-
label: "Dofbot Move Angles",
319+
name: "fuzz_move_angles",
320+
label: "Fuzz Move Angles",
321321
description: "Move robot joints",
322322
parameters: {
323323
type: "object",
@@ -327,18 +327,18 @@ describe("resolveEffectiveToolInventory", () => {
327327
},
328328
}),
329329
],
330-
pluginMeta: { dofbot_move_angles: { pluginId: "dofbot" } },
330+
pluginMeta: { fuzz_move_angles: { pluginId: "fuzzplugin" } },
331331
});
332332

333333
const result = resolveEffectiveToolInventory({ cfg: {} });
334334

335335
expect(result.groups.flatMap((group) => group.tools.map((tool) => tool.id))).toEqual(["exec"]);
336336
expect(result.notices).toEqual([
337337
{
338-
id: "unsupported-tool-schema:dofbot_move_angles",
338+
id: "unsupported-tool-schema:fuzz_move_angles",
339339
severity: "warning",
340340
message:
341-
'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.',
341+
'Tool "fuzz_move_angles" from plugin "fuzzplugin" has an unsupported runtime input schema (fuzz_move_angles.parameters.properties.target.$dynamicRef) and was quarantined before model projection. Fix or disable the owner, or remove the tool from active allowlists.',
342342
},
343343
]);
344344
});

‎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 "fuzz_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: ["fuzz_move_angles"] },
444444
} as OpenClawConfig,
445445
candidate: {
446-
tools: { allow: ["dofbot_move_angles"] },
446+
tools: { allow: ["fuzz_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 "fuzz_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: ["fuzz_move_angles"] },
461461
},
462462
env: process.env,
463463
});

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,29 @@ 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("fuzz_move_angles", { type: "array", items: { type: "number" } }),
8989
];
90-
toolState.pluginIds = { dofbot_move_angles: "dofbot" };
90+
toolState.pluginIds = { fuzz_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 "fuzz_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema (fuzz_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 = [tool("fuzz_move_angles", { type: "array", items: { type: "number" } })];
110+
toolState.pluginIds = { fuzz_move_angles: "fuzzplugin" };
111111

112112
expect(
113113
collectActiveToolSchemaProjectionWarnings({
@@ -121,7 +121,7 @@ describe("active tool schema doctor warnings", () => {
121121

122122
it("validates provider-normalized runtime schemas before reporting doctor health", () => {
123123
const healthyTool = tool("message", { type: "object", properties: {} });
124-
const dynamicTool = tool("dofbot_move_angles", { type: "object", properties: {} });
124+
const dynamicTool = tool("fuzz_move_angles", { type: "object", properties: {} });
125125
toolState.runtimeModel = {
126126
id: "gpt-5.5",
127127
name: "GPT-5.5",
@@ -131,7 +131,7 @@ describe("active tool schema doctor warnings", () => {
131131
compat: { unsupportedToolSchemaKeywords: ["$dynamicRef"] },
132132
};
133133
toolState.tools = [healthyTool, dynamicTool];
134-
toolState.pluginIds = { dofbot_move_angles: "dofbot" };
134+
toolState.pluginIds = { fuzz_move_angles: "fuzzplugin" };
135135
toolState.normalizeTools.mockImplementation(({ tools, modelApi, model }) => {
136136
if (
137137
modelApi !== "openai-responses" ||
@@ -141,8 +141,8 @@ describe("active tool schema doctor warnings", () => {
141141
return tools;
142142
}
143143
return tools.map((entry) =>
144-
entry.name === "dofbot_move_angles"
145-
? tool("dofbot_move_angles", {
144+
entry.name === "fuzz_move_angles"
145+
? tool("fuzz_move_angles", {
146146
type: "object",
147147
properties: {
148148
target: { $dynamicRef: "#target" },
@@ -162,14 +162,14 @@ describe("active tool schema doctor warnings", () => {
162162
},
163163
plugins: {
164164
entries: {
165-
dofbot: { enabled: true },
165+
fuzzplugin: { enabled: true },
166166
},
167167
},
168168
},
169169
env: { HOME: "/tmp/openclaw-test" },
170170
}),
171171
).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.',
172+
'- agents.main: active tool "fuzz_move_angles" from plugin "fuzzplugin" has unsupported runtime input schema (fuzz_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.',
173173
]);
174174
expect(toolState.createTools).toHaveBeenCalledWith(
175175
expect.objectContaining({
@@ -223,7 +223,7 @@ describe("active tool schema doctor warnings", () => {
223223

224224
expect(
225225
collectActiveToolSchemaProjectionWarnings({
226-
cfg: { plugins: { entries: { dofbot: { enabled: true } } } },
226+
cfg: { plugins: { entries: { fuzzplugin: { enabled: true } } } },
227227
env: { HOME: "/tmp/openclaw-test" },
228228
}),
229229
).toEqual([

0 commit comments

Comments
 (0)