mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test(agents/bundle-mcp): assert live splitSdkTools customTools boundary in Docker e2e harness
Extend the existing Pi bundle-MCP Docker e2e harness so the live stdio MCP probe also exercises `splitSdkTools` and asserts the configured server tool reaches `customTools` for coding/messaging and is filtered out for minimal and `tools.deny: ["bundle-mcp"]`. The harness already had real materialize plus profile-filter coverage against a real stdio MCP child, but did not assert the splitSdkTools().customTools boundary, which is the value the SDK serializes to the outbound provider request body and the disputed boundary on #76063. Refs #76063.
This commit is contained in:
committed by
Peter Steinberger
parent
6b8abb3c79
commit
217940dfdc
@@ -12,6 +12,7 @@ import {
|
||||
getOrCreateSessionMcpRuntime,
|
||||
} from "../../dist/agents/pi-bundle-mcp-runtime.js";
|
||||
import { applyFinalEffectiveToolPolicy } from "../../dist/agents/pi-embedded-runner/effective-tool-policy.js";
|
||||
import { splitSdkTools } from "../../dist/agents/pi-embedded-runner/tool-split.js";
|
||||
import type { OpenClawConfig } from "../../dist/config/types.openclaw.js";
|
||||
import { getPluginToolMeta } from "../../dist/plugins/tools.js";
|
||||
|
||||
@@ -136,6 +137,37 @@ async function main() {
|
||||
});
|
||||
assert(denied.tools.length === 0, "expected tools.deny bundle-mcp to filter MCP tools");
|
||||
|
||||
// The disputed boundary on #76063 is what reaches the SDK as `customTools`,
|
||||
// since that is the exact value serialized to the outbound provider request.
|
||||
// Prove the live stdio probe survives the materialize -> filter -> split chain
|
||||
// through `splitSdkTools` for the same four profiles already asserted above.
|
||||
const codingCustom = splitSdkTools({ tools: coding.tools, sandboxEnabled: false }).customTools;
|
||||
const messagingCustom = splitSdkTools({
|
||||
tools: messaging.tools,
|
||||
sandboxEnabled: false,
|
||||
}).customTools;
|
||||
const minimalCustom = splitSdkTools({
|
||||
tools: minimal.tools,
|
||||
sandboxEnabled: false,
|
||||
}).customTools;
|
||||
const deniedCustom = splitSdkTools({ tools: denied.tools, sandboxEnabled: false }).customTools;
|
||||
assert(
|
||||
codingCustom.some((tool) => tool.name === probeTool.name),
|
||||
"expected coding profile customTools to include bundle MCP tools",
|
||||
);
|
||||
assert(
|
||||
messagingCustom.some((tool) => tool.name === probeTool.name),
|
||||
"expected messaging profile customTools to include bundle MCP tools",
|
||||
);
|
||||
assert(
|
||||
minimalCustom.length === 0,
|
||||
"expected minimal profile customTools to exclude bundle MCP tools",
|
||||
);
|
||||
assert(
|
||||
deniedCustom.length === 0,
|
||||
"expected tools.deny bundle-mcp customTools to exclude bundle MCP tools",
|
||||
);
|
||||
|
||||
process.stdout.write(
|
||||
JSON.stringify(
|
||||
{
|
||||
@@ -147,6 +179,18 @@ async function main() {
|
||||
minimal: minimal.tools.length,
|
||||
denied: denied.tools.length,
|
||||
},
|
||||
customToolsCounts: {
|
||||
coding: codingCustom.length,
|
||||
messaging: messagingCustom.length,
|
||||
minimal: minimalCustom.length,
|
||||
denied: deniedCustom.length,
|
||||
},
|
||||
customToolNames: {
|
||||
coding: codingCustom.map((tool) => tool.name),
|
||||
messaging: messagingCustom.map((tool) => tool.name),
|
||||
minimal: minimalCustom.map((tool) => tool.name),
|
||||
denied: deniedCustom.map((tool) => tool.name),
|
||||
},
|
||||
},
|
||||
null,
|
||||
2,
|
||||
|
||||
Reference in New Issue
Block a user