diff options
| -rw-r--r-- | src/main/claude/index.ts | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/claude/index.ts b/src/main/claude/index.ts index ebbf8a9..ca54164 100644 --- a/src/main/claude/index.ts +++ b/src/main/claude/index.ts | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import { query, type SDKMessage, type Query, type PermissionResult } from "@anthropic-ai/claude-agent-sdk"; | 1 | import { query, type SDKMessage, type Query } from "@anthropic-ai/claude-agent-sdk"; |
| 2 | import type { Session } from "../db/sessions"; | 2 | import type { Session } from "../db/sessions"; |
| 3 | import { getPhaseConfig, getNextPhase, getArtifactFilename } from "./phases"; | 3 | import { getPhaseConfig, getNextPhase, getArtifactFilename } from "./phases"; |
| 4 | import type { Phase, UserPermissionMode } from "./phases"; | 4 | import type { Phase, UserPermissionMode } from "./phases"; |
| @@ -79,20 +79,10 @@ export async function sendMessage({ | |||
| 79 | ...(session.phase === "implement" && { | 79 | ...(session.phase === "implement" && { |
| 80 | allowedTools: ["Bash(git status*)", "Bash(git log*)", "Bash(git diff*)"], | 80 | allowedTools: ["Bash(git status*)", "Bash(git log*)", "Bash(git diff*)"], |
| 81 | }), | 81 | }), |
| 82 | // Auto-allow MCP tools in research phase (where external data is most useful) | 82 | // When MCPs are configured in research phase, bypass permissions to allow MCP tools |
| 83 | ...(session.phase === "research" && mcpServers && { | 83 | ...(session.phase === "research" && mcpServers && { |
| 84 | canUseTool: async ( | 84 | permissionMode: "bypassPermissions" as const, |
| 85 | toolName: string, | 85 | allowDangerouslySkipPermissions: true, |
| 86 | _input: Record<string, unknown>, | ||
| 87 | _options: { signal: AbortSignal; toolUseID: string } | ||
| 88 | ): Promise<PermissionResult> => { | ||
| 89 | // Auto-approve all MCP tools (they start with "mcp__") | ||
| 90 | if (toolName.startsWith("mcp__")) { | ||
| 91 | return { behavior: "allow" }; | ||
| 92 | } | ||
| 93 | // For non-MCP tools, allow them too since research is read-heavy | ||
| 94 | return { behavior: "allow" }; | ||
| 95 | }, | ||
| 96 | }), | 86 | }), |
| 97 | }, | 87 | }, |
| 98 | }); | 88 | }); |
