mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Exclude MCP from system prompt if mode does not support it
This commit is contained in:
parent
dba32ef117
commit
003cd1bce1
2 changed files with 13 additions and 5 deletions
5
.changeset/fluffy-pumpkins-sip.md
Normal file
5
.changeset/fluffy-pumpkins-sip.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Exclude MCP instructions from the prompt if the mode doesn't support MCP
|
||||
|
|
@ -7,6 +7,7 @@ import {
|
|||
defaultModeSlug,
|
||||
ModeConfig,
|
||||
getModeBySlug,
|
||||
getGroupName,
|
||||
} from "../../shared/modes"
|
||||
import { DiffStrategy } from "../diff/DiffStrategy"
|
||||
import { McpHub } from "../../services/mcp/McpHub"
|
||||
|
|
@ -50,15 +51,17 @@ async function generatePrompt(
|
|||
// If diff is disabled, don't pass the diffStrategy
|
||||
const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined
|
||||
|
||||
const [mcpServersSection, modesSection] = await Promise.all([
|
||||
getMcpServersSection(mcpHub, effectiveDiffStrategy, enableMcpServerCreation),
|
||||
getModesSection(context),
|
||||
])
|
||||
|
||||
// Get the full mode config to ensure we have the role definition
|
||||
const modeConfig = getModeBySlug(mode, customModeConfigs) || modes.find((m) => m.slug === mode) || modes[0]
|
||||
const roleDefinition = promptComponent?.roleDefinition || modeConfig.roleDefinition
|
||||
|
||||
const [modesSection, mcpServersSection] = await Promise.all([
|
||||
getModesSection(context),
|
||||
modeConfig.groups.some((groupEntry) => getGroupName(groupEntry) === "mcp")
|
||||
? getMcpServersSection(mcpHub, effectiveDiffStrategy, enableMcpServerCreation)
|
||||
: Promise.resolve(""),
|
||||
])
|
||||
|
||||
const basePrompt = `${roleDefinition}
|
||||
|
||||
${getSharedToolUseSection()}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue