Commit 3876001
committed
refactor(antigravity): 🔨 clarify empty response retry configuration and logic
Renames `EMPTY_RESPONSE_MAX_RETRIES` to `EMPTY_RESPONSE_MAX_ATTEMPTS` and updates the retry logic to be more intuitive and correct.
- Renamed constant to better reflect that it represents total attempts, not retries
- Updated environment variable from `ANTIGRAVITY_EMPTY_RESPONSE_RETRIES` to `ANTIGRAVITY_EMPTY_RESPONSE_ATTEMPTS`
- Changed default from 3 to 4 attempts with minimum enforcement via `max(1, ...)`
- Fixed off-by-one errors in loop conditions: now using `range(EMPTY_RESPONSE_MAX_ATTEMPTS)` instead of `range(EMPTY_RESPONSE_MAX_RETRIES + 1)`
- Corrected retry condition from `attempt < EMPTY_RESPONSE_MAX_RETRIES` to `attempt < EMPTY_RESPONSE_MAX_ATTEMPTS - 1`
- Removed redundant error logging on final attempt failure (caller handles error logging)
- Updated all related comments and log messages to reflect "attempts" terminology
- Applied changes consistently to both streaming and non-streaming handlers
BREAKING CHANGE: The environment variable `ANTIGRAVITY_EMPTY_RESPONSE_RETRIES` has been renamed to `ANTIGRAVITY_EMPTY_RESPONSE_ATTEMPTS`. Users must update their environment configuration to use the new variable name. The semantic meaning has also changed from "number of retries after initial attempt" to "total number of attempts including the first".1 parent d5acbd4 commit 3876001
1 file changed
+13
-17
lines changedLines changed: 13 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
3258 | 3258 | | |
3259 | 3259 | | |
3260 | 3260 | | |
3261 | | - | |
| 3261 | + | |
3262 | 3262 | | |
3263 | 3263 | | |
3264 | 3264 | | |
| |||
3272 | 3272 | | |
3273 | 3273 | | |
3274 | 3274 | | |
3275 | | - | |
| 3275 | + | |
3276 | 3276 | | |
3277 | 3277 | | |
3278 | | - | |
| 3278 | + | |
3279 | 3279 | | |
3280 | 3280 | | |
3281 | 3281 | | |
3282 | 3282 | | |
3283 | | - | |
3284 | | - | |
3285 | | - | |
3286 | | - | |
| 3283 | + | |
| 3284 | + | |
3287 | 3285 | | |
3288 | 3286 | | |
3289 | 3287 | | |
| |||
3493 | 3491 | | |
3494 | 3492 | | |
3495 | 3493 | | |
3496 | | - | |
| 3494 | + | |
3497 | 3495 | | |
3498 | 3496 | | |
3499 | 3497 | | |
3500 | 3498 | | |
3501 | 3499 | | |
3502 | 3500 | | |
3503 | | - | |
| 3501 | + | |
3504 | 3502 | | |
3505 | 3503 | | |
3506 | 3504 | | |
| |||
3514 | 3512 | | |
3515 | 3513 | | |
3516 | 3514 | | |
3517 | | - | |
| 3515 | + | |
3518 | 3516 | | |
3519 | 3517 | | |
3520 | | - | |
| 3518 | + | |
3521 | 3519 | | |
3522 | 3520 | | |
3523 | 3521 | | |
3524 | 3522 | | |
3525 | | - | |
3526 | | - | |
3527 | | - | |
3528 | | - | |
| 3523 | + | |
| 3524 | + | |
3529 | 3525 | | |
3530 | 3526 | | |
3531 | 3527 | | |
| |||
0 commit comments