Repository navigation
Make provider merging repeatable and bound provider requests - #70
Open
kennethbruskiewicz wants to merge 2 commits into
Open
kennethbruskiewicz wants to merge 2 commits into
kennethbruskiewicz wants to merge 2 commits into
Conversation
An empty answer from a provider is no longer handled by catching a TypeError. query_KP returns None for it, and the merge loop now checks for that. Responses are merged in provider-name order, so the edge kept for a shared edge ID no longer depends on which response arrived first. Provider queries set a (10, 300) second connect/read timeout. A host that never accepts the connection previously held the query until the OS gave up. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
These three tests fail on main because the services changed, not the toolkit. The changes are identical to the ones on #68. NameRes on Babel 2026jul22 reports Solr stats at the top level and indexes about 331M names. The status test accepts both shapes and uses a 300M floor. Node Annotator no longer returns clinical_approval for CHEBI:15377. The expectation drops the volatile warning and clinical fields. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
kennethbruskiewicz
marked this pull request as ready for review
November 16, 2026 20:43
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small fixes to provider querying in
TCT/translator_query.py. They came out of one recorded run of "what does metformin treat?" across 20 discovered providers on 2026-11-16.Changes
Empty answers
query_KPreturnsNonewhen a provider answers with no edges, and for a non-200 response.parallel_api_querythen ran'knowledge_graph' in dataon thatNone, and a broadexceptswallowed the resultingTypeError. The loop now checks forNonedirectly. Callers get the same result as before.Merge order
Responses were merged in the order they completed, and a later response overwrote an earlier one wherever two providers returned the same edge ID. In the recorded run 2,378 edges came back and 763 remained, and which copy survived depended on timing. Responses are now merged in provider-name order. The result has the same shape and is the same on every run.
Name order is used because the list of selected providers is built from a set, and its order changes between processes.
Request timeout
requests.postwas called with no timeout. In the recorded runcohd.ionever accepted the connection and held the query until the operating system gave up. Provider queries now usePROVIDER_TIMEOUT = (10, 300), which is 10 seconds to connect and 300 seconds to read.This is a behaviour change. A provider that takes more than five minutes to answer was waited for before and is now dropped. Five minutes matches the consortium's response-time target for ARAs.
Not changed
Edges are still matched on each provider's own edge ID. Matching on content, as the ARS does, would change the keys that results and support graphs refer to and needs its own design.
Testing
tests/test_translator_query.pyadds two offline tests. One checks that the merged result is identical whichever provider answers first, with an empty and a failing provider in the mix. The other checks that a provider query passes the timeout.The full suite passes locally with the live services reachable: 125 passed, 1 skipped.
A second commit updates three live-service tests that fail on
maintoday because NameRes and Node Annotator changed. The edits are identical to the ones on #68, so the two will not conflict.Note for #68
#68 changes the same loop to record merge observations. Whichever lands second needs a small manual merge.
🤖 Generated with Claude Code