You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bounty proposal] fix(pubmed): handle missing summaries, normalize URL targets, and add test suite ($25 proposed) #14552
False Success on Missing/Deleted PMIDs:
In plugins/omi-pubmed-app/main.py, get_pubmed_article previously checked if pmid not in summaries: to detect missing articles. However, when querying a non-existent or deleted PMID (e.g. 999999999), NCBI ESummary returns HTTP 200 with {"result": {"uids": ["999999999"], "999999999": {"uid": "999999999", "error": "cannot get document summary"}}}.
Because pmid in summaries evaluates to True, _extract_article_fields was executed on the error dict, returning a successful ChatToolResponse with Title: Untitled and empty metadata instead of reporting an error.
Rejection of Valid PubMed URLs and Formatted Identifiers:
Users and chat agents commonly paste full PubMed article URLs (e.g., https://pubmed.ncbi.nlm.nih.gov/34567890/ or https://www.ncbi.nlm.nih.gov/pubmed/34567890) or formatted strings (PMID: 34567890). _is_valid_pmid strictly enforced .isdigit(), rejecting valid pasted links with pmid must be a numeric PubMed ID.
Defensive Parsing: _extract_article_fields and search result enumerations did not guard against error rows or heterogeneous author structures in NCBI payloads.
Missing Test Coverage:
The app previously lacked a dedicated endpoint test suite (test_main.py) for FastAPI routes, manifest integrity, and parameter validation.
Proposed Solution
Added _normalize_pmid to cleanly extract numeric PMIDs from URLs, PMID: prefixes, and whitespace.
Updated get_pubmed_article, search_pubmed, and get_related_pubmed to verify record_data and explicitly handle NCBI {"error": ...} summaries.
Added comprehensive hermetic test suite in plugins/omi-pubmed-app/test_main.py (22 unit & endpoint tests, 0 external network dependencies).
Activity
fix(pubmed): handle missing summaries and normalize URL targets (Base…
test(pubmed): add comprehensive hermetic endpoint test suite (BasedHa…
fix(pubmed): handle missing summaries, normalize URL targets, and add…