mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: exclude XML tool examples from MODES section when native protocol enabled
This commit is contained in:
parent
bb31b04dba
commit
4bd65f935a
2 changed files with 12 additions and 3 deletions
|
|
@ -5,7 +5,10 @@ import type { ModeConfig } from "@roo-code/types"
|
|||
import { getAllModesWithPrompts } from "../../../shared/modes"
|
||||
import { ensureSettingsDirectoryExists } from "../../../utils/globalContext"
|
||||
|
||||
export async function getModesSection(context: vscode.ExtensionContext): Promise<string> {
|
||||
export async function getModesSection(
|
||||
context: vscode.ExtensionContext,
|
||||
skipXmlExamples: boolean = false,
|
||||
): Promise<string> {
|
||||
// Make sure path gets created
|
||||
await ensureSettingsDirectoryExists(context)
|
||||
|
||||
|
|
@ -31,12 +34,18 @@ ${allModes
|
|||
})
|
||||
.join("\n")}`
|
||||
|
||||
modesContent += `
|
||||
if (!skipXmlExamples) {
|
||||
modesContent += `
|
||||
If the user asks you to create or edit a new mode for this project, you should read the instructions by using the fetch_instructions tool, like this:
|
||||
<fetch_instructions>
|
||||
<task>create_mode</task>
|
||||
</fetch_instructions>
|
||||
`
|
||||
} else {
|
||||
modesContent += `
|
||||
If the user asks you to create or edit a new mode for this project, you should read the instructions by using the fetch_instructions tool.
|
||||
`
|
||||
}
|
||||
|
||||
return modesContent
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ async function generatePrompt(
|
|||
const effectiveProtocol = getEffectiveProtocol(settings?.toolProtocol)
|
||||
|
||||
const [modesSection, mcpServersSection] = await Promise.all([
|
||||
getModesSection(context),
|
||||
getModesSection(context, isNativeProtocol(effectiveProtocol)),
|
||||
shouldIncludeMcp
|
||||
? getMcpServersSection(
|
||||
mcpHub,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue