Skip to content

fix(discovery): carry scheme-bound IPv6 fake-IP admission (#3551) - #3615

Merged
lidge-jun merged 1 commit into
devfrom
codex/260905-residual-ipv6
Sep 5, 2026
Merged

fix(discovery): carry scheme-bound IPv6 fake-IP admission (#3551)#3615
lidge-jun merged 1 commit into
devfrom
codex/260905-residual-ipv6

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Carries only the child-specific #3551 code onto the corrected Google error parent. The exact Mihomo IPv6 prefix is admitted only when a scheme-matched proxy is captured before DNS and explicitly bound to the request; NO_PROXY and nonmatching destinations retain the denial path. No unrelated stack-ledger files are carried.

Refs #3462. Source security signoff described the boundary as appropriately narrow; its remaining objection was the blocked parent, now corrected in #3608.

Stack (merge bottom-up): IPv6 → launchd → Codex toggle → canonical discovery. This layer targets dev; retarget after its parent lands. These are child-only carries, not wholesale copies of the old parents.

Verification

  • Astra worker root typecheck passed for each layer; toggle app/node typechecks also passed.
  • Child-only path comparison, linear ancestry and diff whitespace checks passed. Original screenshot blob retained.
  • No local tests executed. Final dev Linux CI is the user-authorized batch gate.

Checklist

  • Layer is scoped to its source change.
  • Existing source documentation and attribution retained.
  • Relevant auth, proxy and token boundaries inspected; no live host mutation.

Summary by CodeRabbit

  • New Features

    • Added support for Mihomo IPv6 fake-IP DNS responses during diagnostic requests when the matching proxy is configured and the request is routed through it.
    • Added support for benchmark-range fake-IP DNS responses when an outbound proxy applies.
  • Documentation

    • Documented fake-IP handling, proxy requirements, exclusions, and validation behavior across supported languages.

Carry only the final source/docs/test delta of #3551 (fd1dbbe..37622b9) onto corrected parent #3608. Exclude campaign ledgers.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 04:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T04:05:23.235185Z 7800a74 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 76589e09-d59d-4dc8-957e-65d2d32ecc1c

📥 Commits

Reviewing files that changed from the base of the PR and between 4734c78 and 7800a74.

📒 Files selected for processing (14)
  • docs-site/src/content/docs/fr/reference/configuration/providers.md
  • docs-site/src/content/docs/ja/reference/configuration/providers.md
  • docs-site/src/content/docs/ko/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/ru/reference/configuration/providers.md
  • docs-site/src/content/docs/tr/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/providers.md
  • src/lib/destination-policy.ts
  • src/lib/provider-outbound.ts
  • src/lib/proxy-env.ts
  • structure/04_transports-and-sidecars.md
  • tests/providers/provider-outbound.test.ts
  • tests/routing/destination-policy-resolved.test.ts

📝 Walkthrough

Walkthrough

The change adds Mihomo IPv6 fake-IP DNS support for provider outbound requests. It selects scheme-specific proxies, excludes NO_PROXY matches, binds eligible requests to the proxy, preserves save-time validation, adds tests, and updates localized documentation.

Changes

Mihomo fake-IP outbound support

Layer / File(s) Summary
Destination policy and validation
src/lib/destination-policy.ts, tests/routing/destination-policy-resolved.test.ts
Adds exact detection for fdfe:dcba:9876::/48 and the allowMihomoIpv6FakeIp option. Tests cover accepted DNS answers, rejected literals, adjacent prefixes, mixed responses, and provider-save validation.
Proxy selection and request binding
src/lib/proxy-env.ts, src/lib/provider-outbound.ts, tests/providers/provider-outbound.test.ts
Selects HTTPS_PROXY or HTTP_PROXY, ignores ALL_PROXY, checks NO_PROXY, passes the validation opt-in, and binds eligible fetches to the selected proxy.
Documentation
docs-site/src/content/docs/reference/configuration/providers.md, docs-site/src/content/docs/*/reference/configuration/providers.md, structure/04-transports-and-sidecars.md
Documents benchmark and Mihomo fake-IP exceptions, proxy requirements, and unchanged validation behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProviderOutboundGet
  participant EffectiveProxyFor
  participant ResolvePublicAddresses
  participant Fetch
  ProviderOutboundGet->>EffectiveProxyFor: Resolve proxy for URL scheme
  EffectiveProxyFor-->>ProviderOutboundGet: Return matching proxy or null
  ProviderOutboundGet->>ResolvePublicAddresses: Validate DNS answers with Mihomo opt-in
  ResolvePublicAddresses-->>ProviderOutboundGet: Return resolved addresses
  ProviderOutboundGet->>Fetch: Send request with explicit proxy when eligible
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260905-residual-ipv6

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun
lidge-jun merged commit 7a704e3 into dev Sep 5, 2026
5 of 7 checks passed
@lidge-jun
lidge-jun deleted the codex/260905-residual-ipv6 branch September 5, 2026 04:01
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7800a744b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// below reason about the same value. `null` here means "no proxy fetch would actually use",
// even if some other proxy variable is set.
const effectiveProxy = effectiveProxyFor(parsed);
const allowMihomoIpv6FakeIp = effectiveProxy !== null && !noProxyMatches(parsed);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor lowercase no_proxy before binding the proxy

When NO_PROXY exists but is blank while no_proxy contains this hostname, noProxyMatches selects the blank uppercase value via ?? and incorrectly returns false. This newly enables the IPv6 fake-IP admission here, after which the request is given an explicit proxy option that bypasses the lowercase exclusion Bun would otherwise honor, routing a deliberately excluded provider through the proxy. Resolve the uppercase/lowercase values using trimmed-value fallback, as effectiveProxyFor and proxyEnvPresent already do, before admitting and binding the request.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant