Skip to content

Prevent unsafe retries for ambiguous writes - #2

Merged
SahirVhora merged 1 commit into
mainfrom
agent/safe-write-retries
Jul 10, 2026
Merged

Prevent unsafe retries for ambiguous writes#2
SahirVhora merged 1 commit into
mainfrom
agent/safe-write-retries

Conversation

@SahirVhora

Copy link
Copy Markdown
Owner

What changed

  • retry transient failures automatically only for safe HTTP methods
  • raise AmbiguousWriteError when a write receives a retryable server response or loses its response to a network error
  • export the new exception for downstream tools
  • add regression coverage proving POST requests are attempted exactly once

Why

The shared retry loop previously replayed POST, PATCH, and DELETE requests. If SuccessFactors committed a mutation but its response was lost, replaying the request could duplicate the change or turn a successful create into a misleading duplicate failure.

Downstream callers can now reconcile target state before deciding whether a write should be retried.

Validation

  • pytest: 175 passed, 2 skipped
  • scoped Ruff checks: passed
  • git diff --check: passed

The repository-wide mypy run still reports existing issues in unrelated modules and missing third-party stubs.

@SahirVhora
SahirVhora marked this pull request as ready for review July 10, 2026 08:58
@SahirVhora
SahirVhora merged commit e668928 into main Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant