From e1732d4af5f57c5b24d5e94d6c3898a502282c05 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 10 Dec 2025 13:47:05 +0000 Subject: [PATCH] fix: fix remaining Agent type references --- src/core/prompts/__tests__/system-prompt.spec.ts | 10 +++++----- src/core/webview/ClineProvider.ts | 6 +++--- src/core/webview/webviewMessageHandler.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/prompts/__tests__/system-prompt.spec.ts b/src/core/prompts/__tests__/system-prompt.spec.ts index 2663d0ba29..a0953b2de1 100644 --- a/src/core/prompts/__tests__/system-prompt.spec.ts +++ b/src/core/prompts/__tests__/system-prompt.spec.ts @@ -97,7 +97,7 @@ __setMockImplementation( // Add mode-specific instructions after if (modeCustomInstructions?.trim()) { - sections.push(`Agent-specific Instructions:\n${modeCustomInstructions}`) + sections.push(`Mode-specific Instructions:\n${modeCustomInstructions}`) } // Add rules @@ -486,7 +486,7 @@ describe("SYSTEM_PROMPT", () => { const customModes: ModeConfig[] = [ { slug: "custom-mode", - name: "Custom Agent", + name: "Custom Mode", roleDefinition: "Custom role definition", customInstructions: modeCustomInstructions, groups: ["read"] as const, @@ -538,7 +538,7 @@ describe("SYSTEM_PROMPT", () => { undefined, // mcpHub undefined, // diffStrategy undefined, // browserViewportSize - defaultModeSlug as Agent, // mode + defaultModeSlug as Mode, // mode customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions @@ -571,7 +571,7 @@ describe("SYSTEM_PROMPT", () => { undefined, // mcpHub undefined, // diffStrategy undefined, // browserViewportSize - defaultModeSlug as Agent, // mode + defaultModeSlug as Mode, // mode customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions @@ -618,7 +618,7 @@ describe("SYSTEM_PROMPT", () => { // Should not contain the tool description expect(prompt).not.toContain("## update_todo_list") - // Agent instructions will still reference the tool with a fallback to markdown + // Mode instructions will still reference the tool with a fallback to markdown }) it("should include update_todo_list tool when todoListEnabled is true", async () => { diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 94dec39512..06b2308328 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -870,9 +870,9 @@ export class ClineProvider const modeExists = getModeBySlug(historyItem.mode, customModes) !== undefined if (!modeExists) { - // Agent no longer exists, fall back to default mode. + // Mode no longer exists, fall back to default mode. this.log( - `Agent '${historyItem.mode}' from history no longer exists. Falling back to default mode '${defaultModeSlug}'.`, + `Mode '${historyItem.mode}' from history no longer exists. Falling back to default mode '${defaultModeSlug}'.`, ) historyItem.mode = defaultModeSlug } @@ -2269,7 +2269,7 @@ export class ClineProvider currentApiConfigName: stateValues.currentApiConfigName ?? "default", listApiConfigMeta: stateValues.listApiConfigMeta ?? [], pinnedApiConfigs: stateValues.pinnedApiConfigs ?? {}, - modeApiConfigs: stateValues.modeApiConfigs ?? ({} as Record), + modeApiConfigs: stateValues.modeApiConfigs ?? ({} as Record), customModePrompts: stateValues.customModePrompts ?? {}, customSupportPrompts: stateValues.customSupportPrompts ?? {}, enhancementApiConfigId: stateValues.enhancementApiConfigId, diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index d1ef8d9f6a..f9bc7a85cd 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -1479,7 +1479,7 @@ export const webviewMessageHandler = async ( break case "mode": - await provider.handleModeSwitch(message.text as Agent) + await provider.handleModeSwitch(message.text as Mode) break case "updatePrompt": if (message.promptMode && message.customPrompt !== undefined) {