Skip to content

[Feature]: Expose SandboxClaim lifetime in the Kubernetes harness adapter #4169

Closed

Description

@ningmao-hlyz

Is your feature request related to a problem? Please describe.

The Kubernetes harness adapter cannot configure a SandboxClaim lifetime. At a4306d63, the lower-level CreateSandboxOptions already accepts shutdownAfterSeconds, and K8sHelper writes spec.lifecycle.shutdownTime with shutdownPolicy: Delete when that value is non-null. KubernetesSandboxClient.create() never supplies it, and the harness options/spec do not expose it.

If the application exits before shutdown(), a claim created through the harness has no configured lifetime and can remain until explicitly deleted.

Describe the solution you'd like

Expose an optional positive shutdownAfterSeconds on KubernetesSandboxClientOptions and KubernetesFilesystemSpec, and carry it through option copying, per-call merging and claim creation. Keep the default null so existing long-running tasks are unaffected. A null per-call value should inherit the client template.

The lifetime should start at creation and remain unchanged on resume. Document that expiry can remove a workspace without a snapshot.

Describe alternatives you've considered

Applications can use the lower-level SDK directly or run an external claim sweeper. Passing through the existing SDK option would make the same opt-in behavior available to harness users.

Additional context

Version: 2.1.0-SNAPSHOT. Related to the lifecycle portion of #2944; sandbox reuse, idle-time eviction and multi-tenant concurrency remain separate concerns. Validation uses a loopback Kubernetes API to inspect the actual claim request; controller-side expiry has not been tested against a cluster.

Activity

  1. XuXcode commented on Nov 18, 2026

    @XuXcode

    I'd like to work on this issue. Is it still available?

  2. ningmao-hlyz commented on Nov 19, 2026

    @ningmao-hlyz
    ContributorAuthor

    I'd like to work on this issue. Is it still available?

    already done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions