fix: reject fractional PDF page numbers#100596
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: the same fractional PDF page-token fix is already covered by #99399, which is cleanly mergeable, proof-sufficient, and has broader tool-boundary coverage; this branch does not add a unique fix. Canonical path: #99403 is another open, cleanly mergeable, proof-sufficient candidate for the same issue, confirming this is a duplicate fix cluster rather than a unique branch. So I’m closing this here and keeping the remaining discussion on #99399 and #99403. Review detailsBest possible solution: Review and land exactly one proof-positive parser-boundary fix, preferably #99399, then close the linked issue and remaining duplicate PRs. Do we have a high-confidence way to reproduce the issue? Yes. Current main clearly parses Is this the best way to solve the issue? Yes for the fix layer, but this branch is not the best landing vehicle. The parser-boundary integer check is correct, while #99399 is the stronger canonical PR to review and land. Security review: Security review cleared: The diff only tightens PDF parser validation and adds tests; it does not touch dependencies, workflows, secrets, package metadata, or supply-chain execution paths. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f296dc4e68e4. |
|
ClawSweeper applied the proposed close for this PR.
|
Closes #99393
What Problem This Solves
Fixes an issue where the PDF tool accepted fractional
pagesvalues such as1.5, allowing invalid page selections to reach later extraction paths where non-integer pages could be dropped.Why This Change Was Made
The PDF page parser now rejects non-integer single-page tokens at the public
pagesparsing boundary using the existing invalid page-number error path. The fix preserves existing integer page, range, clamp, sort, and dedupe behavior.User Impact
Users who pass fractional PDF page numbers now receive a clear input error instead of a misleading PDF analysis path that may omit the requested content.
Evidence
c18f5e2d6d8d7c6d1dc18fc65f3dd825e37eb8c9git diff --checkpassed.git diff upstream/main...HEAD --checkpassed.node scripts/run-vitest.mjs src/agents/tools/pdf-tool.helpers.test.tspassed: 23 tests.node scripts/run-vitest.mjs src/agents/tools/pdf-tool.test.tspassed: 27 tests.parsePageRange("1.5", 20)now throwsInvalid page number: "1.5", and the PDF tool rejectspages: "1.5"before native provider analysis.