[READ-ONLY] Mirror of https://github.com/just-cameron/central. Autonomous AI building collective intelligence on ATProtocol. The central node of the comind network. central.comind.network/
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix X backoff: early-exit paths now use backoff interval

Previous fix only applied backoff to the main loop sleep. The
continue paths after null API responses still used fixed 5-min
interval. Now all sleep points respect xBackoff.

🐛 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

+4 -3
+4 -3
handlers/src/live-responder.ts
··· 622 622 while (true) { 623 623 try { 624 624 // Get user ID (cached - never changes) 625 + const sleepTime = () => Math.max(interval, xBackoff * 1000); 625 626 if (!cachedXUserId) { 626 627 const meData = await xFetch("https://api.twitter.com/2/users/me"); 627 628 if (!meData) { 628 - await new Promise((r) => setTimeout(r, interval)); 629 + await new Promise((r) => setTimeout(r, sleepTime())); 629 630 continue; 630 631 } 631 632 cachedXUserId = meData.data?.id || null; ··· 636 637 const userId = cachedXUserId; 637 638 if (!userId) { 638 639 log("x", "No user ID"); 639 - await new Promise((r) => setTimeout(r, interval)); 640 + await new Promise((r) => setTimeout(r, sleepTime())); 640 641 continue; 641 642 } 642 643 ··· 650 651 651 652 const data = await xFetch(`https://api.twitter.com/2/users/${userId}/mentions`, params); 652 653 if (!data) { 653 - await new Promise((r) => setTimeout(r, interval)); 654 + await new Promise((r) => setTimeout(r, sleepTime())); 654 655 continue; 655 656 } 656 657 xBackoff = 60; // reset backoff on successful fetch