Skip to content

fix: use multi-endpoint connectivity check to support China/GFW users#13474

Closed
christian-byrne wants to merge 2 commits intomasterfrom
glary/fix-connectivity-check-china
Closed

fix: use multi-endpoint connectivity check to support China/GFW users#13474
christian-byrne wants to merge 2 commits intomasterfrom
glary/fix-connectivity-check-china

Conversation

@christian-byrne
Copy link
Copy Markdown
Contributor

@christian-byrne christian-byrne commented Apr 19, 2026

PR Created by the Glary-Bot Agent


Summary

  • Fixes _diagnose_connectivity() which previously only probed google.com to detect internet access — blocked by China's Great Firewall, causing every Chinese user to be misdiagnosed as having no internet
  • Now checks the Comfy API health endpoint first, then falls back to multiple probe URLs (google.com, baidu.com, captive.apple.com)
  • Adds 7 regression tests covering all diagnostic scenarios

Context

Users in China report LocalNetworkError: Unable to connect to the network when using API nodes (Grok, VertexAI/Gemini). After retries are exhausted, _diagnose_connectivity() pings google.com to determine if the issue is local or server-side. Since Google is blocked in China, every Chinese user gets the misleading "check your internet" message.

Changes

comfy_api_nodes/util/client.py:

  1. Checks Comfy API /health endpoint first — if reachable, returns immediately
  2. Falls back to probing multiple URLs: google.com, baidu.com, captive.apple.com

tests/test_diagnose_connectivity.py — 7 regression tests covering: API healthy fast-path, Google blocked (China), baidu fallback, all probes fail, API 500, captive Apple fallback

Verification

Backend Python utility — no browser testing applicable. All 7 unit tests pass. No new LSP diagnostics.

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

The _diagnose_connectivity() function previously only probed google.com
to determine whether the user has internet access. Since google.com is
blocked by China's Great Firewall, Chinese users were always misdiagnosed
as having no internet, causing misleading LocalNetworkError messages.

Now checks the Comfy API health endpoint first (the most relevant
signal), then falls back to multiple probe URLs (google.com, baidu.com,
captive.apple.com) to support users in regions where specific sites are
blocked.
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.

2 participants