zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.42k stars 2.05k forks source link

copilot does not respect proxy #6701

Open reyafyi opened 5 months ago

reyafyi commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

copilot integration does not respect http_proxy/https_proxy env variables. somewhat related to https://github.com/zed-industries/zed/issues/5032

Environment

Zed: v0.119.19 (Zed) OS: macOS 14.2.1 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

2024-01-25T12:33:16 [INFO] ========== starting zed ==========
2024-01-25T12:33:16 [INFO] Opening main db
2024-01-25T12:33:16 [ERROR] crates/zed/src/zed.rs:538: EOF while parsing a value at line 1 column 0
2024-01-25T12:33:16 [INFO] Opening main db
2024-01-25T12:33:16 [INFO] build git repository ".git"
2024-01-25T12:33:16 [INFO] set environment variables from [...]
2024-01-25T12:33:16 [INFO] Opening main db
2024-01-25T12:33:16 [INFO] Node runtime install_if_needed
2024-01-25T12:33:17 [INFO] 0 unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-01-25T12:33:17.176Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-01-25T12:33:17.176Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-01-25T12:33:17 [INFO] 0 unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "ec2bf530-ea70-4189-8de4-45741a5993bd",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-01-25T12:33:17 [INFO] 0 unhandled notification LogMessage:
{
  "level": 1,
  "message": "[INFO] [auth] [2024-01-25T12:33:17.584Z] Invalid copilot token: missing token: 403 ",
  "metadataStr": "[INFO] [auth] [2024-01-25T12:33:17.584Z]",
  "extra": [
    "Invalid copilot token: missing token: 403 "
  ]
}
2024-01-25T12:33:17 [INFO] 0 unhandled notification window/showMessageRequest:
{
  "type": 2,
  "message": "At this time, Copilot is not available in your location. You are currently logged in as reyafyi.",
  "actions": [
    {
      "title": "Copilot Unavailable"
    },
    {
      "title": "Dismiss"
    }
  ]
}
juiiyang commented 5 months ago

The best way is to set up proxy in the Zed settings (like vscode), which may need to expect future features. But there is a way to solve it.

My Apple silicon Mac successfully solved this problem by installing shadowrocket.

Because the application will install the system's VPN, and then the network is unified out of the VPN without setting http/https_proxy separately.

image
reyafyi commented 1 week ago

@SomeoneToIgnore i'm not sure this was fixed, as im still unable to get copilot to use proxy from the config