Harden macOS system-proxy service resolution to prevent apiInvoke toggle failures#617
Draft
Harden macOS system-proxy service resolution to prevent apiInvoke toggle failures#617
apiInvoke toggle failures#617Conversation
Open
1 task
Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/e9843480-60f1-4d2e-95a8-65549532eb95 Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/e9843480-60f1-4d2e-95a8-65549532eb95 Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix system proxy opening issue on macOS
Harden macOS system-proxy service resolution to prevent Apr 25, 2026
apiInvoke toggle failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, toggling 系统代理 could throw a generic
Api invoke errorand leave system proxy unchanged. Root cause was fragile network-service detection logic that failed on somenetworksetup/route output shapes.What changed
set-system-proxy:route -n get 0.0.0.0networksetup -listnetworkserviceordernetworksetup -listallnetworkserviceswith preference order (Wi-Fi/WiFi/Ethernet)Code structure improvements
parseMacRouteDevice(...)parseMacNetworkServiceByDevice(...)pickMacNetworkService(...)Focused coverage added
*) services and empty/null inputsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
0ms.dev/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)1.1.1.1/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)REDACTED, pid is -1(packet block)185.222.222.222/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)1dot1dot1dot1.cloudflare-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)223.5.5.5/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)REDACTED, pid is -1(packet block)223.6.6.6/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)45.11.45.11/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)8.8.8.8REDACTED, pid is -1(packet block)9.9.9.9REDACTED, pid is -1(packet block)/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(packet block)adult-filter-dns.cleanbrowsing.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)aip.baidubce.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)antivirus.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)cloudflare-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns-family.adguard.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns-unfiltered.adguard.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.adguard-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.adguard.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.alidns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.cfiec.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.cloudflare.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.de.futuredns.eu.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.decloudus.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.dnswarden.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.google/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.opendns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.oszx.co/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.quad9.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.switch.ch/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dns.us.futuredns.eu.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dnsovertls.sinodun.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dnsovertls1.sinodun.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.360.cn/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.applied-privacy.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.ffmuc.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.la.ahadns.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.libredns.gr/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.nl.ahadns.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.opendns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)doh.tiarap.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dot.360.cn/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)dot.sb/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)family-adblock.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)family-filter-dns.cleanbrowsing.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)family.adguard-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)family.cloudflare-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)familyshield.opendns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)getdnsapi.net/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)hagezi.dns.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)https://baidu.com/docmirror/dev-sidecar/refs/heads/master/packages/core/src/config/remote_config.json5/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/packages/core/node_modules/.bin/../mocha/bin/mocha(http block)i.233py.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)internetsehat.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)jp.tiarap.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)kaitain.restena.lu/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)max.rethinkdns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)oisd.dns.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)one.one.one.one/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)p0.freedns.controld.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)p1.freedns.controld.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)p2.freedns.controld.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)p3.freedns.controld.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)private.canadianshield.cira.ca/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)rubyfish.cn/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)sandbox.opendns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)security-filter-dns.cleanbrowsing.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)security.cloudflare-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)sky.rethinkdns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)unfiltered.adguard-dns.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)unfiltered.dns.bebasid.com/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)unicast.censurfridns.dk/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)wikimedia-dns.org/usr/local/bin/node node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.bin/../mocha/bin/mocha(dns block)www.electronjs.org/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/dev-sidecar/dev-sidecar/node_modules/.pnpm/@electron+rebuild@3.6.1/node_modules/@electron/rebuild/lib/module-type/node-gyp/worker.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: