Skip to main content

Module operation_id

Module operation_id 

Source
Expand description

Client-supplied operation-id resolution.

Commands that advertise supports_op_id: true in the command catalog accept --op-id <UUID> or HEDDLE_OPERATION_ID. The local CLI reserves the id before dispatch, records stdout/stderr/exit status, and replays that recorded result for the same command body. Reusing the id with different arguments fails with a typed conflict.

Commands that advertise persists_op_id: true may additionally generate and save an op-id for interrupted retry loops. Current explicit replay support does not imply generated persistence.

Functions§

clear_persisted_op_id
Drop the persisted op-id for verb. Called after a successful response — releases the slot so the next run gets a fresh id rather than replaying.
resolve_operation_id
Canonical helper used by every state-changing dispatch arm in main.rs. Validates the --op-id format eagerly so a malformed value fails before the verb starts work.
resolve_or_persist_for_verb
Resolve the op-id for a verb that opts into ^C → re-run persistence. Order:
run_local_idempotency_if_requested
supports_local_op_id
wire
Same as resolve_operation_id but returns the wire-string form expected by gRPC requests. "" means “no idempotency for this call”.