Fix MCP tool allowlist filtering in SDK run path#501
Conversation
Greptile SummaryThis PR fixes a one-line bug in
Confidence Score: 5/5Safe to merge — the fix is a correct, minimal one-line change with a targeted regression test that directly validates the repaired behavior. The bug ( No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as CodebuffClient
participant R as run.ts (runOnce)
participant MCP as getMCPClient / listMCPTools
participant MP as callMainPrompt
C->>R: client.run({ agent, prompt })
R->>MP: callMainPrompt({ requestMcpToolData, ... })
MP->>R: requestMcpToolData({ mcpConfig, toolNames })
R->>MCP: getMCPClient(mcpConfig)
MCP-->>R: mcpClientId
R->>MCP: listMCPTools(mcpClientId)
MCP-->>R: { tools: [browser_navigate, browser_snapshot, browser_click] }
Note over R: for each tool:<br/>toolNames.includes(tool.name) ✅<br/>(was: tool.name in toolNames ❌)
R-->>MP: filteredTools: [browser_navigate, browser_snapshot]
MP-->>R: { sessionState, output }
R-->>C: AgentOutput
Reviews (1): Last reviewed commit: "Fix MCP tool allowlist filtering" | Re-trigger Greptile |
Summary
sdk/src/run.tsto use value membership instead of array index/property checksValidation
bun test sdk/src/__tests__/run-mcp-tool-filter.test.tsbun run typecheck(fromsdk/)