Skip to content

chore(desktop): make proxy setup order explicit#25853

Open
Hona wants to merge 2 commits intoanomalyco:devfrom
Hona:fix/desktop-proxy-order-cleanup
Open

chore(desktop): make proxy setup order explicit#25853
Hona wants to merge 2 commits intoanomalyco:devfrom
Hona:fix/desktop-proxy-order-cleanup

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented May 5, 2026

Summary

  • Remove the callback/lambda from spawnLocalServer.
  • Make Desktop startup ordering explicit: prepare server env, preserve loopback NO_PROXY, enable Node env proxy, then import/spawn the embedded server.

Follow-up to #25846.

Testing

  • bun typecheck (packages/desktop)
  • bun turbo typecheck

@Hona Hona requested a review from adamdotdevin as a code owner May 5, 2026 10:40
Copilot AI review requested due to automatic review settings May 5, 2026 10:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes Desktop’s embedded server startup order explicit by removing the spawnLocalServer “configure env” callback and moving environment/proxy setup into the main startup flow before importing/spawning the embedded server (follow-up to #25846).

Changes:

  • Removed the optional configureEnv callback parameter from spawnLocalServer.
  • Exported prepareServerEnv so Desktop startup can set server-related env before importing virtual:opencode-server.
  • Updated Desktop initialization to explicitly run: prepareServerEnv → preserve loopback NO_PROXY → enable Node env proxy → then spawn the embedded server.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/desktop/src/main/server.ts Removes callback-based env setup from spawnLocalServer and exports prepareServerEnv for explicit ordering.
packages/desktop/src/main/index.ts Calls prepareServerEnv, ensureLoopbackNoProxy, and useEnvProxy explicitly before importing/spawning the embedded server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/desktop/src/main/index.ts Outdated
Comment on lines +172 to +176
const url = `http://${hostname}:${port}`
const password = randomUUID()
prepareServerEnv(password)
ensureLoopbackNoProxy()
useEnvProxy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants