Repository navigation
Conversation
Add a provider `stop` op for a wedged Agent Sandbox session. It takes the deploy payload, requires provider_config.sandbox and an approved identity_policy before any cluster contact, and sets lifecycle=ending, reason stopped, and operatingMode Suspended in one resourceVersion CAS merge patch (retried on conflict). The controller then deletes the Pod with SIGTERM, so the harness keeps its checkpoint window; the normal stop remains !shutdown. `info` now advertises `ops`, additive within protocol version 1, so the desktop can gate its session controls on `stop`. Adds wire tests, a refusal fixture, and fake-apiserver coverage for the CAS patch. Signed-off-by: Tee8z <tee8z@protonmail.com>
tee8z
force-pushed
the
dev-2884-explicit-stop
branch
from
October 19, 2026 23:28
77ea3f1 to
a6f2aec
Compare
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
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.
A wedged Agent Sandbox session can ignore
!shutdown, and the provider had no op to end it.This PR adds a provider
stopop. It suspends the Sandbox, so the controller deletes the Pod withSIGTERM.The harness still gets its checkpoint window. The normal stop stays
!shutdown.The
stoprequest is thedeployrequest with"op": "stop".Before any cluster contact,
stop_session()requiresprovider_config.sandbox, an approvedidentity_policy, and a verified launch owner.stateabsentlifecycle=endedendedlifecycle=endingendinglifecyclevalueendingThe merge patch carries the observed
metadata.resourceVersion. It setsbuzz.block.xyz/lifecycle=ending,buzz.block.xyz/ended-reason=stopped, andspec.operatingMode: Suspended.On
409 Conflict,stop()reads the Sandbox again, for at most 5 attempts. Then it returnsSandbox kept changing while stopping; retry.infonow returnsops: ["info", "deploy", "stop"]. The field is additive within protocol version 1, so the desktop can gate session controls onstop.Stack
Position 10 of 20 in the DEV-2884 Buzz stack. Base: #15. Next: #2.
Validation
cargo fmt --check -p buzz-backend-kubernetes: pass.cargo clippy -p buzz-backend-kubernetes --all-targets -- -D warnings: pass.cargo test -p buzz-backend-kubernetes: lib 12 passed; bin 177 passed, 1 ignored;wire_fixtures5 passed.stop_suspends_with_a_cas_patch_and_retries_conflictsstop_requires_sandbox_scope_and_identity_policy_before_cluster_contactparses_stop_with_the_deploy_payload,stop_response_serializes_flat,info_advertises_stopstop-no-identity-policywire fixture.Limits
live_controller_reuses_scopes_and_refuses_lost_workspacesneeds thekind-remote-agent-checkcluster. It was not run. Its new stop steps were compiled only.stoprequest withsandbox.recoveryfails options parsing (deny_unknown_fields). The recovery PR adds the explicit refusalstop does not accept a recovery mode.lifecycle::CHECKPOINTand skips the recovery steps.deploy-sandbox-bad-recovery.