

























@@ -20,6 +20,7 @@ import {
2020resolveAttemptFsWorkspaceOnly,
2121resolveEmbeddedAgentStreamFn,
2222resolveUnknownToolGuardThreshold,
23+shouldCreateBundleMcpRuntimeForAttempt,
2324resolvePromptBuildHookResult,
2425resolvePromptModeForSession,
2526shouldStripBootstrapFromEmbeddedContext,
@@ -72,6 +73,34 @@ describe("applyEmbeddedAttemptToolsAllow", () => {
7273});
7374});
747576+describe("shouldCreateBundleMcpRuntimeForAttempt", () => {
77+it("skips bundle MCP when tools are disabled or unavailable", () => {
78+expect(shouldCreateBundleMcpRuntimeForAttempt({ toolsEnabled: false })).toBe(false);
79+expect(shouldCreateBundleMcpRuntimeForAttempt({ toolsEnabled: true, disableTools: true })).toBe(
80+false,
81+);
82+});
83+84+it("creates bundle MCP only when the allowlist can reach bundle MCP tool names", () => {
85+expect(shouldCreateBundleMcpRuntimeForAttempt({ toolsEnabled: true })).toBe(true);
86+expect(shouldCreateBundleMcpRuntimeForAttempt({ toolsEnabled: true, toolsAllow: [] })).toBe(
87+true,
88+);
89+expect(
90+shouldCreateBundleMcpRuntimeForAttempt({
91+toolsEnabled: true,
92+toolsAllow: ["memory_search", "memory_get"],
93+}),
94+).toBe(false);
95+expect(
96+shouldCreateBundleMcpRuntimeForAttempt({
97+toolsEnabled: true,
98+toolsAllow: ["strict__strict_probe"],
99+}),
100+).toBe(true);
101+});
102+});
103+75104describe("resolvePromptBuildHookResult", () => {
76105function createLegacyOnlyHookRunner() {
77106return {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。