Repository navigation
Conversation
…uccess
run_fact_check_pipeline returned final.get("verifications", []) without
looking at the status of run_fact_verifier_sdk. When the verifier failed
(for example a Groq error or rate limit) it returns an error dict with no
"verifications" key, so the pipeline answered ([], None) and the route
reported status "success" with an empty fact list.
Return the verifier's message as the error instead, falling back to a
generic one, so the fact_check node reports the failure.
Fixes AOSSIE-Org#191
Signed-off-by: mayank <mayankkumars584@gmail.com>
|
No actionable comments were generated in the recent review. WalkthroughThe fact-check pipeline now returns an error when fact verification fails. Tests cover verifier responses with and without a message and verify node-level error reporting. ChangesFact Verification Error Handling
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested labels: Suggested reviewers: Merge Risk:
|
Link your account with GitcordThanks for opening this PR, @mac146! To receive Discord notifications and contributor tracking for this organization:
Once linked, Gitcord can notify you about reviews, merges, and more. — Posted by Gitcord |
Fixes #191
Problem
run_fact_check_pipelinenever looked at the status returned byrun_fact_verifier_sdk. When the verifier fails (a Groq error or rate limit), it returns{"status": "error", "error_from": "fact_verification", "message": ...}with noverificationskey. The pipeline turned that into([], None), sorun_fact_checkreturnedstatus: "success"with an empty fact list. The user could not tell a failed check from one that found nothing.Change
backend/app/utils/fact_check_utils.py: if the verifier's status is not"success", return([], message). The message is the verifier's own, or "Fact verification failed." if it gave none. The existingrun_fact_checknode already turns an error message into an error response, so it needed no change.backend/tests/test_fact_check.py: three tests. The pipeline returns the verifier's message. It uses the generic message when none is given. The node reports the failure as an error.The claim-extraction check at the top of the function (
state.get("status")) is a separate problem, which the issue leaves to #148 and #150, so I did not touch it.Tests
The three new tests fail before the change and pass after it.
pytest --covinbackend/: 231 passed, coverage 99.68%. One test,test_routes_are_mounted_under_api, fails here with and without my change. I ran it with a newer FastAPI thanuv.lockpins, so I believe it is unrelated.Summary by CodeRabbit