feat: Add previous comments to issue context for better conversation awareness#4
Open
roger704 wants to merge 1 commit intocoleam00:mainfrom
Open
feat: Add previous comments to issue context for better conversation awareness#4roger704 wants to merge 1 commit intocoleam00:mainfrom
roger704 wants to merge 1 commit intocoleam00:mainfrom
Conversation
…awareness Problem: On follow-up comments to an issue, the agent only received the new comment text. It had no context of: - The original issue description (only included for first message) - Previous comments in the thread - What it had said or done before This led to repetitive or contradictory responses. Solution: 1. **Fetch previous comments** via GitHub API (up to 10 recent relevant comments) 2. **Always include issue context** on every message, not just the first one 3. **Filter bot acknowledgments** to keep context relevant Changes: - Added `fetchIssueComments()` method to retrieve previous comments - Modified `buildIssueContext()` to be async and include previous comments - Changed context logic from `if (isNewConversation)` to always include Benefits: - Agent sees full conversation history - Can continue work from where it left off - Avoids repeating itself or contradicting previous responses
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
This PR improves conversation context by fetching previous comments and always including the issue description, not just on the first message.
Problem
On follow-up comments to an issue, the agent only received the new comment text with no context of:
This led to:
Solution
1. Fetch Previous Comments
New
fetchIssueComments()method retrieves up to 10 recent relevant comments:Bot acknowledgments are filtered out to keep context relevant.
2. Always Include Issue Context
Changed from:
To:
3. Enhanced Context Format
The context now includes:
Benefits
Testing
Tested in production with multi-turn conversations - agent now correctly references previous discussion and avoids repetition.