[BUG]: Workflow errors are logged as "Unknown source: No message provided"

Aperta
#187 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Read backend/app/modules/langgraph_builder.py and the error_handler path, then check backend/tests/test_pipeline.py and the /api/process description in backend/API.md. Reproduce the dropped error details with the supplied failing-node example. Done means the server log names the failing step and message while the API response remains unchanged; the author says a fix and tests are already prepared and plans to open a PR.

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

Descrizione

Description

When a step of the LangGraph workflow fails, the server log does not say which step failed or why. Every failure is logged as:

Error detected from 'Unknown source': No message provided

Each node returns {"status": "error", "error_from": ..., "message": ...} when it fails, and error_handler logs error_from and message. But MyState in backend/app/modules/langgraph_builder.py has no error_from or message keys, and LangGraph drops keys that are not in the state schema. So error_handler never sees them and falls back to its defaults.

backend/API.md says for /api/process: "The failing step and its message are written to the server log only, not to the response." The response part holds, but the log part does not. The comment in test_workflow_stops_at_the_first_failing_step (backend/tests/test_pipeline.py) also notes that these keys are dropped.

Steps to reproduce

Make any node fail, for example /api/process with a Groq call that errors, or this in the backend test setup:

from app.modules import langgraph_builder
from app.modules.langgraph_nodes import sentiment

sentiment.run_sentiment_sdk = lambda state: {
    "status": "error", "error_from": "sentiment_analysis", "message": "Groq timed out"
}
langgraph_builder.build_langgraph().invoke({"cleaned_text": "Article text."})

The log shows Error detected from 'Unknown source': No message provided instead of Error detected from 'sentiment_analysis': Groq timed out.

Expected

The log names the failing step and its message, as API.md describes, and the response stays the same (no error_from or message in it).

I have a fix with tests ready and will open a PR.

Lingua principale
TypeScript
Stelle
58
Fork
90
Merge medio
11h 51m
PR unite (30g)
3

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 AOSSIE-Org/Perspective

Tutte le issue di AOSSIE-Org/Perspective

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.