





























@@ -1,6 +1,7 @@
11import { describe, expect, it } from "vitest";
22import {
33applyEmbeddedAttemptToolsAllow,
4+mergeForcedEmbeddedAttemptToolsAllow,
45resolveEmbeddedAttemptToolConstructionPlan,
56shouldBuildCoreCodingToolsForAllowlist,
67shouldCreateBundleLspRuntimeForAttempt,
@@ -45,6 +46,19 @@ describe("applyEmbeddedAttemptToolsAllow", () => {
4546).toEqual(["exec", "read"]);
4647});
474849+it("keeps forced message tool through explicit runtime allowlists", () => {
50+const tools = [{ name: "music_generate" }, { name: "message" }];
51+const toolsAllow = mergeForcedEmbeddedAttemptToolsAllow(["music_generate"], {
52+forceMessageTool: true,
53+});
54+55+expect(toolsAllow).toEqual(["music_generate", "message"]);
56+expect(applyEmbeddedAttemptToolsAllow(tools, toolsAllow).map((tool) => tool.name)).toEqual([
57+"music_generate",
58+"message",
59+]);
60+});
61+4862it("normalizes explicit toolsAllow entries before filtering", () => {
4963const tools = [{ name: "cron" }, { name: "read" }, { name: "message" }];
5064@@ -159,6 +173,27 @@ describe("resolveEmbeddedAttemptToolConstructionPlan", () => {
159173);
160174});
161175176+it("materializes OpenClaw tools when a plugin-only allowlist forces message", () => {
177+expectConstructionPlan(
178+resolveEmbeddedAttemptToolConstructionPlan({
179+toolsAllow: ["memory_search"],
180+forceMessageTool: true,
181+}),
182+{
183+constructTools: true,
184+includeCoreTools: true,
185+runtimeToolAllowlist: ["memory_search", "message"],
186+coding: {
187+includeBaseCodingTools: false,
188+includeShellTools: false,
189+includeChannelTools: true,
190+includeOpenClawTools: true,
191+includePluginTools: true,
192+},
193+},
194+);
195+});
196+162197it("limits known core allowlists to the matching local families", () => {
163198expectConstructionPlan(resolveEmbeddedAttemptToolConstructionPlan({ toolsAllow: ["read"] }), {
164199constructTools: true,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。