On-Demand Diff
GitAuto fetches git diffs on demand per file instead of embedding the full patch in the first message. The agent calls the git_diff tool when it needs to see what changed, keeping the base conversation small.
Why This Exists
GitHub webhooks include a patch field for each changed file. For large PRs this patch can exceed 100K characters. Because every LLM call includes the full conversation history, that 100K sits in every single API request. A PR with 30 iterations sends 100K x 30 = 3M characters of redundant diff text, inflating cost and wasting context window space.
How It Works
The patch field in changed_files is truncated to 1,000 characters before it enters the first LLM message. This gives the agent enough context to see what kind of change was made (additions, deletions, file structure) without carrying the full diff. When the agent needs the complete diff for a specific file, it calls the git_diff tool which runs git diff against the cloned repository and returns the result. Large diffs are capped at 50K characters to stay within context limits.
Related Features
- Token Trimming - trims oldest messages when the context window fills up
- Stale File Replacement - replaces duplicate file reads with placeholders
Need Help?
Have questions or suggestions? We're here to help you get the most out of GitAuto.
Contact us with your questions or feedback!