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
feat(resilience): auto-detect best index mirror at first init (the real stability fix)
Implements TODO(mirror-default) option (b). The first-init seed used a hardcoded
"CN" mirror, which strands overseas users and GitHub-hosted CI behind a
slow/unreachable gitcode mirror — the actual root cause behind the repeated
75_index_status_offline.sh cold-bootstrap failures (a US runner seeding CN can't
reach gitcode, so the index clone fails fast and the index reports 'missing').
detect_best_mirror() runs a short, tight-timeout HEAD probe to github.com
(GLOBAL) and gitcode.com (CN), and pins the lower-latency reachable one into
.xlings.json. Priority matches the intended design:
explicit --mirror (config) > lower-latency auto-probe > GLOBAL fallback
An explicit `mcpp self config --mirror CN|GLOBAL` always wins; the probe only
runs on a fresh init with no explicit choice. Falls back to GLOBAL (reachable
nearly everywhere) if neither host answers.
Verified locally: on a CN host the probe picks CN (gitcode 150ms < github 380ms)
and logs 'mirror: probe github=380ms gitcode=150ms -> CN' under MCPP_VERBOSE; a
US CI runner will symmetrically pick GLOBAL. e2e 75/80/81 green.
0 commit comments