perf: implement bounded conversation history and caching optimizations#1463
Open
Letteriello wants to merge 7 commits intoeigent-ai:mainfrom
Open
perf: implement bounded conversation history and caching optimizations#1463Letteriello wants to merge 7 commits intoeigent-ai:mainfrom
Letteriello wants to merge 7 commits intoeigent-ai:mainfrom
Conversation
- US-006: Add bounded conversation history with sliding window (100 messages) - Frontend: trim messages in chatStore.addMessages() - Backend: add TaskLock.trim_conversation_history() method - Auto-trim before context overflow errors - US-007: Add toolkit caching - Cache tool results per (toolkit_name, task_id) - Cache MCP toolkit connections for reuse - Add clear_toolkit_cache() and clear_mcp_cache() helpers - US-008/US-009: Add prompt caching - Cache platform info via @lru_cache in utils.py - Cache formatted prompts to avoid recomputation - Update factory files to use format_prompt() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- US-010: Implement context compression via summarization - Add compress_conversation_history() method to TaskLock - Generate summary from older entries before trimming - Include summary in get_recent_context() output - Auto-compress when conversation exceeds 2x max_entries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log history length, summary presence, and summary length when building context - Include last_task_summary in context when available - Log final context length for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract key actions from tool calls (file creation, reading, writing, etc.) - Extract main topics from user messages - Create structured summary with message count, actions, and topics - Add more detailed logging for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log conversation entries count, summary presence and preview - Log task result length for debugging context preservation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log when summary is included in context - Log total context length and entries included Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test compression creates structured summary with actions/topics - Test compression skips when history is small - Test get_recent_context includes summary when available - Test get_recent_context works without summary Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Code ReviewEncontrei 3 issues para considerar: 1. Cache key collision risk (Medium)
2. now_str não está na cache key (High)O 3. Toolkit cache por task_id (Medium)O cache usa Sugestões
Boa implementação no geral! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code