omi icon indicating copy to clipboard operation
omi copied to clipboard

arXiv app rejects valid versioned solv-int paper IDs

Open aike9966 opened this issue 2 months ago • 4 comments

The arXiv get_paper_details tool rejects valid legacy IDs whose archive name contains v: solv-int/9701001v1, arXiv:solv-int/9701001v1, and https://arxiv.org/abs/solv-int/9701001v1 all return “Provide a valid arXiv paper ID” without requesting arXiv. The unversioned solv-int/9701001 passes this validation. The versioned paper exists on arXiv. Reproduced against 02b6c3a85139aa762eaac92fa30124a5e4c5c8bf; the affected files are also unchanged in 898118d6e410325116e98a1ede1d1e81d233871b.

The cause is _safe_paper_id: after recognizing a valid versioned ID, split("v", 1) truncates at the v in solv-int, producing sol. Splitting from the right preserves the archive and removes only the recognized version suffix.

Prepared locally with AI assistance: a one-line fix plus endpoint regression tests. The regression fails in five versioned-input subcases before the fix; all 46 plugin tests pass after it (python -S plugins/omi-arxiv-app/test_main.py). The tests cover raw IDs, both URL schemes, the arXiv: prefix, a multi-digit version, an unversioned control, and malformed versions that must not call the upstream service. A separate real FastAPI/TestClient check using the pinned dependencies and a mocked arXiv HTTP transport also passes. A live arXiv API attempt returned HTTP 406, so live upstream success is not claimed. Full repository preflight is not passed: Git HTTPS retrieval failed and the sparse checkout is missing files required by manifest validation. No PR has been opened.

@josancamon19 @kodjima33 — following the contribution guide's bounty suggestion process, would this small fix and regression coverage be eligible for a $25 bounty, subject to your approval and eventual PR acceptance? This is a proposal, not an existing approved bounty. The complete proposed patch is attached for review.

omi-arxiv-legacy-id.patch.txt

aike9966 avatar Sep 17 '26 15:09 aike9966

/try

orimoshe123 avatar Sep 17 '26 15:09 orimoshe123

@orimoshe123 is picking this up. Platform: algora · apply: /try · pay: /claim

cc @aike9966 @josancamon19 @kodjima33

orimoshe123 avatar Sep 17 '26 15:09 orimoshe123

Submitted fix with regression test coverage in PR #14405:

  • Replaced split("v", 1)[0] with rsplit("v", 1)[0] in _safe_paper_id to prevent legacy archive names containing "v" (like solv-int/9701001v1) from being sliced to sol.
  • Added hermetic unit and endpoint regression tests covering raw legacy IDs, arXiv: / arxiv: prefixes, and full URL formats.
  • All 48 tests pass under python3 -S in 0.16s.

shitobu avatar Sep 17 '26 21:09 shitobu

Closing as already fixed on current main.

Current main plugins/omi-arxiv-app _safe_paper_id returns the full candidate (regex allows solv-int/...vN) and no longer split('v',1)

aryanorastar avatar Sep 20 '26 16:09 aryanorastar