Skip to content

Select healthy China and US replay nodes#3187

Closed
xiaoyaoqilan wants to merge 13 commits into
dimensionalOS:mainfrom
xiaoyaoqilan:codex/replay-node-selection
Closed

Select healthy China and US replay nodes#3187
xiaoyaoqilan wants to merge 13 commits into
dimensionalOS:mainfrom
xiaoyaoqilan:codex/replay-node-selection

Conversation

@xiaoyaoqilan

Copy link
Copy Markdown
Contributor

Summary

  • expose replay node health and region metadata through /healthz
  • probe configured China and US endpoints concurrently
  • select the fastest healthy node for upload/download
  • cache the recommendation for one hour, then automatically re-evaluate the network environment
  • integrate automatic server selection into the replay repository CLI

Motivation

This is PR 5 of the #3158 implementation stack. It implements regional auto-detection and hourly dynamic upload recommendations without hard-coding a single China or US endpoint.

Stack dependency

Validation

  • node health, concurrent probe, latency ordering, failure fallback, and one-hour cache behavior are covered by tests
  • ruff check, format checks, and targeted mypy passed

@autofix-ci

autofix-ci Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.81269% with 414 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/protocol/pubsub/impl/webrtc/mvp_cli.py 16.94% 195 Missing and 1 partial ⚠️
...s/protocol/pubsub/impl/webrtc/replay_repository.py 79.42% 60 Missing and 33 partials ⚠️
...rotocol/pubsub/impl/webrtc/replay_repository_s3.py 74.64% 23 Missing and 13 partials ⚠️
dimos/protocol/pubsub/impl/webrtc/replay_nodes.py 76.19% 19 Missing and 16 partials ⚠️
dimos/memory2/remote_replay.py 79.46% 15 Missing and 8 partials ⚠️
dimos/memory2/remote_dataset.py 87.36% 6 Missing and 6 partials ⚠️
...otocol/pubsub/impl/webrtc/replay_repository_cli.py 85.93% 6 Missing and 3 partials ⚠️
dimos/protocol/pubsub/impl/webrtc/mvp_metrics.py 88.46% 3 Missing and 3 partials ⚠️
...os/protocol/pubsub/impl/webrtc/providers/broker.py 80.00% 1 Missing and 1 partial ⚠️
.../pubsub/impl/webrtc/test_memory2_remote_dataset.py 98.97% 1 Missing ⚠️
... and 1 more
@@            Coverage Diff             @@
##             main    #3187      +/-   ##
==========================================
- Coverage   73.77%   73.68%   -0.10%     
==========================================
  Files        1109     1125      +16     
  Lines      104383   107873    +3490     
  Branches     9567    10127     +560     
==========================================
+ Hits        77013    79486    +2473     
- Misses      24695    25583     +888     
- Partials     2675     2804     +129     
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.19% <78.81%> (+0.49%) ⬆️
OS-ubuntu-latest 70.21% <78.81%> (+0.44%) ⬆️
Py-3.10 70.21% <78.81%> (+0.44%) ⬆️
Py-3.11 70.21% <78.81%> (+0.44%) ⬆️
Py-3.12 70.20% <78.81%> (+0.43%) ⬆️
Py-3.13 70.20% <78.81%> (+0.43%) ⬆️
Py-3.14 68.19% <78.81%> (-1.58%) ⬇️
Py-3.14t ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/core/global_config.py 88.63% <100.00%> (+5.68%) ⬆️
dimos/core/test_global_config.py 100.00% <100.00%> (ø)
dimos/memory2/cli/app.py 84.21% <100.00%> (+14.21%) ⬆️
...otocol/pubsub/impl/webrtc/providers/video_track.py 24.39% <ø> (-2.28%) ⬇️
...os/protocol/pubsub/impl/webrtc/test_mvp_metrics.py 100.00% <100.00%> (ø)
.../protocol/pubsub/impl/webrtc/test_remote_replay.py 100.00% <100.00%> (ø)
...s/protocol/pubsub/impl/webrtc/test_replay_nodes.py 100.00% <100.00%> (ø)
...tocol/pubsub/impl/webrtc/test_replay_repository.py 100.00% <100.00%> (ø)
...l/pubsub/impl/webrtc/test_replay_repository_cli.py 100.00% <100.00%> (ø)
...ol/pubsub/impl/webrtc/test_replay_repository_s3.py 100.00% <100.00%> (ø)
... and 12 more

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xiaoyaoqilan

Copy link
Copy Markdown
Contributor Author

Superseded by #3201. The implementation is consolidated into the dimos/hosted_data package and unified dimos data CLI.

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.

1 participant