Skip to content

fix(pdf): make the render scale and page ceiling reachable from generate() - #1301

Merged
murdore merged 1 commit into
releasefrom
fix/pdf-scale-reachable
Aug 7, 2026
Merged

murdore merged 1 commit into
releasefrom
fix/pdf-scale-reachable

Conversation

@murdore

@murdore murdore commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #297 · leaves #302 open with a reason

The gap

PDF_LIMITS.DEFAULT_SCALE was lowered to 1.5 to cut the image-fallback memory cost. It never took effect.

The only PDF→image call the product actually makes hardcoded scale: 2.0 and maxPages: 20, and GenerateOptions.pdfOptions exposed neither knob — so no caller could reach the new default either. The 776MB-for-100-pages figure in the issue was unchanged in practice for every provider without native PDF support (Azure, Mistral, Ollama, …).

The constant was lowered; the product kept rendering at 2.0.

The fix

Verified against the real path by intercepting the converter:

request reaches converter
default {scale: 1.5, maxPages: 20}
pdfOptions: { scale: 0.8 } {scale: 0.8, maxPages: 20}
pdfOptions: { maxPages: 3 } {scale: 1.5, maxPages: 3}

Both knobs are now settable per request and carried through the input.pdfFiles and input.content paths alike.

Silent truncation also fixed. Pages past maxPages were dropped without a word — the model answered from a partial document as though it had the whole thing. That now warns with the page counts and how to raise the ceiling.

The root cause of the knobs stopping one frame short: convertMultimodalToProviderFormat held a fourth inline copy of the PDF entry shape. It now uses MultimodalPdfEntry (#309).

What I did not do — #302

PDFProcessor.convertToImagesStream is still reachable from nowhere (grep: zero references outside its own file and the docs). I left it that way deliberately.

Wiring it into this call site would not lower peak memory: buildMultimodalMessagesArray collects every page into one images array before building the message, so the pages end up resident regardless of how they arrive. Making streaming pay off needs a streaming-aware message pipeline, which is a redesign rather than a call-site swap. Claiming #302 here would have been closing it on paper.

Verification

Passed: 270   Failed: 0
✓ MessageBuilder #297: the real conversion path honors the default scale and caller overrides

Confirmed the new test catches a regression — restoring the hardcoded scale: 2.0 makes it report ✗ and exit non-zero. tsc --noEmit --strict clean.

Summary by CodeRabbit

  • New Features

    • Added PDF fallback settings to control image-rendering scale and the maximum number of converted pages.
    • These options are available for standard generation, text generation, and streaming workflows.
    • Custom settings can be provided per request, with sensible defaults applied automatically.
  • Bug Fixes

    • PDF conversions now consistently honor configured rendering settings.
    • Invalid page-limit values are rejected with a clear error.
    • Warnings are shown when page limits truncate documents or individual pages cannot be rendered.

Copilot AI lite review requested due to automatic review settings August 7, 2026 11:01
@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Single Commit Policy - COMPLIANT

Status: Policy requirements met • 1 commit • Valid format • Ready for merge

📊 View validation details

📝 Commit Details

  • Hash: eaed8dd33f83e4c90d9a7a71fa6ce1b90b006b50
  • Message: fix(pdf): make the render scale and page ceiling reachable from generate()
  • Author: Sachin Sharma

✅ Validation Results

  • Single commit requirement met
  • No merge commits in branch
  • Semantic commit message format verified
  • Ready for squash merge to release branch

🤖 Automated validation by NeuroLink Single Commit Enforcement

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: beaa9148-07dc-4fc0-927a-e1bda6f98fad

📥 Commits

Reviewing files that changed from the base of the PR and between f7b3c8f and eaed8dd.

📒 Files selected for processing (4)
  • src/lib/types/generate.ts
  • src/lib/utils/messageBuilder.ts
  • src/lib/utils/pdfProcessor.ts
  • test/continuous-test-suite-bugfixes.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/utils/messageBuilder.ts
  • test/continuous-test-suite-bugfixes.ts

📝 Walkthrough

Walkthrough

PDF fallback rendering now supports per-request scale and maxPages settings across public types and message construction. Conversion applies configured defaults, validates page limits, warns on truncation and page failures, and includes regression coverage.

Changes

PDF fallback controls

Layer / File(s) Summary
PDF option contracts
src/lib/types/file.ts, src/lib/types/generate.ts, src/lib/types/stream.ts
Public PDF types now define optional scale and maxPages settings.
PDF option propagation
src/lib/utils/messageBuilder.ts
Explicit and advanced-content PDF entries preserve the new settings. The conversion function uses the shared MultimodalPdfEntry type.
PDF conversion and validation
src/lib/utils/messageBuilder.ts, src/lib/utils/pdfProcessor.ts
Conversion applies per-file settings or PDF_LIMITS defaults. Page limits are validated for buffered and streaming conversion. Conversion warns about truncation and page-render failures.
PDF fallback regression coverage
test/continuous-test-suite-bugfixes.ts
The test verifies default settings, caller overrides, invalid page limits, and converter restoration.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • juspay/neurolink#1195: Extends PDF image-fallback configuration in the same types and conversion path.
  • juspay/neurolink#1294: Modifies MultimodalPdfEntry, messageBuilder.ts, and pdfProcessor.ts for PDF input handling and validation.

Suggested reviewers: pdogra1299

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant messageBuilder
  participant pdfProcessor
  participant Provider
  Caller->>messageBuilder: submit PDF with scale and maxPages
  messageBuilder->>pdfProcessor: validate and convert PDF pages
  pdfProcessor-->>messageBuilder: return page images
  messageBuilder->>Provider: send provider-formatted content
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR covers scale defaults and validation, but the provided changes do not show memory-estimate logging or scale-memory documentation required by [#297]. Add pre-processing memory-estimate logging, document scale-related memory impact, and verify nullish coalescing and scale validation tests for [#297].
Out of Scope Changes check ⚠️ Warning The PR adds StreamOptions PDF fields even though streaming support is explicitly deferred to issue #302 and is outside the linked issue scope. Remove the StreamOptions changes or link them to a separate issue that implements streaming PDF option support.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes exposing PDF render scale and page limits through generate().
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pdf-scale-reachable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/continuous-test-suite-bugfixes.ts (1)

1830-1881: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the advanced input.content PDF path.

This test only calls input.pdfFiles. Add a case that supplies a PDF in input.content with pdfOptions. That path constructs MultimodalPdfEntry separately in src/lib/utils/messageBuilder.ts Line 1879.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/continuous-test-suite-bugfixes.ts` around lines 1830 - 1881, The test
case in “MessageBuilder `#297`: the real conversion path honors the default scale
and caller overrides” only exercises input.pdfFiles; extend it to also invoke
buildMultimodalMessagesArray with a PDF supplied through input.content and
pdfOptions, then assert the captured scale/maxPages values so the separate
MultimodalPdfEntry construction path is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/utils/messageBuilder.ts`:
- Around line 2403-2413: Update the PDF processing flow around
enforceAggregatePdfLimits() to retain its resolved page count before conversion,
including when input.content pageCount is null because metadata.pages is
omitted. Use that resolved value in the requestedPages check for the truncation
warning, while preserving the existing warning message and behavior for
non-truncated conversions.

---

Nitpick comments:
In `@test/continuous-test-suite-bugfixes.ts`:
- Around line 1830-1881: The test case in “MessageBuilder `#297`: the real
conversion path honors the default scale and caller overrides” only exercises
input.pdfFiles; extend it to also invoke buildMultimodalMessagesArray with a PDF
supplied through input.content and pdfOptions, then assert the captured
scale/maxPages values so the separate MultimodalPdfEntry construction path is
covered.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8450db66-d93b-4d21-acdc-8d9c4e8d7cdd

📥 Commits

Reviewing files that changed from the base of the PR and between ce338a1 and f7b3c8f.

📒 Files selected for processing (5)
  • src/lib/types/file.ts
  • src/lib/types/generate.ts
  • src/lib/types/stream.ts
  • src/lib/utils/messageBuilder.ts
  • test/continuous-test-suite-bugfixes.ts

Comment thread src/lib/utils/messageBuilder.ts Outdated
Comment on lines +2403 to +2413
const requestedPages = pdf.pageCount;
if (
typeof requestedPages === "number" &&
requestedPages > conversionResult.pageCount
) {
logger.warn(
`[PDF→Image] ${safeBasename(pdf.filename)} has ${requestedPages} pages but only ` +
`${conversionResult.pageCount} were converted (maxPages limit). The model will not ` +
`see the remaining pages — raise pdfOptions.maxPages or split the document.`,
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the resolved page count for the truncation warning.

For input.content, pageCount is null when metadata.pages is omitted. enforceAggregatePdfLimits() resolves the actual count from the PDF bytes, but does not retain it. Line 2405 then skips this warning when conversion truncates the document at maxPages.

Return or store the resolved page count before conversion. Use that value for this warning.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/utils/messageBuilder.ts` around lines 2403 - 2413, Update the PDF
processing flow around enforceAggregatePdfLimits() to retain its resolved page
count before conversion, including when input.content pageCount is null because
metadata.pages is omitted. Use that resolved value in the requestedPages check
for the truncation warning, while preserving the existing warning message and
behavior for non-truncated conversions.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the PDF→image fallback’s render scale and maxPages configurable from generate()/stream() options, ensuring PDF_LIMITS.DEFAULT_SCALE and the page ceiling are actually reachable in the real conversion path, and adds a warning when a PDF is truncated by the page ceiling.

Changes:

  • Thread pdfOptions.scale and pdfOptions.maxPages through both input.pdfFiles and input.content paths into the PDF→image conversion call.
  • Replace the inline PDF entry shape in convertMultimodalToProviderFormat with the canonical MultimodalPdfEntry.
  • Add a regression test verifying the real conversion path receives defaults and per-request overrides.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/continuous-test-suite-bugfixes.ts Adds a regression test to confirm the real PDF→image converter receives default and overridden scale/maxPages.
src/lib/utils/messageBuilder.ts Threads scale/page-ceiling options into the conversion call and warns when documents are truncated by maxPages.
src/lib/types/stream.ts Exposes pdfOptions.scale and pdfOptions.maxPages on streaming options.
src/lib/types/generate.ts Exposes pdfOptions.scale and pdfOptions.maxPages on generate options (but needs alignment with TextGenerationOptions).
src/lib/types/file.ts Extends MultimodalPdfEntry to carry scale/maxPages through the message-building pipeline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2381 to 2383
const conversionResult = await PDFImageConverter.convertToImages(
pdf.buffer,
{
Comment on lines +2400 to +2413
// The renderer stops at maxPages, so a longer document is silently
// truncated — say so rather than letting the model answer from a
// partial document as though it had the whole thing.
const requestedPages = pdf.pageCount;
if (
typeof requestedPages === "number" &&
requestedPages > conversionResult.pageCount
) {
logger.warn(
`[PDF→Image] ${safeBasename(pdf.filename)} has ${requestedPages} pages but only ` +
`${conversionResult.pageCount} were converted (maxPages limit). The model will not ` +
`see the remaining pages — raise pdfOptions.maxPages or split the document.`,
);
}
Comment thread test/continuous-test-suite-bugfixes.ts Outdated
Comment on lines +1841 to +1851
const original =
PDFImageConverter.convertToImages.bind(PDFImageConverter);
(
PDFImageConverter as unknown as Record<string, unknown>
).convertToImages = async (
buffer: Buffer,
opts: { scale?: number; maxPages?: number },
) => {
seen.push({ scale: opts?.scale, maxPages: opts?.maxPages });
return original(buffer, opts);
};
Comment thread src/lib/types/generate.ts
Comment on lines 152 to +158
/** PDF processing options (#258). */
pdfOptions?: {
/** Password for an encrypted PDF (image-conversion fallback path). */
password?: string;
/** Max rendered-canvas pixels per page (#260 memory guard); oversized pages auto-downscale. */
maxCanvasPixels?: number;
/**
@Tara-ag

Tara-ag commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Summary for PR #1301

Decision: ✅ APPROVED

Summary of Changes

This PR adds two new optional configuration options for PDF image fallback processing (#297):

  • scale: Render scale for PDF-to-image conversion (range 0.1-10, default 1.5)
  • maxPages: Maximum pages to convert (default 20)

Files Changed:

  1. src/lib/types/file.ts - Added scale and maxPages to MultimodalPdfEntry type
  2. src/lib/types/generate.ts - Added same options to GenerateOptions
  3. src/lib/types/stream.ts - Added same options to StreamOptions
  4. src/lib/utils/messageBuilder.ts - Propagated options through call chain, added truncation warning
  5. test/continuous-test-suite-bugfixes.ts - Added comprehensive test validating the changes

Impact Analysis

  • Blast Radius: ~113 additional files affected (mostly indirect type dependencies)
  • Breaking Changes: None - all new fields are optional
  • Execution Flows: Touches PDF processing path in message building
  • Architectural Hotspots: Changes to well-tested core utilities

Key Improvements

  1. Memory Optimization: Lowered default scale from 2.0 to 1.5 reduces per-page memory by ~44% (from ~776MB to ~440MB for 100-page doc)
  2. User Control: Callers can now adjust sharpness vs memory tradeoff
  3. Safety Guard: maxPages prevents token overflow from very long documents
  4. Transparency: Warning logged when documents exceed page limit
  5. Type Safety: Uses canonical MultimodalPdfEntry type instead of inline definition

Verification

  • ✅ All type definitions properly updated
  • ✅ Options propagate correctly through call chain
  • ✅ Defaults match expected values (1.5 scale, 20 maxPages)
  • ✅ Test validates defaults and overrides work correctly
  • ✅ No hardcoded secrets or credentials
  • ✅ No breaking API changes
  • ✅ CLAUDE.md Critical Rules respected (dynamic imports, backward compatibility maintained)

Recommendation

Safe to merge - This is a non-breaking enhancement that addresses a real issue with PDF processing memory costs while giving users control over quality vs resource usage. The implementation is clean, well-tested, and follows existing patterns.

…ate()

PDF_LIMITS.DEFAULT_SCALE was lowered to 1.5 to cut the image-fallback memory
cost, but the only PDF-to-image call the product actually makes hardcoded
`scale: 2.0` and `maxPages: 20`, so nothing downstream ever saw the new
default. GenerateOptions.pdfOptions exposed neither knob either, so no caller
could reach it. The 776MB-for-100-pages figure in #297 was unchanged in
practice for every provider without native PDF support.

The conversion now defaults to PDF_LIMITS.DEFAULT_SCALE / DEFAULT_MAX_PAGES
and both are settable per request via pdfOptions.scale / pdfOptions.maxPages,
carried through the input.pdfFiles and input.content paths alike. Verified
against the real path: default {scale:1.5,maxPages:20}, and an override of
either reaches the converter.

Truncation is no longer silent: when a document has more pages than maxPages,
the pages past the ceiling were dropped without a word and the model answered
from a partial document as though it were whole. That now warns.

convertMultimodalToProviderFormat took a fourth inline copy of the PDF entry
shape, which is what stopped the knobs one frame short of the conversion; it
now uses MultimodalPdfEntry (#309).

Not addressed here: PDFProcessor.convertToImagesStream (#302) is still
reachable from nowhere. Wiring it into this path would not lower peak memory
on its own, because the message builder collects every page into one array
before building the message — that needs a streaming-aware pipeline, not a
call-site swap, so it stays open.

Closes #297
@murdore

murdore commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

All five review findings addressed — all were valid.

Finding Fix
Truncation warning never fires on input.content (CodeRabbit) Correct, and it was the common case: pdf.pageCount is null whenever metadata.pages is omitted, so the comparison could not fire there at all. Now keyed on the cap being reached, which is unambiguous and works on both paths. Verified: maxPages:1 → warns, maxPages:50 → silent.
Warning would misblame maxPages for render failures (Copilot) Same fix resolves it — per-page failures land in conversionResult.errors (#294) and now get their own distinct warning naming the failed pages.
maxPages unvalidated (Copilot) Real: 0/-1/2.5 reached the renderer and surfaced as a misleading "PDF has 0 pages". Validated alongside scale in validateImageConversionInput, so every caller benefits, not just this path. Verified all three rejected with Invalid maxPages: ….
Test restored a bound function (Copilot) Correct — it would have left the class carrying a different function identity for every later test. Now keeps the unbound original for restoration and a separate bound copy for invocation.
TextGenerationOptions.pdfOptions left behind (Copilot) Correct; it still had only password/maxCanvasPixels. Brought to parity.
Passed: 270   Failed: 0

The test now also asserts the validation rejections, so a regression on any of 0/-1/2.5 fails the suite.

@murdore
murdore force-pushed the fix/pdf-scale-reachable branch from f7b3c8f to eaed8dd Compare August 7, 2026 19:41
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@Tara-ag

Tara-ag commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Summary

Decision: APPROVED ✅

This PR successfully addresses issue #297 by making PDF rendering scale and page limits actually configurable from generate() calls.

What was fixed:

  • The bug where PDF_LIMITS.DEFAULT_SCALE (1.5) never took effect because hardcoded values (scale: 2.0, maxPages: 20) were being used
  • Added scale and maxPages properties to MultimodalPdfEntry type
  • Updated GenerateOptions.pdfOptions and StreamOptions.pdfOptions
  • Modified convertMultimodalToProviderFormat to use proper defaults instead of hardcoded values
  • Added validation to reject invalid maxPages values (0, -1, non-integers)
  • Added warning logs when truncation occurs

Impact Analysis:

  • Blast radius: 68 nodes changed, 500 nodes impacted within 2 hops
  • Affected files: messageBuilder.ts, pdfProcessor.ts (contained in PDF processing pipeline)
  • No breaking changes: Only added optional parameters
  • Backward compatible: Existing callers continue to work with new defaults

Quality Checks Passed:

✅ Security: No secrets or vulnerabilities found
✅ Type Safety: Proper types, no any abuse
✅ Correctness: Logic verified, edge cases handled
✅ Testing: New tests added for all scenarios including edge cases
✅ Documentation: JSDoc comments added for new options
✅ CLAUDE.md Rules: Rule 5 (backward compatibility) satisfied
✅ CI/CD: ESLint + Prettier + tsc already enforce format/type rules

Test Coverage:

  • MessageBuilder #297: Verifies defaults (1.5, 20), custom overrides, and rejection of invalid values
  • PDFProcessor #297: Verifies memory logging before conversion

Files Changed:

  1. src/lib/types/file.ts - Type additions
  2. src/lib/types/generate.ts - GenerateOptions updates
  3. src/lib/types/stream.ts - StreamOptions updates
  4. src/lib/utils/messageBuilder.ts - Core implementation
  5. src/lib/utils/pdfProcessor.ts - Validation and defaults
  6. test/continuous-test-suite-bugfixes.ts - New tests

All checks passed. Ready to merge. 🚀

@Tara-ag

Tara-ag commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Approved — This PR makes PDF render scale (1.5) and page ceiling (20) configurable via GenerateOptions.pdfOptions and StreamOptions.pdfOptions, fixing #297.

Summary of changes:

  • Added scale?: number and maxPages?: number optional fields to MultimodalPdfEntry type
  • Updated GenerateOptions and StreamOptions to accept pdfOptions: { scale, maxPages }
  • Modified messageBuilder.ts to pass these through to the PDF image converter
  • Added validation in pdfProcessor.ts to reject invalid maxPages values (must be whole number ≥ 1)
  • Added test coverage for defaults, custom values, and error cases

Impact assessment:

  • ~68 nodes directly affected, ~500 within 3 hops
  • Changes are purely additive/optional — no breaking changes
  • Backward compatible: existing callers get sensible defaults (scale=1.5, maxPages=20)
  • No impact on non-PDF processing paths

Key validations performed:

  1. ✅ Type safety - all types properly defined in canonical location
  2. ✅ No hardcoded secrets or credentials
  3. ✅ Input validation - invalid maxPages rejected with clear error
  4. ✅ Default behavior verified - matches documented DEFAULT_SCALE and DEFAULT_MAX_PAGES
  5. ✅ Edge cases covered - rejects 0, negative numbers, decimals like 2.5
  6. ✅ Test coverage - validates defaults, custom values, and error scenarios
  7. ✅ Backward compatibility - all new fields are optional with sensible defaults
  8. ✅ No CLAUDE.md Critical Rule violations (this is a PDF rendering fix, not an architectural change)

Recommendation: Safe to merge. The implementation correctly exposes previously hardcoded rendering knobs as configurable options, improving memory management for large PDFs while maintaining backward compatibility.

@Tara-ag

Tara-ag commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

👍 Approved — No issues found. The implementation correctly exposes PDF render scale and page ceiling as configurable options while maintaining backward compatibility. All validations, tests, and documentation are in place.

@murdore
murdore merged commit a5c9e4b into release Aug 7, 2026
16 checks passed
@murdore
murdore deleted the fix/pdf-scale-reachable branch August 7, 2026 19:58
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 10.10.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF-009: High Memory Default Scale

3 participants