Repository navigation
fix(local): isolate native disk state and preserve startup ownership - #814
Merged
earakely-scale merged 4 commits intoNov 23, 2026
Merged
Conversation
… an unconfirmed one settles The start marker stayed when `docker run` exited with an error before creating the container (the daemon unreachable, or unable to pass /dev/kvm), so every teardown after it failed with "not confirmed" and the sandbox folder could never be removed. A docker that exits with an error has made its container already, which teardown lists, or never will, so its marker goes; one a signal killed keeps it. A marker with no container behind it settles ten minutes after the launch, so a timed-out start can be torn down then. The computers README says the device must be group-writable, as the launcher now runs as the user with its group, and AGENTS.md's teardown paragraph says what a missing Docker CLI and an unconfirmed launch do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docker reads --mount's value as one CSV row, so a sandbox folder or state root whose path held a comma split into another option and the launcher refused to start. Its state and trust mounts quote a field that needs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Composing a computer env native-only is a computer-specific knob that nothing in the repository passes to prepare_bundle; this pull request is about how local Docker boots disks. run_bundle and dry_run_bundle keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
force-pushed
the
fix/local-native-disk-state
branch
from
November 23, 2026 18:38
d93f5e0 to
be850c8
Compare
Comment on lines
+870
to
+871
| state_args = ("--mount", _bind(state, "/var/lib/agentenv-vm"), | ||
| "--user", f"{os.getuid()}:{os.getgid()}", "--group-add", str(os.stat(KVM).st_gid)) |
There was a problem hiding this comment.
If a user composes a thin disk under umask 077, the new --user prevents the launcher from reading its guest file. thin_disk.pack writes that file with the host's permissions, then copies it into the image as UID 107 without changing its mode. The usual host UID cannot read it, so launch exits at guest=$(cat "$folder/guest") before booting Windows or Omarchy. Make the required disk files readable by the launcher before switching users.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/providers/sandbox_providers/local_docker/provider.py
Line: 870-871
Comment:
**Thin disks cannot boot**
If a user composes a thin disk under `umask 077`, the new `--user` prevents the launcher from reading its `guest` file. `thin_disk.pack` writes that file with the host's permissions, then copies it into the image as UID 107 without changing its mode. The usual host UID cannot read it, so `launch` exits at `guest=$(cat "$folder/guest")` before booting Windows or Omarchy. Make the required disk files readable by the launcher before switching users.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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.
Local native-disk preparation can reject a usable KVM device because the CLI
user cannot open it directly, even though Docker can. VM overlays also need
an owned host directory and reliable cleanup when container startup finishes
late or times out.
This change:
the launcher with the directory owner's UID/GID, and grants its KVM group.
and preserves state when creation or cleanup has an unknown outcome.
This is a generic local Docker disk change and has no HCU or model dependency.
Validation
make lintpasses.changes. Its staged driver installation, AX query and screenshot complete.
The docs should describe Docker's KVM access
and the sandbox-owned VM state directory.
Fix thin-disk file access before merging; users with
umask 077otherwise lose Windows and Omarchy startup.Fix with agent prompt
Summary
The PR moves writable VM state into each sandbox's work directory and records ownership before Docker starts.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Create sandbox work directory] --> B[Create owned VM state directory] B --> C[Write ownership and pending markers] C --> D[Start Docker launcher as host user] D --> E{Launch outcome} E -->|Success| F[Clear pending marker] E -->|Failure or cancellation| G[Attempt teardown] G --> H{Removal confirmed?} H -->|Yes| I[Remove work directory] H -->|No| J[Keep state for retry]Reviews (7) · Last reviewed commit: "revert(bundle): leave prepare_bundle wit..." · Reviewed by Greptile