Skip to content

Commit 17eb8a9

Browse files
Zhaoyang-Chuclaude
andcommitted
fix(backfill): unpack classify_papers tuple return value
_run_incremental_backfill was assigning the (relevant, failed_ids) tuple directly to `relevant`, causing AttributeError in create_review_issues. Also added proper retry/give-up handling for backfill LLM failures. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0bc8240 commit 17eb8a9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

automation/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,18 @@ def _run_incremental_backfill(cfg, state, owner: str, repo: str) -> None:
254254
if new_papers:
255255
pwc.enrich_papers(new_papers)
256256
meta_enricher.enrich_papers(new_papers)
257-
relevant = classify_papers(
257+
relevant, failed_ids = classify_papers(
258258
new_papers,
259259
categories=cfg["categories"],
260260
tags=cfg["tags"],
261261
)
262-
state_mgr.mark_processed(state, [p["arxiv_id"] for p in new_papers])
262+
# Mark successfully classified as processed; failed ones stay out for retry
263+
succeeded_ids = [p["arxiv_id"] for p in new_papers if p.get("arxiv_id") not in failed_ids]
264+
state_mgr.mark_processed(state, succeeded_ids)
265+
if failed_ids:
266+
_, give_up_ids = state_mgr.add_failed_classifications(state, failed_ids)
267+
if give_up_ids:
268+
state_mgr.mark_processed(state, give_up_ids)
263269

264270
if relevant:
265271
batch_label = f"backfill:{cursor}..{chunk_end}"

0 commit comments

Comments
 (0)