[BUG]: A failed fact verification returns an empty success with no error

Aperta Adatta ai principianti
#191 0 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
83/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, typescript
Ambito
ai, backend

Direzione di ricerca

Inizia da backend/app/utils/fact_check_utils.py e segui come run_fact_check_pipeline gestisce il risultato di run_fact_verifier_sdk. Controlla come fact_check.py segnala gli errori della pipeline, poi aggiungi un test di regressione per un errore del verificatore, come il limite di richieste di Groq descritto qui. Il lavoro è completo quando la pipeline restituisce l’errore del verificatore e la route segnala un errore.

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

Descrizione

Bug Description

run_fact_check_pipeline in backend/app/utils/fact_check_utils.py never checks the status returned by run_fact_verifier_sdk:

final = run_fact_verifier_sdk(search_results)
return final.get("verifications", []), None

When the verifier fails, it returns {"status": "error", ...} with no verifications key. The pipeline turns that into ([], None). fact_check.py then sees no error and returns status: "success" with an empty fact list.

So a Groq error or rate limit during fact verification looks exactly like a successful check that found nothing. The user gets no sign that the check failed.

Note: the same pattern affects the claim-extraction check at the top of the function (if state.get("status") != "success" tests the input state, not result). Open PRs #148 and #150 already fix that part, so this issue covers only the verifier path.

Steps to Reproduce
  1. Make run_claim_extractor_sdk return claims (any valid verifiable_claims string).
  2. Make run_fact_verifier_sdk return {"status": "error", "error_from": "fact_verification", "message": "Groq rate limit"}.
  3. Call run_fact_check_pipeline(state).

The repro script is attached below. It stubs the Groq and search modules (see the note under Environment) but calls the real run_fact_check_pipeline.

Logs and Screenshots
== C: verifier fails (Groq error) after claims were found
  error: None | facts: []

Expected: error is set, for example "Groq rate limit", so the route reports a failure rather than an empty success.

Environment Details
  • main of AOSSIE-Org/Perspective, backend/app/utils/fact_check_utils.py, Python 3.12, Windows
  • My local environment blocked the pydantic_core DLL (Windows Application Control), so the repro stubs app.modules.facts_check.llm_processing and web_search. The pipeline function itself is unchanged.
Expected Behavior

If run_fact_verifier_sdk returns a non-success status, run_fact_check_pipeline returns that message as the error, and fact_check.py reports status: "error" with error_from: "fact_checking".

Impact

Medium. A transient LLM failure turns into a false "no facts found" success, which users can't tell apart from a real result.

Possible fix (for discussion)
if final.get("status") != "success":
    return [], final.get("message", "Fact verification failed.")

Add a regression test where the verifier returns an error and the pipeline returns that error.

Checklist
  • I searched existing issues and PRs for verifier, rate limit, Groq error and fact check empty. Nothing matched this bug. PRs #148 and #150 touch the claim-extraction check only.

AI disclosure: I used Claude (Anthropic) to help find this bug and write the reproduction script.

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.