Skip to content

refactor: share the create-retry loop driver between the CLI and the SDK #5900

Open

Description

@EmilienM

Title: refactor: share the create-retry loop driver between the CLI and the SDK

User Story

I maintain the CLI and SDK create paths. Both implement the same retry loop (lock-timeout retry, AlreadyExists phase poll, budget accounting) on top of the shared decision layer, and I need them driven by one implementation so their behavior cannot drift.

Description

Extract the create-retry loop into a shared driver, generic over the transport and error surface, with hooks for the CLI's stderr progress and miette shaping. The decision layer in openshell-core (create_retry) is already shared; this covers the loop plumbing around it.

Context

  • Raised in the feat: retry sandbox creates on mutation lock timeouts #5745 review round and deferred to keep that PR small.
  • The CLI needs raw proto requests and responses, miette reports, and stderr progress; the SDK needs SdkError and SandboxRef, so the driver needs an adapter trait rather than a shared error type.

Definition of Done

  • One driver implements the loop; the CLI and the SDK adapt it
  • The existing SDK mock and CLI integration tests keep their behavior
  • The shared invariants (attempt cap, budget, holder provenance) are tested once, in the driver

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