Repository navigation
agentHost: Smoke test sandboxed commands through the client's proxy - #348673
Draft
Christof Marti (chrmarti) wants to merge 3 commits into
Draft
Christof Marti (chrmarti) wants to merge 3 commits into
Christof Marti (chrmarti) wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The Windows/WSL product-build path remains unvalidated and depends on an unreleased runtime and pending SDK bump, requiring maintainer confirmation of runtime bundling and successful chained CI runs.
No open issues 🎉
What changed in this PR
Adds smoke coverage for Agent Host sandboxed shell commands reaching an authenticated upstream proxy through the client, covering local Windows and WSL sessions.
Changes:
- Adds Basic PAC and Kerberos sandbox suites that verify probe delivery, runtime shell execution, and client proxy support.
- Extends smoke automation with network probes, request capture, URL confirmation handling, and sandbox runner options.
- Chains sandbox runs into eligible Azure product-build steps and documents setup. Azure validation remains pending the required runtime release and SDK bump.
| File | Description |
|---|---|
test/smoke/wslDevContainer.ps1 |
Adds Linux sandbox dependencies to prepared WSL distributions. |
test/smoke/src/areas/chat/shellScenarios.ts |
Adds a shell scenario that fetches a URL before echoing success. |
test/smoke/src/areas/agentsWindow/agentsWindow.test.ts |
Adds three sandbox proxy suites and shared assertions. |
test/smoke/scripts/run-agents-window-wsl-kerberos-proxy.ps1 |
Adds sandbox mode, local runtime selection, and separate output names. |
test/smoke/README.md |
Documents sandbox proxy execution, prerequisites, and CI coverage. |
test/automation/src/chat.ts |
Accepts “Allow Once” URL confirmations. |
scripts/chat-simulation/common/mock-llm-server.ts |
Captures catch-all requests for probe assertions. |
build/azure-pipelines/win32/steps/product-build-win32-test.yml |
Chains sandbox runs when using the same-build Linux server and extends timeouts. |
.github/skills/smoke-tests/SKILL.md |
Documents sandbox suite gating and pipeline placement. |
Review effort: Balanced
Christof Marti (chrmarti)
force-pushed
the
chrmarti/agent-host-sandbox-proxy-smoke
branch
2 times, most recently
from
November 23, 2026 10:37
5297a58 to
b4be16e
Compare
Add Agents Window suites in which a sandboxed shell command fetches a URL of the mock server through the sandbox's network proxy, which forwards it to the proxy the client resolves, with the credentials typed into the proxy login dialog (local and WSL Agent Host, Basic PAC) or the client's Kerberos ticket (WSL Agent Host). run-agents-window-wsl-kerberos-proxy.ps1 -Sandbox runs them, and the Azure product build chains them after the Kerberos and Basic PAC runs with the Linux server of the same build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Christof Marti (chrmarti)
force-pushed
the
chrmarti/agent-host-sandbox-proxy-smoke
branch
from
November 26, 2026 16:47
b4be16e to
d3bee8c
Compare
…dbox runs With the legacy iptables backend, which the Dev Container smoke tests select for Docker, the Copilot runtime's sandbox can only install its network rules without privilege when /run/xtables.lock is writable, so sandboxed commands failed in the CI distribution. Hand the lock to the default user for the run and restore it afterwards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ackend The Azure Windows agents have no Windows sandbox backend (BaseContainer), so the Copilot runtime cannot run the sandboxed probe there. Skip the local Agent Host suite with the runtime's reason when the Agent Host logs that the backend is unavailable, instead of timing out. The WSL suites keep failing on it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Adds smoke tests for the certificate, proxy and proxy authentication support of sandboxed commands in the Agent Host: a sandboxed shell command of the Copilot runtime fetches a URL through the sandbox's network proxy, which has to forward it to the proxy the client resolves, with the client's credentials.
Needs a Copilot runtime with github/copilot-agent-runtime#40748 (the sandbox network proxy forwards to the client-resolved upstream proxy with Kerberos, Basic and PAC support). The Copilot SDK 2.0.3 on main (#350441) bundles runtime 1.0.116, which includes it; the local Agent Host suite uses the runtime bundled with the packaged client.
Changes
agentsWindow.test.ts: three suites, registered only withVSCODE_SMOKE_TEST_SANDBOX_PROXY=1:Agents Window (local AgentHost, Basic PAC proxy, sandbox): Windows Agent Host, PAC proxy, exactly one proxy login dialog.Agents Window (WSL AgentHost, Basic PAC proxy, sandbox): Agent Host in WSL, the Windows PAC proxy and credentials through the client, exactly one proxy login dialog.Agents Window (WSL AgentHost, Kerberos proxy, sandbox): Agent Host in WSL, the Windows proxy with the Windows Kerberos ticket through the client.shellScenarios.ts:shellNetworkProbeScenario, which echoes the reply only aftercurlfetched the URL.mock-llm-server.ts: captures catch-all GET requests so tests can assert their own request arrived.test/automation/src/chat.ts: also accepts the runtime's URL confirmation, whose primary button reads "Allow Once".run-agents-window-wsl-kerberos-proxy.ps1:-Sandbox(BasicPac or Kerberos, Agents Window suites only; logs and JUnit results get a-sandboxsuffix) and-CopilotRuntimePathfor the local Agent Host's runtime; installsbubblewrap slirp4netns iptablesin the distribution for-Sandbox. With the legacy iptables backend, which the Dev Container smoke tests select for Docker, the sandbox installs its network rules without privilege only when/run/xtables.lockis writable, so-Sandboxlets the default user own that lock during the run and restores it afterwards.wslDevContainer.ps1: addsbubblewrap slirp4netns iptablesto the prepared distribution. This changes the hash of the script, so the prepared-distribution caches are rebuilt.product-build-win32-test.yml: thesmoke-wsl-kerberos-proxyandsmoke-wsl-basic-pac-proxysteps chain the-Sandboxrun after their main run, only with the Linux server of the same build (VSCODE_LINUX_X64_COMPILATION_ARTIFACT), and their timeouts go from 30 to 40 minutes. Chaining in the existing steps keeps the test checkpoint IDs unchanged.pr-win32-test.ymlis unchanged: its pinned server's runtime does not include the fix yet, so the PR workflow will run the sandbox suites once$serverCommitinwslDevContainer.ps1moves to a server that bundles it.Validation
On the branch rebased onto main (Copilot SDK 2.0.3, runtime 1.0.116):
cd test/smoke && pnpm run compile: passed.pnpm run oxlint test/smoke/src/areas/agentsWindow/agentsWindow.test.ts test/smoke/src/areas/chat/shellScenarios.ts test/automation/src/chat.ts scripts/chat-simulation/common/mock-llm-server.ts: passed.VSCODE_PUBLISH=false), which runs the sandbox suites with the Linux server of the same build: the WSL Kerberos and WSL Basic PAC sandbox suites passed once the script made the legacy iptables lock writable (before that, the runtime disabled the sandbox's network capability on the CI distribution). The local Windows suite timed out there because the agents have no Windows sandbox backend; it now skips itself in that case. With that change, all three WSL proxy steps (Basic, Kerberos and Basic PAC, each with its sandbox run) passed, and the local Windows sandbox suite reported pending. The Windows, Linux, macOS x64 and Web stages succeeded; Alpine and macOS ARM64 stopped at the branch protection check that applies to personal branches.Run locally on Windows with an Ubuntu WSL distribution. The WSL Agent Host covers the Linux leg.
With the released runtime: the branch with the SDK bumped locally to 2.0.2-preview.6 (runtime 1.0.115-7, which also includes github/copilot-agent-runtime#40748), the WSL server built from the same commit, and no runtime overrides:
.\test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1 -ProxyAuth BasicPac -Distribution Ubuntu -WslServerPath <WSL checkout of the branch> -WslNodePath <linux node> -Sandbox: passed (2 passing: the local Windows and WSL Basic PAC sandbox suites; Squid logged only tunnels authenticated assmoketestafter the expected407challenges)..\test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1 -ProxyAuth Kerberos -Suites AgentsWindow -Distribution Ubuntu -WslServerPath <WSL checkout of the branch> -WslNodePath <linux node> -Sandbox: passed (1 passing; after the expected407challenges, Squid logged only tunnels authenticated assmoketest@VSCODE.PROXY.TEST).Earlier, against Copilot runtimes built from github/copilot-agent-runtime#40748:
.\test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1 -ProxyAuth BasicPac -Distribution Ubuntu -WslServerPath ~/devel/vscode -WslNodePath <linux node> -Sandbox -CopilotRuntimePath <win32-x64 copilot-runtime.exe> -WslCopilotRuntimePath <linux-x64 copilot-runtime>: passed (local Windows and WSL Basic PAC sandbox suites, one login dialog each)..\test\smoke\scripts\run-agents-window-wsl-kerberos-proxy.ps1 -ProxyAuth Kerberos -Suites AgentsWindow -Distribution Ubuntu -WslServerPath ~/devel/vscode -WslNodePath <linux node> -Sandbox -WslCopilotRuntimePath <linux-x64 copilot-runtime>: passed (after the expected407challenges, Squid logged only tunnels authenticated assmoketest@VSCODE.PROXY.TEST).cd test/smoke && pnpm run compile: passed.pnpm run oxlint test/smoke/src/areas/agentsWindow/agentsWindow.test.ts test/smoke/src/areas/chat/shellScenarios.ts test/automation/src/chat.ts scripts/chat-simulation/common/mock-llm-server.ts: passed.cd build && node --test lib/test/testCheckpointTemplates.test.ts: 14 of 15 passed; the remaining test compares\and/path separators on Windows and fails the same way without this change.