Repository navigation
Commit 7b1e7a7
committed
feat(agents): recover ended Sandbox sessions explicitly
An ended session is resumed only when the desktop sends
provider_config.sandbox.recovery for one click: {"mode":"checkpoint"}
restores the tombstone's verified checkpoint, {"mode":"fresh"} starts
with an empty workspace. Recovery is refused on anything that is not an
Ended, Suspended tombstone, so a live workspace is never discarded, and
checkpoint mode is refused when the tombstone has no checkpoint key.
Every refusal carries a typed code (session_active, session_ending,
no_ended_session, no_checkpoint, recovery_interrupted,
recovery_mode_conflict) that the desktop branches on.
Before it deletes the tombstone, the provider preserves it in an
immutable <sandbox>-recovery journal Secret without an owner reference.
Journal validation checks object identity and ownership. A retry
resumes from the journal after an interrupted delete/create; an ordinary
deploy refuses an unfinished recovery. A retry reuses a replacement that
was already created only for the same mode and checkpoint key; a retry
in the other mode is refused and the journal is kept. Deletion uses uid
and resourceVersion preconditions. Recovery then waits up to one drain
grace (the shared 300-second termination grace) for the old owned Pod
to disappear, so that with the binding and startup waits it ends inside
the 600-second operation deadline, and creates the replacement under a
new generation with recovered-from. The journal is removed once the
replacement is bound; a failed removal is reported on stderr and
retried by the next deploy.
Signed-off-by: Tee8z <[email protected]>1 parent 4d98c30 commit 7b1e7a7
12 files changed
Lines changed: 1290 additions & 28 deletions
File tree
- crates/buzz-backend-kubernetes
- src
- tests
- fixtures/provider-wire
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
433 | 441 | | |
434 | 442 | | |
435 | 443 | | |
| |||
0 commit comments