fix(parser): wire MinerU server_url through Go PDF parser - #19445
fix(parser): wire MinerU server_url through Go PDF parser#19445Souravrajvi0 wants to merge 2 commits into
Conversation
The Go ingestion path never forwarded mineru_server_url to the MinerU API, breaking vlm-http-client and hybrid-http-client backends. Mirror the Python contract by passing server_url in ParseFileConfig, requiring it for http-client backends, and validating backend names locally. Fixes infiniflow#19438
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe Go MinerU parser now resolves and validates backend and server URL settings from setup, provider configuration, and environment variables. It forwards ChangesMinerU server URL integration
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: 🟡 Moderate · up to MinerU routing is correctly forwarded and tested, but authenticated ingestion configured through provider JSON may submit that JSON as the Bearer credential and fail. This credential handling should be resolved or explicitly accepted before merge. Sequence Diagram(s)sequenceDiagram
participant PDFDispatch
participant PDFParser
participant MinerURequest
participant MinerUService
PDFDispatch->>PDFDispatch: Resolve and validate backend and server URL
PDFDispatch->>MinerURequest: Pass backend and server URL
PDFParser->>MinerURequest: Pass ParseFileConfig.ServerURL
MinerURequest->>MinerUService: Submit multipart request with server_url
MinerUService-->>MinerURequest: Return parse response
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. A rabbit hops where server paths align Comment |
The PDF parser layer now forwards server_url, but production Go ingestion uses dispatchMinerUPDF / mineruStreamParse, which still dropped the provider UI value. Read mineru_server_url from parser setup, the MinerU api_key JSON, or MINERU_SERVER_URL, require it for http-client backends, and include it in the zip /file_parse request. Fixes infiniflow#19438
Summary
Fixes #19438.
The Go MinerU paths never forwarded
mineru_server_urlto the MinerU API, sovlm-http-clientandhybrid-http-clientbackends dropped the downstream inference address that the provider UI collects.This PR mirrors the Python contract on both Go call sites:
dispatchMinerUPDF/mineruStreamParse) — this is the production PDF MinerU route. It already uses the Python zip/response_format_zipcontract. It now readsmineru_server_urlfrom parser setup, the MinerU providerapi_keyJSON, orMINERU_SERVER_URL, requires it for http-client backends, and sends it as theserver_urlmultipart field.ParseFileConfig+mineru_local.go) — the async task client cited in the issue now also sendsserver_url.Both paths validate backend names locally against the current MinerU public API list (
pipeline,vlm-engine,hybrid-engine,vlm-http-client,hybrid-http-client).Out of scope
/file_parsecontract as Python.Test plan
CGO_ENABLED=0 go test -run MinerU ./internal/parser/parser ./internal/ingestion/componentserver_urlforwarding, missingserver_urlerror, invalid backend rejectionserver_urlfrom providerapi_keyJSON, missingserver_urlerror for http-client backends