Repository navigation
feat(sandbox-kubernetes): expose claim lifetime in harness options - #4170
Merged
Merged
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
ningmao-hlyz
force-pushed
the
feat/sandbox-claim-ttl
branch
from
November 14, 2026 17:02
9e21629 to
8999647
Compare
Contributor
|
Locally validated PR head Validation:
Scope: this validates the connected Harness → API server → agent-sandbox controller → Kubernetes GC resource cleanup path. Envtest has no scheduler/kubelet, so a fixture supplied Pod Ready/IP status; no actual containers were started. Runtime command execution, termination of running container processes, and PVC data cleanup were not tested. This was targeted validation, not a full Maven build. |
The two accessors and the spec builder sit next to setters that carry no Javadoc, so the blocks only restated the signatures. The lifetime rule they documented is in `docs/dev/*/docs/harness/sandbox.md`.
jujn
approved these changes
Nov 18, 2026
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.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
A sandbox whose host process is killed stays claimed until someone deletes the
SandboxClaimby hand. This exposes the SDK's existingshutdownAfterSecondsoption through the Kubernetes harness client and the filesystem spec, so an application can hand reclamation to the controller when it exits without shutting its sandbox down. The default staysnull, i.e. claims are created without a lifecycle exactly as before.KubernetesSandboxClientOptions.setShutdownAfterSeconds(Long)rejects zero and negative values;KubernetesFilesystemSpec.shutdownAfterSeconds(Long)exposes the same option while building a filesystem.create(...)writesspec.lifecycle = {shutdownTime, Delete}only when the value is set.copy(...)andmerge(...)preserve it, and a per-callnullinherits the client template.docs/dev/{en,zh}/docs/harness/{sandbox,filesystem}.mddescribe the setting and the workspace/snapshot boundary it interacts with.Validation
mvn -o -B -T1C -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Djacoco.skip=true -DskipDurableWindowsTests=true clean verify— 12,977 tests, 0 failures/errors, 246 skipped. An unfiltered run fails in unchanged durable-sandbox tests because this shell has nosh.spotless:applyandspotless:checkclean for the module.KubernetesClaimLifetimeTestcover the request body, per-call overrides, null inheritance and invalid values; removing the create-time forwarding fails four of them.eb1899403; License, Module Sync and CLA pass too.Known limits
The tests assert the
SandboxClaimPOST body through Fabric8. Controller-side expiry and PVC reclamation need a real cluster and are not covered here.Checklist
mvn spotless:applymvn test)