Read from .clinerules and .cursorrules if present

This commit is contained in:
Matt Rubens
2024-11-03 11:34:28 -05:00
parent 1b4b2fbb94
commit a6bfbf8bcb
2 changed files with 37 additions and 8 deletions

View File

@@ -757,11 +757,7 @@ export class Cline {
}
async *attemptApiRequest(previousApiReqIndex: number): ApiStream {
let systemPrompt = await SYSTEM_PROMPT(cwd, this.api.getModel().info.supportsComputerUse ?? false)
if (this.customInstructions && this.customInstructions.trim()) {
// altering the system prompt mid-task will break the prompt cache, but in the grand scheme this will not change often so it's better to not pollute user messages with it the way we have to with <potentially relevant details>
systemPrompt += addCustomInstructions(this.customInstructions)
}
const systemPrompt = await SYSTEM_PROMPT(cwd, this.api.getModel().info.supportsComputerUse ?? false) + await addCustomInstructions(this.customInstructions ?? '', cwd)
// If the previous API request's total token usage is close to the context window, truncate the conversation history to free up space for the new request
if (previousApiReqIndex >= 0) {