feat(agent-manager): add sandbox toggle to new worktree modal - #11689
Merged
Conversation
Let users choose whether a worktree session starts in the sandbox from the Agent Manager New Worktree modal. The lock button mirrors the sidebar prompt sandbox toggle and is gated by the same features().sandboxControls flag. The CLI session.create endpoint exposes no sandbox parameter, so after each worktree session is created the provider reconciles its sandbox override to the user's choice via sandbox.status then sandbox.toggle (toggling only when the current state differs, so it is safe regardless of the global default). Sandbox setup is best-effort: failures are logged and the worktree stays usable with manual toggle available from the prompt. Visibility is forward-compatible with the sandbox experiment exposure work: the button is hidden until sandboxControls is available, so it requires no change to appear once that lands.
… modal Extract the sandbox lock toggle into a shared SandboxButtonBase component so the chat prompt and the Agent Manager New Worktree modal render the exact same control instead of duplicating the markup. The base accepts enabled/availability/ reason/disabled/onToggle props; the prompt wires live session sandbox state and the modal wires a local preference, but both surface identical visuals (lock icon, prompt-status-button active styling, tooltip, aria).
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Previous Review Summaries (2 snapshots, latest commit 26ea495)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 26ea495)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (6 files)
Previous review (commit 3a072e9)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Reviewed by gpt-5.4-20260305 · Input: 153.2K · Output: 15.8K · Cached: 1M Review guidance: REVIEW.md from base branch |
Require the sandbox experiment for the New Worktree control and omit the request field when the experiment is unavailable. Verify the selected sandbox state and routed directory before exposing each new session. If reconciliation fails, report the setup error, delete the fresh session and worktree, and skip the initial prompt so execution cannot continue unrestricted. Add SDK-backed reconciliation tests and update the shared prompt button contract test.
…rktree-sandbox # Conflicts: # packages/kilo-vscode/tests/unit/prompt-input-connection-guard.test.ts # packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
…rktree-sandbox # Conflicts: # packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
Place the New Worktree sandbox toggle in the right-aligned action group beside speech-to-text instead of grouping it with mode, model, and thinking selectors. Add a structural regression assertion for the action placement.
marius-kilocode
enabled auto-merge
June 25, 2026 14:05
RSO
approved these changes
Jun 26, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…rktree-sandbox feat(agent-manager): add sandbox toggle to new worktree modal
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.
The Agent Manager New Worktree modal cannot choose sandbox isolation before creating a session. Users must currently wait for each worktree session to appear and toggle sandbox afterward, which is especially cumbersome for multi-version worktrees.
This adds the same shared sandbox lock button used by the chat prompt to the New Worktree modal. The control is available in single-version and compare-models modes, requires both sandbox-control availability and the
experimental.sandboxopt-in, and sends the selected state with the worktree creation request.Because
session.createhas no sandbox parameter, Agent Manager reconciles the effective state immediately after creating each session and before registering it, marking the worktree ready, or sending its initial prompt. Reconciliation verifies the routed directory and final state, toggling only when needed. If sandbox setup cannot be confirmed, that version fails closed: Agent Manager reports the setup error, deletes the fresh session and worktree, and never sends the initial prompt under the wrong policy.