Skip to content

feat(cli): re-stage a --from rootfs archive when a create retry finds its staging token spent #5898

Open

Description

@EmilienM

Title: feat(cli): re-stage a --from rootfs archive when a create retry finds its staging token spent

User Story

I create sandboxes with openshell sandbox create --from <rootfs.tar> on gateways where burst creation keeps the mutation lock busy. When an attempt loses the SSH identity lock step, the gateway consumes the staged archive, so the retry finds its single-use staging token spent and the create ends with the raw FAILED_PRECONDITION instead of completing.

Description

Reintroduce re-staging into the create retry loop. When the gateway reports the staging token spent, stage the same archive again and re-send the create, bounded by the retry budget and the caller's staging-slot quota. Guard-timeout retries must keep reusing the still-valid token, since the pre-record guard rejects before the archive is consumed.

The first revision of #5745 carried an implementation (is_rootfs_tar_staging_token_spent, restage_rootfs_tar_for_retry, replace_rootfs_tar_staging_token in crates/openshell-cli/src/run.rs) with a matching test suite; it was split out during review to keep the PR small.

Context

Definition of Done

  • A --from create that loses the SSH identity lock step re-stages the archive and completes within the retry budget
  • Guard-timeout retries reuse the outstanding token without spending staging slots
  • A spent token past the retry budget surfaces the annotated error without another send or staging slot
  • Tests cover the re-stage, the slot quota, and the budget stop

Activity

  1. added
    state:triage-needed
    on Nov 23, 2026
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

    state:triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions