feat(observability): structured termination reason for every run

Aperta
#149 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
observability

Direzione di ricerca

The issue names no files, tests, or entry points. Start by locating the trajectory/result payload and the termination paths that produce it, then define how each proposed reason maps to a terminated run. Done means every terminated run carries a machine-readable termination record in the result artifact, with timeout and backend errors distinguishable.

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

Descrizione

Problem

When a run ends abnormally, the result payload carries no machine-readable cause. Operators are left doing forensic fingerprinting — e.g. inferring "launch stall" from n_messages == 0 && elapsed ≈ watchdog timeout, or diffing timestamps to separate "gateway rejected the request" from "agent deadlocked internally" from "model stopped making progress".

In batch usage this is the single largest operational cost: for one incident class, roughly half of the debugging time went into merely classifying failures before any actual fixing could start.

Proposal

Every terminated run should emit a structured termination record in the result artifact itself (not only in logs), e.g.:

{
  "finish_reason": "llm_call_timeout",
  "detail": { "last_error": "...", "http_status": 429, "turn": 17 }
}

Suggested enum, minimally:

  • completed — normal finish
  • max_turns / budget_exhausted
  • context_limit_salvaged — see #152
  • llm_call_timeout vs backend_error(code) — these two being distinguishable is the core ask
  • no_progress — loop-break / degeneration interventions
  • aborted — external kill

Design notes:

  • The record belongs on the trajectory/result payload so downstream consumers can filter programmatically.
  • Pairs naturally with a heartbeat/progress event stream (#153): heartbeat covers the run's lifetime, termination reason covers its end.
Lingua principale
Python
Stelle
4.1k
Fork
94
Merge medio
2g 7h
PR unite (30g)
216

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 EverMind-AI/Raven

Tutte le issue di EverMind-AI/Raven

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.