Skip to content

fix: make PDF page limit configurable - #98

Merged
suguanYang merged 1 commit into
stagingfrom
fix/wangbinqi/configurable-pdf-page-limit
May 19, 2026
Merged

suguanYang merged 1 commit into
stagingfrom
fix/wangbinqi/configurable-pdf-page-limit

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • Replace the hardcoded worker PDF page cap with MAX_PDF_PAGE_LIMIT, defaulting to the existing 600-page behavior.
  • Document MAX_PDF_PAGE_LIMIT=600 in API and worker env examples.
  • Add a worker contract test proving an over-limit PDF job fails with INVALID_ARGUMENT before result packaging runs.

Verification

  • uv run pytest apps/worker/tests/contract/test_parse_task_contract.py::test_should_reject_pdf_when_page_count_exceeds_configured_limit -q
  • uv run pytest apps/worker/tests/contract/test_parse_task_contract.py -q
  • uv run pytest apps/worker/tests/contract -q
  • uv run ruff check
  • uv run pyright
  • git diff --check
  • MAX_PDF_PAGE_LIMIT=123 ... uv run python config smoke confirmed env override is read as 123
  • codex review --uncommitted --title "Make PDF page limit configurable"

@suguanYang
suguanYang force-pushed the fix/wangbinqi/configurable-pdf-page-limit branch from 98d687e to 27a3170 Compare May 19, 2026 08:40
@suguanYang
suguanYang merged commit 2234234 into staging May 19, 2026
9 checks passed
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