Skip to content

fix: do not retry HTTP 501 for Interactions API requests - #2809

Open
a2105z wants to merge 1 commit into
googleapis:mainfrom
a2105z:fix/interactions-delete-no-retry-501
Open

fix: do not retry HTTP 501 for Interactions API requests#2809
a2105z wants to merge 1 commit into
googleapis:mainfrom
a2105z:fix/interactions-delete-no-retry-501

Conversation

@a2105z

@a2105z a2105z commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Align NextGen/Interactions retry status codes with the parent GenAI client (408, 429, 500, 502, 503, 504) instead of Speakeasy's broad 5XX class.
  • Stops the SDK from retrying permanent failures such as HTTP 501 Not Implemented (as reported for interactions.delete in Interactions API: interactions.delete returns 501 with Gemini Developer API #2803).
  • Adds sync/async regression tests confirming interactions.delete fails fast on 501.

Notes

The documented DELETE /v1beta/interactions/{id} path constructed by the SDK looks correct. The 501 itself appears to be a Gemini Developer API backend response (similar to #1971 for cancel). This PR does not claim to make delete succeed server-side; it fixes the SDK treating 501 as a transient error and retrying until InternalServerError.

Fixes client-side retry behavior for #2803.

Test plan

  • pytest google/genai/tests/interactions/test_auth.py::test_interactions_delete_does_not_retry_501
  • pytest google/genai/tests/interactions/test_auth.py::test_async_interactions_delete_does_not_retry_501
  • Existing test_interactions_gemini_retry / async variant still pass (500 still retried; 501 fails fast)

@google-cla

google-cla Bot commented Aug 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@a2105z
a2105z force-pushed the fix/interactions-delete-no-retry-501 branch 2 times, most recently from 3754b9b to 5bc6a5d Compare August 4, 2026 01:04
Align NextGen retry status codes with the parent client so permanent
failures like 501 Not Implemented are not retried as transient 5XX
errors. Relates to interactions.delete returning 501 (googleapis#2803).
@a2105z
a2105z force-pushed the fix/interactions-delete-no-retry-501 branch from 5bc6a5d to 81d36e9 Compare August 4, 2026 01:05
@a2105z

a2105z commented Aug 4, 2026

Copy link
Copy Markdown
Author

@googlebot I fixed it.

@a2105z

a2105z commented Aug 4, 2026

Copy link
Copy Markdown
Author

@Venkaiahbabuneelam this PR stops Interactions requests from retrying permanent HTTP 501s (aligned with the parent client); whenever you have a moment, I would really appreciate your review — thank you for your time.

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Aug 4, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:XL Code changes > 100 lines label Aug 4, 2026
@a2105z a2105z closed this Aug 4, 2026
@a2105z a2105z reopened this Aug 13, 2026
@a2105z

a2105z commented Aug 13, 2026

Copy link
Copy Markdown
Author

Sorry — I accidentally closed this PR. Reopened.

@Venkaiahbabuneelam whenever you have a moment, I'd really appreciate a review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Code changes > 100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants