Repository navigation
Conversation
…ption for canonical URLs
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesThe outbound provider now enables Mihomo IPv6 fake-IP handling for canonical TUN transparent fake-IP exceptions. Proxy pinning still requires an effective proxy. Tests cover canonical OpenCode traffic and Google Antigravity quota requests. Mihomo IPv6 fake-IP admission
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Canonical provider requests in Mihomo TUN mode can now use IPv6 Fake-IP addresses without requiring a proxy, while requests without a configured proxy are not passed one. Covered regression tests indicate the change is ready to merge. Sequence Diagram(s)sequenceDiagram
participant Request
participant ProviderOutbound
participant AddressResolver
participant PinnedRequest
Request->>ProviderOutbound: Send canonical request
ProviderOutbound->>ProviderOutbound: Evaluate TUN transparent fake-IP exception
ProviderOutbound->>AddressResolver: Resolve with mihomo enabled
AddressResolver-->>ProviderOutbound: Return IPv6 and IPv4 addresses
ProviderOutbound->>PinnedRequest: Use IPv4 address and effective proxy when present
PinnedRequest-->>Request: Return HTTP response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
리뷰 · 우선순위 64 / 80이 PR은 Clash / Mihomo를 TUN 모드 + IPv6 Fake-IP( 고치는 방식은 IPv4 TUN 예외와 같은 증명을 IPv6에도 붙이는 것입니다. 현재 라인 146–148 (PR diff, 라인 190–194 (PR diff, 경로 경로 경로 경로 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
…3849) [skip ci] fix(transport): admit canonical Mihomo IPv6 with validated pinning
|
Landed on |
…N (carry lidge-jun#3849) [skip ci] fix(transport): admit canonical Mihomo IPv6 with validated pinning
Summary
Fixes an issue where Google Antigravity (and other canonical endpoints) fail to retrieve quotas or discover models when the client environment runs under Clash / Mihomo in TUN mode with IPv6 Fake-IP enabled (
fake-ip-range6: fdfe:dcba:9876::/48) without an explicitHTTP(S)_PROXYenvironment variable.Root Cause
In
src/lib/provider-outbound.ts,resolveAddressesvalidates target IP addresses against private-network SSRF risks:198.18.0.0/15), TUN mode has an explicit transparency bypass viatransparentFakeIpException(url, parsed, isCanonicalUrl, name):fdfe:dcba:9876::/48, added in [Bug] Model discovery blocked by destination policy under Clash/Mihomo IPv6 fake-ip (fdfe:dcba:9876::/48) #3462), the admission was strictly gated behindeffectiveProxy !== null:When running in TUN mode without
HTTP(S)_PROXY(e.g. background services managed bylaunchd/systemdor transparent TUN proxies), DNS queries for canonical endpoints likedaily-cloudcode-pa.googleapis.comreturn both IPv4 Fake-IP (198.18.x.x) and IPv6 Fake-IP (fdfe:dcba:9876::xx). BecauseallowMihomoIpv6FakeIpevaluated tofalse, the IPv6 ULA address was flagged as an unsafe private network address:This aborted the request and caused Antigravity quota retrieval (
retrieveUserQuotaSummary) to fail.Fix
src/lib/provider-outbound.ts):Ensure
proxypassed toglobalThis.fetchis only set wheneffectiveProxyis non-null.tests/providers/provider-outbound.test.tsverifying that canonical URLs admit Mihomo IPv6 Fake-IP without proxy environment variables.tests/providers/provider-quota.test.tsandtests/providers/provider-account-quota.test.ts(mihomo: true).Verification
bun test tests/providers/provider-quota.test.ts tests/providers/provider-account-quota.test.ts tests/routing/destination-policy-resolved.test.ts tests/providers/command-code-fakeip-discovery.test.ts: 250 pass, 0 fail.fetchAntigravityUsageQuotasuccessfully retrieves live Antigravity 5h and weekly quota without settingHTTPS_PROXY.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit