fix: address code review feedback - restrict terminal step check to success only, add test assertions

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-27 16:39:32 +00:00
parent 2c55f076be
commit 4fdb1b8d85
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ def get_files_processing_status(db: Session, file_ids: List[int]) -> Dict[int, D
status = "completed"
else:
status = "pending"
elif terminal_step is not None and terminal_step.status in ("success", "skipped"):
elif terminal_step is not None and terminal_step.status == "success":
# Terminal step succeeded but some intermediate steps are
# still "pending" (dynamic pipeline artifacts). The file
# is effectively complete.
+1 -1
View File
@@ -271,7 +271,7 @@ def get_file_overall_status(db: Session, file_id: int) -> Dict:
status = "completed"
else:
status = "pending"
elif terminal_step_obj is not None and terminal_step_obj.status in ("success", "skipped"):
elif terminal_step_obj is not None and terminal_step_obj.status == "success":
# The terminal step succeeded but some intermediate steps are still
# "pending" (e.g. check_for_duplicates logged without file_id, or
# extract_text not marked when OCR path was taken). The pipeline
+2
View File
@@ -339,6 +339,8 @@ class TestStepManager:
# Terminal step hasn't run yet, so file should remain pending
assert status["status"] == "pending"
assert status["has_errors"] is False
assert status["completed_steps"] == 3
def test_get_file_overall_status_failed(self, db_session: Session):
"""Test overall status for a file with failed steps."""