fix(sandbox-kubernetes): support claim lifecycle retention - #2980
Open
guslegend0510 wants to merge 3 commits into
Open
fix(sandbox-kubernetes): support claim lifecycle retention#2980guslegend0510 wants to merge 3 commits into
guslegend0510 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
CryoThrust
reviewed
Sep 4, 2026
CryoThrust
left a comment
There was a problem hiding this comment.
I traced the lifecycle paths against the reported resume failure. The ownership resolution and the preserved seven-argument createSandboxClaim overload look consistent with the compatibility goal.
Two points that may be worth making explicit before merge:
- For an already-persisted
KubernetesSandboxState,claimOwnedremains whatever was serialized previously unless the caller supplies an explicitclaimOwnedoption. That is a reasonable migration choice, but it means an existing state created with the old default still deletes its claim on release. Could the documentation or a regression test state this migration behavior explicitly? ttlSecondsAfterFinishedis serialized intospec.lifecyclealongsideshutdownTimeandshutdownPolicy. Please confirm that the deployed agent-sandbox CRD/controller version accepts this field and ignores it safely when unsupported; a small serialization assertion or compatibility note would make the rollout contract clearer.
The immediate missing-claim failure is a useful improvement for this issue because it removes the 30-second watch wait. I did not find a competing change in the open PR list beyond this PR, so I am leaving this as review feedback rather than opening a duplicate implementation.
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.0.3-SNAPSHOT
Description
Fixes #2979.
Kubernetes sandbox claims were always treated as client-owned. Releasing a sandbox therefore deleted its
SandboxClaim, while the persisted agent state still referenced that claim. The next call attempted to resume the deleted claim and waited for the watch timeout before creating a replacement.This PR:
claimOwned(boolean)for explicitly controlling deletion on release.shutdownAfterSeconds(long)as a hard controller-managed expiry.ttlSecondsAfterFinished(int)and serializes it toSandboxClaim.spec.lifecycle.Finished.createSandboxClaimoverload for source and binary compatibility.Lifecycle behavior
shutdownAfterSeconds: release only disconnects; the controller deletes the claim at the configured deadline.ttlSecondsAfterFinishedonly: client ownership remains enabled by default.claimOwned(false)can explicitly retain a claim when the runtime is guaranteed to reachFinished.Verification
git diff --checkpassed.Checklist