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

Đang mở Phù hợp với người mới
#191 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
83/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, typescript
Lĩnh vực
ai, backend

Hướng nghiên cứu

Bắt đầu tại backend/app/utils/fact_check_utils.py và theo dõi cách run_fact_check_pipeline xử lý kết quả từ run_fact_verifier_sdk. Kiểm tra cách fact_check.py báo lỗi pipeline, sau đó thêm một kiểm thử hồi quy cho lỗi verifier, chẳng hạn như giới hạn tốc độ Groq được mô tả ở đây. Hoàn tất khi pipeline trả về lỗi của verifier và route báo thất bại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
58
Fork
90
Merge trung bình
11 giờ 51 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AOSSIE-Org/Perspective

Tất cả issue của AOSSIE-Org/Perspective

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.