From 61c8cd998b243f2bf94a0021e539150f44f4b3da Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Wed, 30 Jul 2025 17:13:03 -0700 Subject: [PATCH] fix: export allowed tools environment variables in review mode The GitHub MCP tools were not being properly allowed because review mode wasn't exporting the ALLOWED_TOOLS environment variable like agent mode does. This caused all GitHub MCP tool calls to be blocked with permission errors. --- src/modes/review/index.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/modes/review/index.ts b/src/modes/review/index.ts index 3260e1b..c997b8d 100644 --- a/src/modes/review/index.ts +++ b/src/modes/review/index.ts @@ -233,6 +233,32 @@ Then proceed with the review workflow described above.`; await createPrompt(reviewMode, modeContext, githubData, context); + // Export tool environment variables for review mode + const baseTools = [ + "Edit", + "MultiEdit", + "Glob", + "Grep", + "LS", + "Read", + "Write", + ]; + + // Add mode-specific and user-specified tools + const allowedTools = [ + ...baseTools, + ...this.getAllowedTools(), + ...context.inputs.allowedTools, + ]; + const disallowedTools = [ + "WebSearch", + "WebFetch", + ...context.inputs.disallowedTools, + ]; + + core.exportVariable("ALLOWED_TOOLS", allowedTools.join(",")); + core.exportVariable("DISALLOWED_TOOLS", disallowedTools.join(",")); + const additionalMcpConfig = process.env.MCP_CONFIG || ""; const mcpConfig = await prepareMcpConfig({ githubToken,