Skip to content

Test: AH Copilot SDK network proxy #324405

Description

@chrmarti

Refs: #324209

Complexity: 4

Create Issue


Test: Agent Host respects HTTP proxy configuration

Verify that chat requests made from the Agent Host process honor the configured HTTP proxy, both when the proxy is set explicitly via the http.proxy setting and when it is resolved from the OS (PAC URL).

Two windows: the test proxy runs inside a dev container in one VS Code window (the "proxy window"). The actual testing happens in a separate VS Code window/install (the "test window") — it is easier to use two different installs (e.g. run the dev container in VS Code Stable and test in VS Code Insiders). Steps below that mention Settings, restarting, and making chat requests apply to the test window.

Setup

  1. In the proxy window, start the test proxy from the vscode-proxy-agent repo:
    • Clone https://github.com/microsoft/vscode-proxy-agent.
    • Important: switch to branch chrmarti/quarrelsome-gibbon.
    • Dev Containers: Reopen in Container > HTTP Proxy Test.
    • This starts 3 log terminals in the dev container: 1 for the PAC config and 2 for the two proxies. (See .devcontainer/http-proxy-test/README.md for details.)
    • Keep the proxy log terminals visible so you can observe requests as they arrive.
  2. In the test window, ensure the Agent Host is enabled: set chat.agentHost.enabled to true in Settings.

Test 1: Explicit http.proxy setting

  1. Set http.proxy in Settings to the test proxy, e.g. http://127.0.0.1:3155.
  2. Restart VS Code (current limitation: the Agent Host does not pick up proxy changes without a restart).
  3. Make a chat request that runs in the Agent Host's Copilot.
  4. Verify in the proxy log terminal that the chat request(s) go through the proxy.

Test 2: PAC URL configured in the OS

  1. Remove the http.proxy setting.
  2. Configure the PAC URL at the OS level, pointing at the test PAC, e.g. http://127.0.0.1:4444:
    • macOS: System Settings → Network → (active interface) → Details… → Proxies → enable "Automatic proxy configuration" and set the URL.
    • Windows: Settings → Network & Internet → Proxy → "Use setup script" → turn on and set the "Script address".
    • Linux (GNOME): Settings → Network → Network Proxy → set Method to "Automatic" and set the "Configuration URL".
  3. Restart VS Code (current limitation, as above).
  4. Make a chat request that runs in the Agent Host's Copilot.
  5. Verify in the proxy log terminal that the chat request(s) go through the proxy resolved from the PAC file.

Cleanup

  1. Remove the http.proxy setting if it is still set.
  2. Remove the OS-level PAC URL / automatic proxy configuration.
  3. Restart VS Code so it no longer routes traffic through the test proxy.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions