Skip to content

fix: preserve converted PDF URL when hydrating parse results - #117

Draft
Kayvan-Zahiri wants to merge 1 commit into
reductoai:mainfrom
Kayvan-Zahiri:codex/preserve-converted-pdf-url
Draft

Kayvan-Zahiri wants to merge 1 commit into
reductoai:mainfrom
Kayvan-Zahiri:codex/preserve-converted-pdf-url

Conversation

@Kayvan-Zahiri

@Kayvan-Zahiri Kayvan-Zahiri commented Oct 18, 2026 •

Copy link
Copy Markdown

When handle_url_response() hydrates a URL result, it reconstructs FullParseResponse without copying pdf_url. The same helper preserves that field for inline results. A caller therefore loses the converted PDF link depending on response size.

Copy response.pdf_url into the hydrated response. Four offline regressions compare inline and URL results with a signed PDF URL and with no URL, also checking that hydration retains the document text and other existing helper metadata.

Validation:

  • Before: 1 regression fails and 3 controls pass; afterward all 4 pass.
  • Pydantic 2 offline suite: 457 passed, 2 skipped.
  • Separate Pydantic 1 offline suite: 450 passed, 9 skipped. The helper already uses Pydantic 2 APIs; the 4 new helper cases are explicitly skipped under Pydantic 1.
  • Excluded tests/api_resources (requires the API mock server) and the default-excluded live tests/e2e. No live API or storage requests.
  • Repository Ruff lint, changed-file formatting, mypy, pyright, and git diff --check pass.
  • Broader mypy and source/test pyright retain dependency/runtime typing failures reproduced with the original helper (4 and 22 respectively). No generated runtime changes.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant