Skip to content

Add provider-aware partial retry with preserved lineage #368

Description

@acoliver

Problem

Provider failures have different operational meanings. HTTP 429 concurrency/quota responses, HTTP 529 overload, authentication/configuration failures, and network failures should not share one blind retry policy. Manual provider switches also lose the lineage needed to determine whether the same inputs were reviewed.

Across 145 retained OCR attempts, 19 partial runs carried HTTP 429 markers and six carried HTTP 529 markers. PR 306 added resumable sessions and failed-file checkpoints, but provider transitions, changed-input identity, and typed retry policy are not yet complete.

Desired behavior

Add provider-aware retry of only failed work while preserving immutable input identity and explicit retry lineage.

Acceptance criteria

  • Classify 429, 529, authentication/configuration, timeout, and network failures separately.
  • Support a provider-specific concurrency budget.
  • Apply bounded exponential backoff with jitter and honor server retry headers where present.
  • Retry only failed files/subtasks under the same immutable run manifest.
  • Cross-provider fallback is explicit configuration, never implicit.
  • Lineage records parent run/session, source and target provider/model, attempt number, changed configuration/inputs, reused files, completed files, and remaining failures.
  • A retry cannot create a storm of parallel duplicate requests.
  • Terminal completeness remains partial until all selected files complete or are explicitly waived.
  • Tests cover same-provider resume, 429 backoff, 529 backoff, authentication failure, explicit provider transition, changed-input rejection, and cancellation.

Non-goals

  • This does not rank providers or hard-code a preferred provider.
  • Repository workflows should configure budgets and display status rather than reimplement provider retry internals.

Related work

PR 306 is the expected substrate for session and failed-file resume behavior.

Metadata

Metadata

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