Repository navigation
feat: add uf sandbox command for containerized OpenCode sessions (Spec 028) - #93
Merged
Merged
Conversation
…c 028) - Add internal/sandbox/ package (3 source files: sandbox.go, detect.go, config.go) with Start, Stop, Attach, Extract, Status operations following Options/ExecCmd injection pattern - Add cmd/unbound-force/sandbox.go with 5 Cobra subcommands (start, stop, attach, extract, status) and flags (--mode, --detach, --image, --memory, --cpus, --yes) - Platform detection: macOS/Linux arch, SELinux :Z flag - Health check polling with exponential backoff (500ms->5s, 60s) - Dead container cleanup before start - Google Cloud credential forwarding (GOOGLE_CLOUD_PROJECT, VERTEX_LOCATION) and service account / ADC file mounting - git format-patch / git am for change extraction - Add 39 test functions covering all public functions, error paths, platform detection, and config builders - Add spec artifacts (spec, plan, tasks, research, data-model, quickstart, contracts)
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.
Summary
Adds
uf sandboxcommand with 5 subcommands (start,stop,attach,extract,status) for containerized OpenCode session management via Podman.Closes #91
What It Does
uf sandbox start: Checks prerequisites (Podman, OpenCode), detects platform (macOS/Linux, SELinux), pulls image if needed, starts container with API key forwarding and resource limits, waits for health check with exponential backoff (500ms->5s, 60s timeout), and attaches TUI (or prints URL in--detachmode)uf sandbox extract: Generates patches viagit format-patchinside container, displays summary, applies viagit amon confirmationuf sandbox stop: Idempotent container stop + removeuf sandbox status: Parsespodman inspectJSON for container state, uptime, mounts, modeuf sandbox attach: Delegates toopencode attachKey Design
--mode isolated(read-only mount, default) and--mode direct(read-write):Zflag: Auto-detected on Linux via /etc/selinux/configuf-sandbox, one at a timeFiles
internal/sandbox/sandbox.go,detect.go,config.go,sandbox_test.gocmd/unbound-force/sandbox.go,main.gospecs/028-*/39 test functions, all passing with
-race -count=1.