Conversation
|
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.

This pull request introduces several improvements to the agent's context management, prompt handling, and compatibility with Anthropic's API. The main focus is on making context compaction more robust and research-friendly, improving tool output handling, and ensuring system/user message alternation is Anthropic-compliant. There are also enhancements to the system prompt to clarify persistent memory and long-running task usage.
Agent Context Management & Compaction:
ContextManager, including pruning old tool outputs, protecting a token-budgeted tail, generating structured research summaries, and assembling compressed messages. The summary now uses a research-adapted template and supports iterative updates. [1] [2] [3]tiktokenif available, falling back to the previous method if not.Prompt & System Message Improvements:
system_prompt.yamlto inject memory, project, and knowledge context dynamically, and provides clearer instructions for using persistent memory, session search, and long-running background tasks. [1] [2]Anthropic API Compatibility & Tool Output Handling:
systemprompt as a typed block and adds prompt caching headers for Anthropic API calls. [1] [2]User Guidance & Nudges:
These changes collectively improve the agent's ability to manage long research conversations, reduce context loss, and provide a more seamless experience across different LLM providers.
Agent Context Management & Compaction
tiktokenif available, for more accurate context management.Prompt & System Message Improvements
system_prompt.yamlto inject memory, project, and knowledge context, and provides explicit instructions for persistent memory, session search, and long-running tasks. [1] [2]Anthropic API Compatibility & Tool Output Handling
User Guidance & Nudges