Fix /pdf processing flow: use parsed arxiv_id, restore sync processing, and return paper_id#1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
_handle_pdf_commandsometimes returnedNoneand usedargs[1]directly for the arXiv id, which mis-parsed arguments when flags were present./pdfflow should provide immediate database updates and apaper_idfor predictable behavior in synchronous CLI usage.Description
arxiv_idvariable (arxiv_id_arg = arxiv_id) instead of readingargs[1]directly to avoid mis-parsing flags and positional arguments.pdf_processing_methodis notGeminiAsync, performingtools.extract_text_from_pdf_gemini, saving the blob viatools.save_text_blob, preparingself.pending_pdf_context, updatingprocessed_timestampandstatus, and returning the createdpaper_id.pdf_processing_method = "GeminiAsync"and ensure the function returns thepaper_idin the async path as well.error_extraction,error_blob,error_processing,error_file_not_found) and improve logging/error handling around synchronous processing.Testing
pytest -qafter the changes, and the suite passed with27 passed, 1 skipped./pdfpreviously triggered are now passing under the synchronous path.Codex Task