Replace list_files_recursive and list_files_top_level with list_files and automatically provide project file structure when task starts to avoid unnecessary request

This commit is contained in:
Saoud Rizwan
2024-08-29 05:58:41 -04:00
parent 26d7dfa8f7
commit e78a58d77d
4 changed files with 25 additions and 79 deletions

View File

@@ -35,7 +35,7 @@ export function truncateHalfConversation(
): Anthropic.Messages.MessageParam[] {
// API expects messages to be in user-assistant order, and tool use messages must be followed by tool results. We need to maintain this structure while truncating.
// Keep the first Task message (likely the most important)
// Always keep the first Task message (this includes the project's file structure in potentially_relevant_details)
const truncatedMessages = [messages[0]]
// Remove half of user-assistant pairs