Skip to content

fix: return partial federation results on tools/list timeout - #112

Merged
nfvelten merged 2 commits into
masterfrom
fix/federation-partial-results
Apr 7, 2026
Merged

fix: return partial federation results on tools/list timeout#112
nfvelten merged 2 commits into
masterfrom
fix/federation-partial-results

Conversation

@nfvelten

@nfvelten nfvelten commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Previously, when federating tools/list across multiple upstreams and the deadline fired, all results were discarded and a JSON-RPC error was returned — even if several upstreams had already replied.
  • Replaced join_all + timeout with a FuturesUnordered loop (tokio::select!) that collects results as upstreams respond. When the deadline fires, whatever arrived is merged and returned.
  • Response includes "_arbitus_partial": true when not all upstreams replied, so clients can detect an incomplete catalog and retry or surface a warning.

Closes #97

Test plan

  • cargo fmt --check — clean
  • cargo clippy -- -D warnings — zero warnings
  • cargo test --lib — all 430 unit tests pass
  • federated_tools_list_times_out_returns_empty_partial — all-hanging upstreams → empty tools list + _arbitus_partial: true, no error
  • federated_tools_list_partial_results_on_timeout — one fast + one hanging → fast upstream's tools returned + _arbitus_partial: true

🤖 Generated with Claude Code

nfvelten and others added 2 commits April 7, 2026 15:17
)

Replace join_all + discard-all-on-timeout with a FuturesUnordered loop
that collects results as upstreams respond. When the deadline fires,
whatever arrived is merged and returned as a partial result instead of
an error. Response includes "_arbitus_partial": true so callers can
detect incomplete catalogs. Adds two new unit tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nfvelten
nfvelten merged commit ebc2901 into master Apr 7, 2026
3 checks passed
@nfvelten
nfvelten deleted the fix/federation-partial-results branch April 7, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: federation timeout discards all results — should return partial results from already-responded upstreams

1 participant