fix: runAgent fire-and-forget + polling sur la page /agents
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled

Le bouton Play des cartes agents appelait runAgent (Server Action) qui
attendait executeAgent (~2-5 min) → spinner bloqué sans résultat.

- runAgent retourne immédiatement { success, agentId }
- agent-card.tsx lance un polling toutes les 3s sur GET
  /api/agents/run-for-note?agentId= jusqu'au statut terminal
- Toast persistant Sonner pendant la génération, mis à jour au résultat
- Cleanup automatique du polling au démontage

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Antigravity
2026-05-05 21:26:35 +00:00
parent 75b08ef53b
commit 34a977b5c4
4 changed files with 67 additions and 21 deletions

View File

@@ -1579,6 +1579,8 @@
"updated": "Agent updated",
"deleted": "\"{name}\" deleted",
"deleteError": "Error deleting",
"running": "Generation in progress…",
"runningDesc": "Generation may take a few minutes. You can navigate freely.",
"runSuccess": "\"{name}\" executed successfully",
"runError": "Error: {error}",
"runFailed": "Execution failed",