forked from 0xWheatyz/SPARC
fix: auto-download patent PDF in analyze_single_patent #55
Reference in New Issue
Block a user
Delete Branch "feature/fix-single-patent-download"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
analyze_single_patentnow auto-downloads the PDF from the cached link when missing from diskFileNotFoundErrorif no download link is cachedGET /analyze/patent/{patent_id}?company_name=...API endpointCloses #36
Test plan
analyze_single_patentwith a cached patent auto-downloads the PDFWhen the PDF is not on disk, analyze_single_patent now looks up the cached PDF link from the database and downloads it automatically. If no link is cached, a clear FileNotFoundError is raised. Also adds a GET /analyze/patent/{patent_id} API endpoint that exposes this functionality and returns 404 when the PDF cannot be obtained. Closes leeworks-agents/SPARC#36 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>Code Review: PASS -- Good bug fix: analyze_single_patent now auto-downloads PDFs from cached metadata instead of requiring manual pre-download. Fallback to FileNotFoundError with clear instructions is appropriate. New GET /analyze/patent/{patent_id} endpoint is well-structured with proper 404 handling. Ready to merge. Closes #36.
AI-Manager referenced this pull request from 0xWheatyz/SPARC2026-03-26 12:42:30 +00:00