Repository navigation
feat: support custom sandbox entrypoint command #848
Description
Problem Statement
The sandbox always runs sleep infinity — hardcoded in the k8s driver. There's no API field to override this.
I'm integrating Coder workspaces with OpenShell sandboxes via the Terraform provider. The e2e flow works but the Coder agent has to be manually bootstrapped after sandbox creation — there's no way to run a custom entrypoint at startup. The only workaround is openshell sandbox exec after the sandbox reaches Ready, which can't be expressed declaratively in Terraform.
I imagine this would affect any orchestrator that needs to run a process inside the sandbox at creation time.
Proposed Design
I think the minimal change would be adding a command field to SandboxSpec and threading it through to the k8s driver. When set, the driver writes it to OPENSHELL_SANDBOX_COMMAND instead of sleep infinity. When empty, behavior is unchanged.
The sandbox supervisor already reads from OPENSHELL_SANDBOX_COMMAND and supports arbitrary commands — the gap is just that the k8s driver always overwrites it.
The files I think would need changes (though I might be missing something):
proto/openshell.proto— addrepeated string commandtoSandboxSpecproto/compute_driver.proto— add the same toDriverSandboxSpeccrates/openshell-server/src/compute/mod.rs— pass it throughdriver_sandbox_spec_from_publiccrates/openshell-driver-kubernetes/src/driver.rs— usespec.commandinapply_required_envinstead of the hardcoded value
Alternatives Considered
- Override via environment map — I tried passing
OPENSHELL_SANDBOX_COMMANDthrough the sandbox'senvironmentfield in Terraform. Doesn't work —upsert_envinapply_required_envoverwrites user-provided values. - Post-creation exec — Using
openshell sandbox execafter the sandbox reaches Ready. This works but adds latency, requires polling, and can't be automated declaratively through Terraform. - Bake into the image — Tried building a custom image with an entrypoint. The sandbox supervisor ignores the image's
ENTRYPOINT/CMDand runsOPENSHELL_SANDBOX_COMMANDdirectly.
Agent Investigation
- Traced
OPENSHELL_SANDBOX_COMMANDfrom the supervisor (crates/openshell-sandbox/src/main.rs) through the k8s driver (driver.rs:1284) — confirmed the hardcoding - The supervisor already supports arbitrary commands (CLI args → env var →
/bin/bashfallback), so no supervisor changes should be needed - The gateway maps public spec → driver spec in
driver_sandbox_spec_from_public(crates/openshell-server/src/compute/mod.rs:617) - Tested all three alternatives above against a live gateway (v0.0.28)
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
Activity
matifali commentedon May 11, 2026
Hi @kirit93 and @johntmyers, what do we think of issues that are assigned but are removed from the Roadmap? Thanks. Please let me know if you are open to contributions to this improvement.
TaylorMutch commentedon Jul 13, 2026
Supporting custom sandbox entrypoint is on our radar. There are a few other changes in flight but I think this is likely a good candidate in the near future.
[-]support custom sandbox entrypoint command[/-][+]feat: support custom sandbox entrypoint command[/+]github-actions commentedon Aug 29, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
matifali commentedon Aug 30, 2026
bumping
github-actions commentedon Sep 16, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
matifali commentedon Sep 17, 2026
bumping
matifali commentedon Sep 25, 2026
@johntmyers can you also link to docs on how to do this?