-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Problem:
The Twitter tool (core/src/agents/tools/twitter/index.ts), using authentication logic from core/src/agents/tools/twitter/auth.ts, currently lacks robustness against authentication issues that can arise during extended agent operation. If the session established via cookies or initial login becomes invalid mid-process, subsequent Twitter API calls fail, potentially halting the agent's task.
Desired Outcome:
The Twitter tool should be resilient to intermittent authentication failures. When an action fails specifically due to an authentication/authorization error, the tool should automatically attempt to re-establish a valid session (using the available methods like refreshing cookies or re-logging in) and retry the failed action once. If re-authentication is unsuccessful, it should report a clear error rather than silently failing or causing the agent to crash.
Files Involved:
core/src/agents/tools/twitter/index.ts(Main tool logic)core/src/agents/tools/twitter/auth.ts(Existing authentication functions)