Skip to content

Add suspend and resume reason parity with .NET #223

Description

@andystaples

Summary

The protobuf SuspendRequest and ResumeRequest messages both include an optional reason field, and the .NET Durable Task client exposes that field through its suspend and resume APIs. Python currently sends only instanceId, so callers cannot record why an orchestration was suspended or resumed.

Current behavior

Both the synchronous and asynchronous Python clients construct these requests without reason:

pb.SuspendRequest(instanceId=instance_id)
pb.ResumeRequest(instanceId=instance_id)

The public methods likewise accept only instance_id.

Expected parity

Add an optional keyword-only reason: str | None = None parameter to the sync and async suspend/resume methods and serialize it into the corresponding protobuf request.

.NET reference:

Acceptance criteria

  • Sync and async suspend methods accept an optional reason.
  • Sync and async resume methods accept an optional reason.
  • Reasons are serialized into SuspendRequest.reason and ResumeRequest.reason.
  • Omitting a reason preserves existing behavior.
  • Unit tests cover populated and omitted reasons.

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