Repository navigation
fix(sandbox): keep the mutation worker offline - #14733
Merged
Merged
Conversation
The filesystem worker changes files only and does not need network access. Confining it with the session network mode sends it through the Linux network relay in proxy mode. The relay removes BUN_BE_BUN, so the binary starts the CLI instead of the worker and returns no response. This made write and edit fail on Linux with allowed_hosts set, with "Filesystem worker returned an invalid response".
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
October 2, 2026 13:39
chrarnoldus
approved these changes
Oct 2, 2026
This was referenced Oct 3, 2026
This was referenced Oct 7, 2026
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.
What Problem This Solves
On Linux, with the sandbox enabled and
allowed_hostsset, thewriteandedittools fail with:File changes through
bashstill work.Why This Change Was Made
writeandeditwrite files through a separate filesystem worker. Kilo starts that worker by running its own binary withBUN_BE_BUN=1, which makes the binary run the worker script instead of the CLI.When
allowed_hostsis set, the sandbox network mode isproxy. On Linux, proxy mode sends every sandboxed process through a network relay. The relay removesBUN_BE_BUNbefore it starts the command. That is correct for user shell commands, but it breaks the worker: the binary starts the CLI instead. The CLI writes nothing to stdout, so Kilo reports an invalid response. The CLI also tries to write to its own data folder, which the sandbox denies. That matches the report of a write under.local/share/kilo/tool-output.The regression came from #12075, which added the relay and its
delete environment.BUN_BE_BUNline. Before that PR there was no relay.User Impact
writeandeditwork on Linux again when the sandbox allows specific hosts. The worker now always runs with network access off, which it does not need. Filesystem write rules and all other commands are unchanged.Evidence
Reproduced and verified in an Ubuntu 24.04 arm64 container with
bubblewrap, using the official@kilocode/cli-linux-arm64@7.8.1package and a local OpenAI-compatible server that answers with awritetool call.allowed_hosts[](deny mode)["api.github.com"]Unknown: Sandbox.mutate (/work): Filesystem worker returned an invalid response["api.github.com"][]Direct worker check on 7.8.1: with
BUN_BE_BUN=1it returns{"ok":true}. Without it, the binary starts the CLI, printsFailed to change directory to .../kilo-sandbox-mutation-worker.js, writes nothing to stdout, and exits with code 0.Checks:
packages/kilo-sandboxtests (61 pass),packages/kilo-sandboxtypecheck, andpackages/opencodesandbox tests (103 pass).Fixes #14719.