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.
This commit is contained in:
km-anthropic
2025-07-30 17:13:03 -07:00
parent 463c7151e3
commit 61c8cd998b

View File

@@ -233,6 +233,32 @@ Then proceed with the review workflow described above.`;
await createPrompt(reviewMode, modeContext, githubData, context); 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 additionalMcpConfig = process.env.MCP_CONFIG || "";
const mcpConfig = await prepareMcpConfig({ const mcpConfig = await prepareMcpConfig({
githubToken, githubToken,