Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/core/prompts/sections/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
}
2 changes: 1 addition & 1 deletion src/core/prompts/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading