Skip to content

fix(interactions): retries = attempts - 1 - #3263

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara/1013786410
Nov 5, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
copybara/1013786410

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

fix(interactions): retries = attempts - 1

HttpRetryOptions.attempts counts the original request, so 0 and 1 both mean no retries. _translate_retry_config previously passed attempts straight through as RetryConfig.max_retries (which counts retries after the initial request), causing attempts=0 and attempts=1 to still retry once.

Map attempts to max(attempts - 1, 0). When attempts is unset, Interactions now uses the same default as the rest of the SDK (_api_client._RETRY_ATTEMPTS, 5 attempts including the initial request) instead of its own constant (previously 4 attempts).

Fixes #3260

@copybara-service
copybara-service Bot force-pushed the copybara/1013786410 branch 2 times, most recently from 6c2d00f to e7ebbe2 Compare November 4, 2026 14:57
@copybara-service copybara-service Bot changed the title fix(interactions): map HttpRetryOptions.attempts onto the retry count fix(interactions): attempts = retries - 1 Nov 4, 2026
@copybara-service
copybara-service Bot force-pushed the copybara/1013786410 branch 2 times, most recently from 50bbcd7 to e2546b0 Compare November 5, 2026 18:00
@copybara-service copybara-service Bot changed the title fix(interactions): attempts = retries - 1 fix(interactions): retries = attempts - 1 Nov 5, 2026
`HttpRetryOptions.attempts` counts the original request, so 0 and 1 both mean no retries. `_translate_retry_config` previously passed `attempts` straight through as `RetryConfig.max_retries` (which counts retries after the initial request), causing `attempts=0` and `attempts=1` to still retry once.

Map `attempts` to `max(attempts - 1, 0)`. When `attempts` is unset, Interactions now uses the same default as the rest of the SDK (`_api_client._RETRY_ATTEMPTS`, 5 attempts including the initial request) instead of its own constant (previously 4 attempts).

Fixes #3260

PiperOrigin-RevId: 1014857114
@copybara-service
copybara-service Bot merged commit 0f688a6 into main Nov 5, 2026
13 checks passed
@copybara-service
copybara-service Bot deleted the copybara/1013786410 branch November 5, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to completely disable API retries for interactions API

1 participant