mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Turn SYSTEM_PROMPT into a function so it always has the latest values
This commit is contained in:
@@ -17,7 +17,8 @@ import { ClaudeAsk, ClaudeSay, ClaudeSayTool } from "./shared/ExtensionMessage"
|
|||||||
import { Tool, ToolName } from "./shared/Tool"
|
import { Tool, ToolName } from "./shared/Tool"
|
||||||
import { ClaudeAskResponse } from "./shared/WebviewMessage"
|
import { ClaudeAskResponse } from "./shared/WebviewMessage"
|
||||||
|
|
||||||
const SYSTEM_PROMPT = `You are Claude Dev, a highly skilled software developer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
|
const SYSTEM_PROMPT =
|
||||||
|
() => `You are Claude Dev, a highly skilled software developer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
|
||||||
|
|
||||||
====
|
====
|
||||||
|
|
||||||
@@ -36,7 +37,8 @@ CAPABILITIES
|
|||||||
RULES
|
RULES
|
||||||
|
|
||||||
- Unless otherwise specified by the user, you MUST accomplish your task within the following directory: ${
|
- Unless otherwise specified by the user, you MUST accomplish your task within the following directory: ${
|
||||||
vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop")
|
vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ??
|
||||||
|
path.join(os.homedir(), "Desktop")
|
||||||
}
|
}
|
||||||
- Your current working directory is '${process.cwd()}', and you cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${process.cwd()}', so be sure to pass in the appropriate 'path' parameter when using tools that require a path.
|
- Your current working directory is '${process.cwd()}', and you cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${process.cwd()}', so be sure to pass in the appropriate 'path' parameter when using tools that require a path.
|
||||||
- If you do not know the contents of an existing file you need to edit, use the read_file tool to help you make informed changes. However if you have seen this file before, you can assume its contents have not changed since you last read it or wrote to it.
|
- If you do not know the contents of an existing file you need to edit, use the read_file tool to help you make informed changes. However if you have seen this file before, you can assume its contents have not changed since you last read it or wrote to it.
|
||||||
@@ -623,7 +625,7 @@ export class ClaudeDev {
|
|||||||
model: "claude-3-5-sonnet-20240620", // https://docs.anthropic.com/en/docs/about-claude/models
|
model: "claude-3-5-sonnet-20240620", // https://docs.anthropic.com/en/docs/about-claude/models
|
||||||
// beta max tokens
|
// beta max tokens
|
||||||
max_tokens: 8192,
|
max_tokens: 8192,
|
||||||
system: SYSTEM_PROMPT,
|
system: SYSTEM_PROMPT(),
|
||||||
messages: (await this.providerRef.deref()?.getApiConversationHistory()) || [],
|
messages: (await this.providerRef.deref()?.getApiConversationHistory()) || [],
|
||||||
tools: tools,
|
tools: tools,
|
||||||
tool_choice: { type: "auto" },
|
tool_choice: { type: "auto" },
|
||||||
|
|||||||
Reference in New Issue
Block a user