























@@ -11,6 +11,10 @@ function expectUpdatePlanEnabled(params: UpdatePlanGatingParams, expected: boole
1111expect(isUpdatePlanToolEnabledForOpenClawTools(params)).toBe(expected);
1212}
131314+function toolNames(tools: ReturnType<typeof createOpenClawTools>): string[] {
15+return tools.map((tool) => tool.name);
16+}
17+1418function openAiGpt5Params(
1519config: OpenClawConfig,
1620overrides: Partial<UpdatePlanGatingParams> = {},
@@ -48,8 +52,8 @@ describe("openclaw-tools update_plan gating", () => {
4852modelId: "claude-sonnet-4-6",
4953});
505451-expect(defaultTools.some((tool) => tool.name === "update_plan")).toBe(false);
52-expect(emptyAllowlistTools.some((tool) => tool.name === "update_plan")).toBe(false);
55+expect(toolNames(defaultTools)).not.toContain("update_plan");
56+expect(toolNames(emptyAllowlistTools)).not.toContain("update_plan");
5357});
54585559it("wraps constructed tools with before-tool-call hooks by default", () => {
@@ -95,7 +99,7 @@ describe("openclaw-tools update_plan gating", () => {
9599modelId: "claude-sonnet-4-6",
96100});
9710198-expect(tools.some((tool) => tool.name === "update_plan")).toBe(true);
102+expect(toolNames(tools)).toContain("update_plan");
99103});
100104101105it("registers update_plan when a config allowlist group includes it", () => {
@@ -106,7 +110,7 @@ describe("openclaw-tools update_plan gating", () => {
106110modelId: "claude-sonnet-4-6",
107111});
108112109-expect(tools.some((tool) => tool.name === "update_plan")).toBe(true);
113+expect(toolNames(tools)).toContain("update_plan");
110114});
111115112116it("registers update_plan when a runtime allowlist group includes it", () => {
@@ -118,7 +122,7 @@ describe("openclaw-tools update_plan gating", () => {
118122modelId: "claude-sonnet-4-6",
119123});
120124121-expect(tools.some((tool) => tool.name === "update_plan")).toBe(true);
125+expect(toolNames(tools)).toContain("update_plan");
122126});
123127124128it("respects deny policy while constructing update_plan for grouped allowlists", () => {
@@ -131,7 +135,7 @@ describe("openclaw-tools update_plan gating", () => {
131135modelId: "claude-sonnet-4-6",
132136});
133137134-expect(tools.some((tool) => tool.name === "update_plan")).toBe(false);
138+expect(toolNames(tools)).not.toContain("update_plan");
135139});
136140137141it("auto-enables update_plan for unconfigured GPT-5 openai runs", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。