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

Multiple generateNewTweetLoop method invocations caused multiple tweets to be posted. #1395

Closed
jasonqindev opened this issue Dec 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jasonqindev
Copy link
Contributor

jasonqindev commented Dec 23, 2024

Describe the bug
At Yotta Labs, we are transforming global computing into a high-performance, decentralized AI platform. As part of this mission, I integrated the AI Agent functionality and selected the Eliza framework for managing agent-related tasks.

While configuring the Twitter client and successfully logging into my account, I noticed an issue in the runtime logs: the message ["◎ Next tweet scheduled in 128 minutes"] appeared twice. This indicates that generateNewTweetLoop was called twice, resulting in two independent tweet scheduling loops being initialized.

The issue occurs because the start method in /packages/client-twitter/src/post.ts calls generateNewTweetLoop twice—once at line 174 and again at line 190—without any conditional checks to prevent multiple timers.

To Reproduce

  1. Add the following code to the relevant character.json file:

    "clients": ["twitter"]
    
  2. Configure the Twitter-related parameters in the .env file, and set POST_IMMEDIATELY=true to enable immediate tweet posting.

  3. Start the model service.

  4. Check Twitter, and you will find that two tweets are posted simultaneously. Additionally, the logs show the message Next tweet scheduled in xxx minutes printed twice.

Expected behavior
The generateNewTweetLoop method should only be invoked once during the start method, ensuring that only a single tweet scheduling loop is active. This would prevent duplicate logs and redundant scheduling timers.

Screenshots
image

Additional context

  • File: /packages/client-twitter/src/post.ts
  • Method: start
  • Lines: 174 and 190
  • Observed Behavior: generateNewTweetLoop is called twice without a conditional check, causing two scheduling loops to be initialized.
  • Move second generateNewTweetLoop() inside the if (enableActionProcessing)
@jasonqindev jasonqindev added the bug Something isn't working label Dec 23, 2024
jasonqindev added a commit to jasonqindev/eliza that referenced this issue Dec 23, 2024
- Resolved an issue where `generateNewTweetLoop` was called twice in the `start` method of /packages/client-twitter/src/post.ts.\n- The method was invoked at line 174 and line 190 without any conditional checks, leading to two independent tweet scheduling loops being created.\n- Removed one of the redundant `generateNewTweetLoop` calls to ensure only a single scheduling loop is initialized.\n\nFixes elizaOS#1395
@shakkernerd
Copy link
Member

Fixed in #1472

@tcm390 tcm390 self-assigned this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants