base red: Cloud Tunnel extension observes the path with NWPathMonitor (defaultPath is not in the macOS 26.5 SDK)
Summary
The full app build of feat-cmux-next is red. Fleet job a565ad1d55c788476e604c39 (feat 7fd393100087, Xcode 26.6, MacOSX26.5 SDK, Release, arm64 and x86_64) fails:
CloudTunnelExtension/PacketTunnelProvider.swift:50:35: error: value of type 'PacketTunnelProvider' has no member 'defaultPath'
010ffb95c155 (lawrencecchen, in the direct push ad2c76731f28..cc33e089376e at 19:09Z) observed NEProvider.defaultPath through KVO. This SDK does not offer it to Swift. Network.framework's NWPathMonitor is the documented replacement.
This forward fix changes only the path observation:
PacketTunnelProviderruns oneNWPathMonitoron its own serial utility queue (not the main thread). It starts where the KVO observation started and is cancelled on stop.- The rule stays the same: the monitor's first path is the current one, so only a real change after it calls
engine.networkChanged(). The rule is nowCloudTunnelPathChangeGateinCmuxNextCloudTunnel, so it can be tested without a tunnel.
The alternative is the revert #34198. Whichever is green with an independent SHIP first lands; the other closes.
Credit: the Cloud Tunnel work is lawrencecchen's (010ffb95c155..cc33e089376e); this PR only replaces the KVO path observation.
Changelog
none
Testing
python3 scripts/cmux-next/prepush-gate.py: no new violations../scripts/lint-ios-package-conventions.sh: OK.- Full Release app build on the fleet: see the comment with the job ID.
CloudTunnelPathChangeGateTests(first path, repeated path, each real change): run on the fleet, see the comment.
Observed / Not run
- Observed: the prepush gate and package lint; the fleet results in the comments.
- Not run: a real tunnel on a Mac with a network change (needs a signed system extension and a Cloud network).
NWPathMonitorpath equality is used asNWPath.isEqualwas before; I did not check on a live Mac whether the tunnel's own utun coming up sends one extra update (it would cost one extra rebind and handshake).
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the full Release build of feat-cmux-next, which fails on the macOS 26.5 SDK because NEProvider.defaultPath is not available to Swift.
The Cloud Tunnel extension now observes network path changes with NWPathMonitor on its own serial utility queue, replacing the KVO observation of defaultPath. The path-change rule is extracted into CloudTunnelPathChangeGate in CmuxNextCloudTunnel so it is testable without a tunnel: the monitor's first path is the current one, so only a real change after it rebinds the engine. The rule and its cancel-on-stop behavior stay the same as before.