





























@@ -1313,6 +1313,67 @@ describe("resolvePluginTools optional tools", () => {
1313131313141314expect(loadOpenClawPluginsMock).not.toHaveBeenCalled();
13151315});
1316+1317+it("includes non-optional browser tool when toolAllowlist is empty (full profile)", () => {
1318+const browserEntry: MockRegistryToolEntry = {
1319+pluginId: "browser",
1320+optional: false,
1321+source: "/tmp/browser.js",
1322+names: ["browser"],
1323+declaredNames: ["browser"],
1324+factory: () => makeTool("browser"),
1325+};
1326+setRegistry([browserEntry]);
1327+1328+// Empty toolAllowlist simulates tools.profile: "full" where no explicit
1329+// allow list exists. Non-optional plugin tools must still be resolved.
1330+const tools = resolvePluginTools(createResolveToolsParams({ toolAllowlist: [] }));
1331+1332+expectResolvedToolNames(tools, ["browser"]);
1333+});
1334+1335+it("includes non-optional browser tool when toolAllowlist is undefined (full profile)", () => {
1336+const browserEntry: MockRegistryToolEntry = {
1337+pluginId: "browser",
1338+optional: false,
1339+source: "/tmp/browser.js",
1340+names: ["browser"],
1341+declaredNames: ["browser"],
1342+factory: () => makeTool("browser"),
1343+};
1344+setRegistry([browserEntry]);
1345+1346+// Undefined toolAllowlist is the other variant of "no explicit allowlist".
1347+const tools = resolvePluginTools(createResolveToolsParams());
1348+1349+expectResolvedToolNames(tools, ["browser"]);
1350+});
1351+1352+it("includes non-optional browser tool when toolAllowlist has wildcard (#76507)", () => {
1353+const browserEntry: MockRegistryToolEntry = {
1354+pluginId: "browser",
1355+optional: false,
1356+source: "/tmp/browser.js",
1357+names: ["browser"],
1358+declaredNames: ["browser"],
1359+factory: () => makeTool("browser"),
1360+};
1361+setRegistry([browserEntry]);
1362+1363+// Wildcard allowlist from tools.profile: "full" explicitly grants all tools.
1364+const tools = resolvePluginTools(createResolveToolsParams({ toolAllowlist: ["*"] }));
1365+1366+expectResolvedToolNames(tools, ["browser"]);
1367+});
1368+1369+it("includes optional tools when wildcard allowlist is active (#76507)", () => {
1370+setOptionalDemoRegistry();
1371+1372+// Wildcard must grant optional tools too.
1373+const tools = resolvePluginTools(createResolveToolsParams({ toolAllowlist: ["*"] }));
1374+1375+expectResolvedToolNames(tools, ["optional_tool"]);
1376+});
13161377});
1317137813181379describe("buildPluginToolMetadataKey", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。