Skip to content

fix(runtime): skip default retries for unsafe methods#77

Merged
samzong merged 1 commit into
mainfrom
fix/default-retries-safe-methods
Jun 26, 2026
Merged

fix(runtime): skip default retries for unsafe methods#77
samzong merged 1 commit into
mainfrom
fix/default-retries-safe-methods

Conversation

@samzong

@samzong samzong commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #16.

  • Limit the default retry policy to safe HTTP methods.
  • Keep explicit MaxRetries > 0 as the opt-in path for callers that intentionally want retries on other methods.
  • Add regression coverage proving default POST requests are not retried after a retryable status.

Verification

  • go test ./pkg/runtime -run 'TestHTTPClient_DefaultRetriesSkipPost|TestRetryTransport'
  • go test ./pkg/runtime
  • go test -race ./pkg/runtime
  • make check
  • /pre-ship --committed manual gate: no MUST-FIX findings; sentinel written

Compatibility

Generated mutating commands no longer retry by default on 429/5xx. Safe methods keep default retries, and callers can still opt into retrying other methods by setting MaxRetries > 0. No generated command shape, catalog schema, auth, body, output, or generated code changes.

Checklist

  • Tests or focused verification cover the changed surface.
  • User-facing behavior changes are described in this PR; no generated workflow docs needed.
  • Generated output under internal/generated/, .cache/, and ad-hoc skills/<cli-name>/ directories is not committed.
  • Commits are signed off when this is ready to merge.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong samzong merged commit 71ecbf4 into main Jun 26, 2026
2 of 3 checks passed
@samzong samzong deleted the fix/default-retries-safe-methods branch June 26, 2026 17:09
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.

bug: avoid default retries for non-idempotent generated requests

1 participant