Recover abandoned started agent runs after runtime shutdown

Aperta
#4,633 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Parti dal percorso catch del runtime handler e dalla gestione esistente degli errori dei run avviati descritta nell’issue. Traccia come vengono persistiti i run avviati e come avviene l’avvio del runtime, quindi aggiungi test di recovery per un run interrotto. Il lavoro è completato quando la recovery al riavvio contrassegna i run obsoleti come terminali con un errore esplicativo, senza far fallire i run attivi di lunga durata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The UI shows "Thinking" while the latest agent run remains . We fixed one runtime failure path where a handler throws after starting a run, but hard process death / laptop sleep / runtime shutdown can still leave a started run without any terminal update because the process never gets a chance to run catch/finally cleanup.

Proposed second layer

Add recovery semantics for abandoned started runs, e.g. one of:

  • a run lease / heartbeat renewed while a run is active, plus a janitor/startup sweep that marks stale started runs failed, or
  • a simpler startup recovery sweep that marks old runs failed with a clear interrupted/abandoned error.

Acceptance criteria

  • A runtime restart after an interrupted run does not leave the UI stuck on Thinking indefinitely.
  • Stale started runs are marked terminal ( or equivalent) with an explanatory / error message.
  • Long-running active runs are not incorrectly failed if heartbeat/lease support is implemented.
  • Add tests covering an abandoned started run recovery path.

Context

Current PR addresses handler exceptions after a run starts by failing the newly-started run in the handler catch path. This issue tracks crash/shutdown recovery where no in-process catch/finally can run.

Lingua principale
TypeScript
Stelle
10.4k
Fork
399
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di electric-sql/electric

Tutte le issue di electric-sql/electric

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.