Harden macOS system-proxy service resolution to prevent apiInvoke toggle failures#617
Open
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
…p error isolation and logging Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/d06b0b68-a98e-430f-91bd-1ba32435448a Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
…sudo on macOS Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/1cd7eaff-f2c3-4a0d-bab0-116d3a963e90 Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
…core Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/8831d1eb-ea8b-4cac-a9cd-6b60041fc63d Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make macOS system-proxy toggling more reliable by improving how the active network service is resolved and by retrying networksetup with an admin prompt when permission errors occur, while also fixing CI frozen-lockfile failures caused by lockfile drift.
Changes:
- Sync
packages/core/package.jsonandpnpm-lock.yamlby addingrequestas a direct dependency and updating the lockfile. - Enhance shell exec error propagation by preserving
error.codeon the thrown error for upstream exit-code handling. - Refactor macOS proxy setup to robustly detect the active network service and, on exit code 14, retry via
@vscode/sudo-prompt; add unit tests for the mac parsing helpers.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates lockfile importers/snapshots to match dependency graph after install. |
| packages/core/package.json | Adds missing direct dependency (request) to match runtime usage and lockfile. |
| packages/core/src/shell/shell.js | Preserves exit code by attaching err.code when child_process.exec fails. |
| packages/core/src/shell/scripts/set-system-proxy/index.js | Adds macOS network service resolution helpers and sudo retry flow for permission errors. |
| packages/core/test/setSystemProxyMacTest.js | Adds mocha tests for macOS parsing/picking helper functions. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
pnpm-lock.yaml:1929
- The lockfile indicates
@xmldom/xmldom@0.8.12is deprecated due to “critical issues”. Since this PR updates the lockfile, it would be good to address this by bumping the dependency chain (or adding a pnpm override/resolution) so installs don’t continue pulling a known-problematic version.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "lodash": "^4.18.1", | ||
| "log4js": "^6.9.1", | ||
| "node-powershell": "^4.0.0", | ||
| "request": "^2.88.2", |
Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/ef3b9305-d635-41a4-b7de-7d0e186f780d Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
Copilot stopped work on behalf of
cute-omega due to an error
May 1, 2026 09:08
Copilot stopped work on behalf of
cute-omega due to an error
May 1, 2026 09:10
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.
packages/core/package.json中新增了request直接依赖,但pnpm-lock.yaml的 importer 节点未同步,导致 CI 的frozen-lockfile检查失败pnpm install --no-frozen-lockfile更新pnpm-lock.yamlshell.js:保留error.code到 thrown Error,方便上层检测 exit code 14set-system-proxy/index.js:引入@vscode/sudo-prompt,添加sudoExecMac辅助函数,macOS 遇到 exit code 14 时弹出系统授权对话框