Feature: Implement intelligent context-pruning for LLM retries - #249
Open
pradeep0153 wants to merge 1 commit into
Open
Feature: Implement intelligent context-pruning for LLM retries#249pradeep0153 wants to merge 1 commit into
pradeep0153 wants to merge 1 commit into
Conversation
|
@pradeep0153 is attempting to deploy a commit to the sreerevanth's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #244.
Description
This PR executes a major performance and cost-optimization initiative for the core agent loop. During an agent loop, if the initial LLM response failed the test suite, the agent fed the error back to the LLM via
retry_request().However,
context_builder.pymathematically continued to send the exact same massive 60K-character XML context on every retry. Since the LLM already inherently understands the repository context from the first prompt in the conversation thread, appending the full file tree to iterations 2, 3, and 4 drastically inflated token usage, slowed down response times, and skyrocketed API costs without providing any new value.Changes Made
LLMClient.retry_request()andcontext_builder.py.Impact