nulltickets icon indicating copy to clipboard operation
nulltickets copied to clipboard

Deterministic errors burn max_attempts — need client-forced dead-letter

Open addadi opened this issue 3 months ago • 0 comments

Problem

POST /runs/{id}/fail dead-letters only when fail_count >= max_attempts. For deterministic errors (e.g. bad pipeline/definition config, missing workflow for the pipeline), retries can never succeed, yet the task:

  • with max_attempts NULL → retries forever
  • with max_attempts set → burns the full attempt budget before dead-lettering

The failing agent knows the error is non-transient, but has no way to tell the server.

Proposal

POST /runs/{id}/fail accepts optional "dead_letter": true:

  • skip the max_attempts check, take the dead-letter branch immediately
  • dead_letter_reason = 'client_requested' (vs max_attempts_exceeded)
  • next_eligible_at_ms = impossible timestamp → excluded from claim SQL, same as existing dead-letter flow
  • dead_letter_stage routing still honored if defined

Default false — existing behavior unchanged.

PR incoming: feat/fail-dead-letter-flag.

addadi avatar Aug 22 '26 14:08 addadi