Skip to content

fix(ingestion): pass the MinerU timeout to the MonkeyOCR file_parse upload - #21930

Merged
wangq8 merged 3 commits into
infiniflow:mainfrom
ccclucky:fix/monkeyocr-stream-parse-arg
Nov 4, 2026
Merged

wangq8 merged 3 commits into
infiniflow:mainfrom
ccclucky:fix/monkeyocr-stream-parse-arg

Conversation

@ccclucky

@ccclucky ccclucky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

main currently fails to compile internal/ingestion/component:

internal/ingestion/component/pdf_vision_dispatch.go:844:114:
not enough arguments in call to mineruStreamParse

Root cause: #21832 added a tenth timeout parameter to mineruStreamParse and updated the MinerU call site in dispatchMinerUPDF, but the dispatchMonkeyOCRPDF call site introduced earlier by #20469 still calls the function with nine arguments. The two PRs were merged hours apart into the same file and the gap slipped through: the sep-tests runs on 2c4bbbc72 failed with a runner checkout error (RPC failed; curl 92), so the break never surfaced on CI — it only shows up when compiling the package locally.

Every build that pulls internal/ingestion/component (the ingestor mode and anything depending on it) is broken on current main.

Fix

Resolve the timeout for the MonkeyOCR branch with the same mineruRequestTimeout(setup, apiConfig) the MinerU branches use, and pass it to mineruStreamParse. The MonkeyOCR adapter fronts the same MinerU-compatible /file_parse API, so:

  • the default stays the pre-merge 30-minute budget (mineruStreamParse used to hard-code it),
  • no new config surface: the dispatch already mirrors MinerU keys (monkeyocr_parse_method, monkeyocr_backend, monkeyocr_server_url), so sharing the timeout resolution follows the same pattern.

If maintainers prefer a dedicated monkeyocr_timeout key for this dispatch, that can be a follow-up.

Verification

  • Broken: bash build.sh --test ./internal/ingestion/component/ on pristine 2c4bbbc72 fails at compile with not enough arguments in call to mineruStreamParse.
  • Fixed: the same command (local ORT-relaxed link flags) compiles and the whole package passes, ok 17.564s, including TestDispatch_PDFMonkeyOCRMarkdown_UsesFileParseEndpoint — the existing test that exercises exactly this dispatchMonkeyOCRPDF → mineruStreamParse path.

@ccclucky

ccclucky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c674b553-a9e3-4a55-89dd-a95c08512cf1
Commits

Reviewing files that changed from the base of the PR and between 4e83cad and efdfe1c.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The PDF dispatch path now resolves the MinerU-compatible stream request timeout from parser setup and API configuration, then passes it to mineruStreamParse. Formula and table extraction remain enabled.

Changes: MinerU stream timeout

Layer / File(s) Summary
Resolve and pass request timeout
internal/ingestion/component/pdf_vision_dispatch.go
dispatchMonkeyOCRPDF resolves the request timeout and passes it to mineruStreamParse. Formula and table extraction remain enabled.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested labels: go, parsing, integration

Suggested reviewers: souravrajvi0

Merge Risk: Minimal · previous review 518a0

The timeout fix is mergeable with no identified blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the change: it passes the MinerU timeout to the MonkeyOCR file_parse upload. The raw summary confirms that dispatchMonkeyOCRPDF now resolves the timeout with mineruRequestTimeout(setup…
Description check Passed The description explains the problem, the root cause, the fix, and the verification steps. It does not follow the repository template exactly: the template asks for a Summary section with a brief desc…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: it passes the MinerU timeout to the MonkeyOCR file_parse upload. The raw summary confirms that dispatchMonkeyOCRPDF now resolves the timeout with mineruRequestTimeout(setup, apiConfig) and passes it to mineruStreamParse. The title is specific and matches the main change, so it passes. The title uses the conventional fix(ingestion) prefix and is concise, at 74 characters.

Full details: Description check

Explanation

The description explains the problem, the root cause, the fix, and the verification steps. It does not follow the repository template exactly: the template asks for a Summary section with a brief description of the purpose and background. The author uses Problem and Fix headings instead, and the Problem section gives the background. The required information is present, so the check passes. The author could add a heading named Summary to match the template.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the stream timeout,
Then watches parsing hop along.
With tables and formulas still switched on,
It nibbles greens beside the logs.
The PDF trail flows on.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e6a5ab4-04e7-4ed6-8cef-847ab812a5ec
Commits

Reviewing files that changed from the base of the PR and between 2c4bbbc and 518a09e.

Files selected for processing: 1
  • internal/ingestion/component/pdf_vision_dispatch.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Harsh23Kashyap Harsh23Kashyap left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Checked at 518a09e (build + tests executed locally, CGO_ENABLED=0).

Verified: internal/ingestion/component compiles clean at this head and the MinerU/timeout/stream tests pass. This fixes the same main break as #21929 - main (2c4bbbc) does not compile because the MonkeyOCR stream call is missing the timeout argument added in #21832.

Heads-up on the overlap: this touches the exact same call line as #21929, so the two will conflict and only one can merge. One difference worth the maintainers' call: this PR resolves the timeout through mineruRequestTimeout(setup, apiConfig), so the MonkeyOCR path honors the configured timeout, while #21929 currently passes the plain mineruDefaultTimeout constant at this call site. Whichever lands, the other needs a rebase.

@wangq8
wangq8 requested a review from xugangqiang November 4, 2026 01:46
@wangq8 wangq8 added the ci Continue Integration label Nov 4, 2026
@wangq8
wangq8 requested review from wangq8 and removed request for xugangqiang November 4, 2026 02:15
@wangq8 wangq8 assigned wangq8 and unassigned xugangqiang Nov 4, 2026
@wangq8
wangq8 merged commit d2353a8 into infiniflow:main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants