Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Tweet Response Deduplication Check #622

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

tsubasakong
Copy link
Contributor

Relates to:

Twitter interaction handling and response deduplication

Risks

Low - Adds defensive check to prevent duplicate responses to tweets. Does not modify core functionality.

Background

What does this PR do?

This PR adds tweet response deduplication by:

  1. Generating unique tweetId using stringToUuid combining tweet.id and agentId
  2. Checking message history before responding to prevent duplicate responses
  3. Improving logging for skipped tweets
  4. Maintaining consistent ID generation across different interaction points

What kind of change is this?

Bug fixes (non-breaking change which fixes an issue)

Documentation changes needed?

My changes do not require a change to the project documentation as this is an internal improvement.

Testing

Where should a reviewer start?

  1. Review the tweet response check in packages/client-twitter/src/interactions.ts
  2. Focus on the tweetId generation and message history check implementation

Detailed testing steps

  1. Test duplicate tweet handling:
    In the character.json file, use "twitter" as the client, and modelProvider, use "heurist" as model provider. The free API key can be applied here and using ai16z as the referral code.

@wojski
Copy link

wojski commented Nov 27, 2024

Noice

@lalalune lalalune merged commit 6682a71 into elizaOS:main Nov 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants