Files
AutoGPT/autogpt_platform/backend
Zamil Majdy a529a16d70 feat(backend): persist long-running tool results to survive SSE disconnects
Agent generation (create_agent, edit_agent) can take several minutes.
Previously, if the user closed their browser tab, the operation would be
cancelled via CancelledError and the result lost.

This change:
- Adds `is_long_running` property to BaseTool for tools to opt-in
- Long-running tools spawn background tasks that run independently of SSE
- Saves "pending" message to chat history immediately
- Updates chat history with result when background task completes
- Adds idempotency check to prevent duplicate operations on refresh
- Invalidates Redis cache after completion so refresh loads fresh data

User can now close their tab during agent generation and see the result
when they return to the chat.
2026-01-27 12:14:17 -06:00
..