Skip to content

SDK: recover once when syncCode cache expires before submission (2.0.52) #672

Open

Description

@miyaontherelay

Problem

A content-addressed syncCode prepare can report a cache hit, so the SDK skips upload. If that cache object expires before Cloud copies it at run submission, Cloud returns workflow_code_unavailable and terminalizes that admitted run without launching it. The current SDK has already disposed its packed archive and cannot recover an otherwise valid working tree.

Found on Flows #666. Target: 2.0.52.

Bounded recovery

Keep the packed snapshot through the first submission. Only when Cloud returns the exact workflow_code_unavailable no-launch refusal, prepare a new run ID without the cache shortcut, upload that same packed snapshot to the new run, and submit once. Never retry the terminalized run ID. Never retry a transport ambiguity or any other rejection. Dispose the snapshot after success or final failure.

Acceptance

  • Cache hit followed by workflow_code_unavailable creates exactly one fresh preparation, one upload, and one submission for a new run ID.
  • The retry is bounded to one fresh attempt, with the same snapshot bytes. Another refusal propagates.
  • Other errors and ambiguous submission outcomes cause no retry.
  • Tests prove the first run ID is not submitted again, the second uses the uploaded code, and the archive is cleaned up.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions