You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Custom volumeClaimTemplates are created but never mounted in the sandbox pod #967
Loaded the openshell-driver-kubernetes crate and traced the volume claim template lifecycle through sandbox_to_k8s_spec() and sandbox_template_to_k8s() in driver.rs.
Findings:
driver.rs:898-902: When the user provides volume_claim_templates via platform_config, user_has_vct = true and inject_workspace = false.
driver.rs:940-944: User VCTs are passed through to spec.volumeClaimTemplates on the Sandbox CR.
driver.rs:1129-1131: apply_workspace_persistence() is skipped entirely when inject_workspace is false — this is the only code path that adds PVC-backed volume mounts to the agent container.
driver.rs:1073-1082: The agent container spec only has hardcoded mounts for openshell-client-tls. No mechanism exists to mount user VCTs.
The SAG controller creates PVCs and injects corev1.Volume entries into the pod spec, but without a matching volumeMount the PVCs are unreachable.
No existing test covers the user-VCT-with-mount path — only workspace_persistence_skipped_when_inject_workspace_false (line 1912) which validates the absence of mounts.
Description
Actual behavior: When a user provides custom volume_claim_templates in the SandboxTemplate platform_config, the PVCs are created by the sig-agent-sandbox controller but no volumeMount entries are added to the agent container. The volumes exist in the pod spec but are never attached to any container.
Additionally, providing any custom VCT disables the default workspace persistence entirely — the /sandbox mount is lost with no way to restore it.
Expected behavior: User-provided VCTs should be mounted in the agent container at /sandbox (reusing the default workspace mount path). The seeding init container should be skipped for user VCTs since users are bringing their own storage.
Reproduction Steps
Create a SandboxTemplate with custom volume_claim_templates in platform_config
Create a sandbox using that template
Observe that PVCs are created in the cluster
Exec into the agent container — no PVC is mounted; data written to /sandbox is not persisted
Root Cause
apply_workspace_persistence() bundles two concerns into one all-or-nothing function:
Adding the volumeMount at /sandbox on the agent container
Adding the seeding init container that copies image content into the PVC
When inject_workspace = false (user provided VCTs), both are skipped. The mount should still be applied for user VCTs; only the seeding init container should be skipped.
Proposed Fix
Split apply_workspace_persistence() so the volume mount and the init container are independent:
Always mount user VCTs at /sandbox on the agent container
Only add the seeding init container when using the default workspace VCT (not user-provided)
This issue appears to have been opened without an agent investigation.
OpenShell is an agent-first project - please point your coding agent at the repo and have it diagnose this before we triage. Your agent can load skills like debug-openshell-cluster, debug-inference, openshell-cli, and generate-sandbox-policy.
The reported bug was valid in the implementation that existed when this issue was filed, but it is no longer reproducible or applicable on current main (614c8c164). The affected public SandboxTemplate.volume_claim_templates path was intentionally removed, and the supported storage model now requires explicit PVC volumes and mounts in Kubernetes driver config.
Investigation
Merged PR refactor(api): remove SandboxTemplate.volume_claim_templates #2088 removed SandboxTemplate.volume_claim_templates, reserved its protobuf field and name, removed server pass-through/validation, and deleted the user_has_vct branching that caused the missing /sandbox mount.
Current proto/openshell.proto reserves volume_claim_templates; a current client, including raw protobuf clients, cannot submit the reproduction described here.
Merged PR feat(kubernetes): support PVC subPath driver config #2034, now at the tip of main, adds driver_config.kubernetes.volumes[] for existing PVCs and containers.agent.volume_mounts[] for explicit mount targets and optional sub_path.
Current tests verify that explicit /sandbox driver-config mounts render the PVC volume and matching agent volumeMount, and suppress the default workspace VCT/init container.
The original proposed fix no longer fits the current API: implicitly assigning arbitrary claim templates to /sandbox is ambiguous when multiple claims exist. The replacement API uses explicit claim-to-mount mapping.
Recommendation
Close this issue as superseded by #2088 and #2034. If OpenShell-created custom per-sandbox claim templates are still required, file a new feature proposal against the current typed Kubernetes driver_config model with explicit claim-to-mount and lifecycle semantics. This issue should not be routed to a spike or marked state:agent-ready.
Activity
github-actions commentedon Apr 24, 2026
This issue appears to have been opened without an agent investigation.
OpenShell is an agent-first project - please point your coding agent at the repo and have it diagnose this before we triage. Your agent can load skills like
debug-openshell-cluster,debug-inference,openshell-cli, andgenerate-sandbox-policy.See CONTRIBUTING.md for the full workflow.
TaylorMutch commentedon Jul 10, 2026