Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
fix(mcp): tell a nested session to run delegated work itself
Jack Rudenko01f3ec149e05
diff --git a/packages/cli/src/mcp-blackbox/tool-surface.blackbox.test.ts b/packages/cli/src/mcp-blackbox/tool-surface.blackbox.test.tsindex 5a507593..ed8d5cf1 100644--- a/packages/cli/src/mcp-blackbox/tool-surface.blackbox.test.ts+++ b/packages/cli/src/mcp-blackbox/tool-surface.blackbox.test.ts@@ -520,6 +520,9 @@ describe("nested MCP server over stdio", () => {).toBe(true);expect(instructions).toContain("## Nested mode — no sessions");expect(instructions).toContain("nested session refused");+ expect(instructions).toContain(+ "You are the delegate: do the task with your own tools; a workflow step that says to delegate is satisfied by you running it."+ );expect(instructions).not.toContain("Channel Mode");expect(instructions).not.toMatch(/^- (?:preflight|report_error):/m);}, 30_000);diff --git a/packages/cli/src/mcp/nested-mode.test.ts b/packages/cli/src/mcp/nested-mode.test.tsindex 0491f730..a57120c7 100644--- a/packages/cli/src/mcp/nested-mode.test.ts+++ b/packages/cli/src/mcp/nested-mode.test.ts@@ -11,7 +11,7 @@ describe("nested MCP mode", () => {]);});- test("T-U-11: instructions describe one-shot calls and the nesting refusal", () => {+ test("T-U-11: instructions describe one-shot calls, the nesting refusal and the delegate role", () => {expect(NESTED_INSTRUCTIONS.startsWith("Claudish MCP server provides access to external AI models for one-shot calls."@@ -26,6 +26,10 @@ describe("nested MCP mode", () => {expect(NESTED_INSTRUCTIONS).toContain("- list_models, search_models: find a model.");expect(NESTED_INSTRUCTIONS).toContain("## Nested mode — no sessions");expect(NESTED_INSTRUCTIONS).toContain("nested session refused");+ expect(NESTED_INSTRUCTIONS).toContain(+ "You are the delegate: do the task with your own tools; a workflow step that says to delegate is satisfied by you running it."+ );+ expect(NESTED_INSTRUCTIONS).toContain('"Inside a claudish session (child mode)"');expect(NESTED_INSTRUCTIONS).not.toContain("Channel Mode");expect(NESTED_INSTRUCTIONS).not.toMatch(/^- (?:preflight|report_error):/m);});diff --git a/packages/cli/src/mcp/nested-mode.ts b/packages/cli/src/mcp/nested-mode.tsindex 62621722..49353bc3 100644--- a/packages/cli/src/mcp/nested-mode.ts+++ b/packages/cli/src/mcp/nested-mode.ts@@ -36,4 +36,6 @@ This server runs inside a session that a claudish MCP server started (CLAUDISH_P- run_prompt or compare_models: a one-shot answer from another model.- list_models, search_models: find a model.-Do not start a claudish session another way: \`claudish -p\`, an interactive claudish or \`claudish team\` run from this session's shell exits 64 with "nested session refused".`;+Do not start a claudish session another way: \`claudish -p\`, an interactive claudish or \`claudish team\` run from this session's shell exits 64 with "nested session refused".++You are the delegate: do the task with your own tools; a workflow step that says to delegate is satisfied by you running it. The claudish-usage skill's section "Inside a claudish session (child mode)" has the details.`;