Visitar URL original
sessions: Link Dev Container sandbox guidance to documentation by chrmarti · Pull Request #345007 · microsoft/vscode · GitHub
Skip to content

sessions: Link Dev Container sandbox guidance to documentation - #345007

Merged
Christof Marti (chrmarti) merged 1 commit into
mainfrom
chrmarti/devcontainer-sandbox-learn-more
Oct 30, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
mainfrom
chrmarti/devcontainer-sandbox-learn-more

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #340841

When sandboxing is on, Dev Container sessions start with Docker options (unconfined seccomp, AppArmor and system paths, plus /dev/net/tun) that relax the container's isolation. The Sandboxing in Dev Container toggle's hover listed these options inline. This PR moves the details into the documentation:

  • Shorter hover: the hover no longer lists the options but still says they relax the outer container's isolation. The same text remains the switch's accessible name.
  • Learn More action: the Agents window permission picker adds a Learn More hover footer action that opens https://aka.ms/vscode-sandboxing-devcontainers. It also appears when the container was started without the required options, with the "recreate the container" guidance.
  • Keyboard access: the hover uses tabThroughPanel and expandable (indicator hidden), so keyboard users reach Learn More with Tab or Right Arrow from the focused row.
  • Refactor: the hover setup is now one helper shared by the initial item build and the in-place refresh in watchSandboxToggle.

Documentation: microsoft/vscode-docs#10560 (merged into vnext) adds the Use sandboxing in Dev Containers section.

Notes for reviewers

  • The aka.ms link is set up: it redirects to https://code.visualstudio.com/docs/agents/run/agent-sandboxing?referrer=in-product#_use-sandboxing-in-dev-containers. The section is merged into vscode-docs vnext (Document Docker options required for Dev Container sandboxing vscode-docs#10560) and goes live with the next release.
  • Known keyboard limitation: when the container lacks the options and sandboxing is off, the row is disabled. Action-list keyboard navigation skips disabled rows, so Learn More is reachable by mouse only in that state. Policy-locked rows already behave this way, so it is unchanged here.

How to test

  1. In the Agents window, start a new Copilot session in a Dev Container. Make sure sandboxing is available.
  2. Open Permissions and hover the Sandboxing in Dev Container row. The hover shows the shorter explanation and a Learn More footer action that opens the docs link.
  3. With the keyboard, focus the row and press Tab. Focus moves to Learn More, and Enter opens the link.
  4. Reuse a container that was started without sandboxing. The unavailable guidance also offers Learn More.

Validation

  • scripts\test.bat --reporter dot --run src/vs/platform/agentHost/test/browser/agentHostSandboxToggle.test.ts --run src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/permissionPicker.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostPermissionPickerDelegate.test.ts: passed (118 tests, including 2 new regression tests)
  • npm run typecheck-client: passed
  • npm run eslint -- <changed files>: passed

Shorten the Dev Container sandbox toggle hover so it no longer lists each Docker option inline, and add a keyboard-reachable Learn More hover action that opens the new documentation section, including for containers started without the required options.

Fixes #340841

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Learn More action depends on an uncreated aka.ms redirect and still-draft documentation, requiring maintainer confirmation of publication and the live redirect destination before shipping.

No open issues 🎉

What changed in this PR

Addresses #340841 by moving detailed Dev Container sandboxing guidance out of the Agents window permission picker and linking to documentation, while retaining the isolation warning.

Changes:

  • Shortens the sandbox toggle’s hover text and accessible name.
  • Shares hover setup between initial rendering and refresh, adding a Learn More action with keyboard access on enabled rows.
  • Adds regression tests for documentation links and keyboard focus, and updates the expected guidance text.
File Description
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​permissionPicker.test.ts Tests documentation actions and keyboard focus for Dev Container guidance.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​permissionPicker.ts Centralizes hover setup and adds the documentation action.
src/​vs/​platform/​agentHost/​test/​browser/​agentHostSandboxToggle.test.ts Updates the assertion for the shortened guidance.
src/​vs/​platform/​agentHost/​browser/​agentHostSandboxToggle.ts Removes inline Docker option details while preserving the isolation warning.

Review effort: Balanced

@chrmarti
Christof Marti (chrmarti) merged commit 3d6b819 into main Oct 30, 2026
56 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/devcontainer-sandbox-learn-more branch October 30, 2026 08:14
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 30, 2026
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.

Dev Containers sandboxing: link to documentation instead of inline details for auto-added container options

3 participants