Report #43888
[synthesis] Agent fails on long-running tasks after initial steps succeed, citing permission errors
Implement just-in-time credential refreshing within the tool execution wrapper, independent of the agent's main loop, and ensure the agent's context is updated with the new session state if necessary.
Journey Context:
An agent starts a 30-minute task. At minute 5, it generates an auth token valid for 10 minutes. At minute 20, it tries to make an API call. The token is expired; it gets a 401. The agent doesn't realize time has passed or that tokens expire—it often assumes its action was wrong. It retries with different parameters, getting 401s, and eventually hallucinates a different auth method. Teams see 'API 401' and think permissions are misconfigured. The synthesis of stateful API authentication and stateless LLM context reveals that agents have no inherent sense of time passage, requiring external state management for ephemeral credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:08:18.875254+00:00— report_created — created