changing prompts for the context management (#5854)

* changing prompts for the context management

* distinction between the tool call options
This commit is contained in:
Toshii authored and GitHub committed 2025-08-29 12:22:48 -07:00
1 parent 45871a962e
commit 716e6cd6ab
2 files changed
+10 -4

No files matched your search

+9 -3
View File
@@ -7,6 +7,8 @@ You have only two options: If you are immediately prepared to call the attempt_c
You MUST ONLY respond to this message by using either the attempt_completion tool or the summarize_task tool call.
When responding with the summarize_task tool call, follow these instructions:
Before providing your final summary, wrap your analysis in <thinking> tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:
1. Chronologically analyze each message and section of the conversation. For each section thoroughly identify:
- The user's explicit requests and intents
@@ -21,10 +23,14 @@ Your summary should include the following sections:
3. Files and Code Sections: Enumerate specific files and code sections examined, modified, or created. Pay special attention to the most recent messages and include full code snippets where applicable and include a summary of why this file read or edit is important.
4. Problem Solving: Document problems solved and any ongoing troubleshooting efforts.
5. Pending Tasks: Outline any pending tasks that you have explicitly been asked to work on.
6. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable.
7. Optional Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests without confirming with the user first.
6. Task Evolution: If the user provided additional requests or modified the original task during the conversation, document this progression:
- Task Modifications: [Chronological list of how the user redirected or modified the work since the original task]
- Current Active Task: [What the user most recently asked to work on]
- Context for Changes: [Why the task evolved - user feedback, new requirements, etc. (Include direct quotes from user messages that caused task changes to prevent drift after context compacting)]
7. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable.
8. Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests without confirming with the user first.
If there is a next step, include direct quotes from the most recent conversation showing exactly what task you were working on and where you left off. This should be verbatim to ensure there's no drift in task interpretation.
8. You should pay special attention to the most recent user message, as it indicates the user's most recent intent, if applicable.
9. You should pay special attention to the most recent user message, as it indicates the user's most recent intent.
${
focusChainSettings?.enabled
+1 -1
View File
@@ -9,7 +9,7 @@ export const formatResponse = {
`[[NOTE] This file read has been removed to save space in the context window. Refer to the latest file read for the most up to date version of this file.]`,
contextTruncationNotice: () =>
`[NOTE] Some previous conversation history with the user has been removed to maintain optimal context window length. The initial user task has been retained for continuity, while intermediate conversation history has been removed. Please keep this in mind as you continue assisting the user.`,
`[NOTE] Some previous conversation history with the user has been removed to maintain optimal context window length. The initial user task has been retained for continuity, while intermediate conversation history has been removed. Keep this in mind as you continue assisting the user. Pay special attention to the user's latest messages.`,
processFirstUserMessageForTruncation: (originalContent: string) => {
const MAX_CHARS = 400_000