microsoft / microsoft/vscode

Testing: Agent host dev container sessions cannot run terminal commands with sandboxing enabled

Open
#335,755 0 comments 0 reactions 1 assignee Assigned to @chrmarti View on GitHub
agent-host bug containers
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Testing #335485

## Summary

A new Agent Host session in the Node.js Dev Container sample could edit files, but it could not run terminal commands because the container did not include the required sandbox dependencies.

This prevented the agent from running the application, testing it with `curl`, creating a branch, or committing its changes.

## Environment

- VS Code: 1.138.0-insider
- OS: Bluefin 44, Linux
- Docker Engine: 29.7.2
- Repository: https://github.com/microsoft/vscode-remote-try-node
- Dev Container image: `mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye`
- Container OS: Debian 11 (Bullseye)
- `chat.agent.sandbox.enabled`: `on`
- `chat.remoteAgentHostsEnabled`: `true`
- `chat.agentHost.devContainer.enabled`: `true`

## Steps to Reproduce

1. Clone `microsoft/vscode-remote-try-node` locally.
2. Enable Remote Agent Hosts and Dev Container Agent Host sessions.
3. Start a new Agent Host session for the folder using **Dev Container**.
4. Ask the agent to:
- Add a `/health` endpoint.
- Run the application.
- Test the endpoint using `curl`.
- Create a private branch and commit the changes.
5. Wait for the agent to invoke a terminal command.

## Actual Behavior

The file-editing tools worked, and the agent correctly modified `server.js` and `README.md`.

Every terminal command failed because Bubblewrap was unavailable. The agent reported:

> The bash tool itself is broken in this sandbox environment—it requires Bubblewrap (`bwrap`), which isn't installed. I can't run any shell commands, including `node`, `curl`, or `git`, right now.

The sample container was also missing `socat`.

After manually installing Bubblewrap and Socat, a direct Bubblewrap probe still failed:

```text
bwrap: No permissions to create new namespace, likely because the kernel does not allow non-privileged user namespaces.
```

The existing Agent Host session continued reporting a sandbox runtime failure. The workflow could only be completed after temporarily setting:

```json
"chat.agent.sandbox.enabled": "off"
```

and reloading the window.

## Expected Behavior

An Agent Host session using a supported Dev Container should be able to run terminal commands with the default sandbox configuration.

The Dev Container startup path should either:

- Provision the required sandbox dependencies and support nested sandboxing, or
- Detect that sandboxing cannot run in the container and present an immediate, actionable remediation.

It should not allow the workflow to proceed into a state where file tools work but every shell command is unusable.

## Additional Information

The Dev Container itself started successfully, `postCreateCommand` completed, and the in-container Agent Host connected correctly. The failure was specific to executing terminal tools with sandboxing enabled.

## Screenshot

The question and missing-Bubblewrap explanation became visible after reloading the window:

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.