Skip to content

Validate maxRetries#1953

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/max-retries-validation
Open

Validate maxRetries#1953
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/max-retries-validation

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • Validate client-level and per-request maxRetries as non-negative integers.
  • Change retry gates to check retriesRemaining > 0 instead of truthiness.
  • Add coverage for invalid retry counts and for maxRetries: 0 disabling retries.

Why

Negative retry counts are truthy, so retryable failures could keep decrementing forever instead of stopping. Invalid retry counts now fail before a request is sent.

Validation

  • ./node_modules/.bin/jest tests/index.test.ts --runInBand
  • ./node_modules/.bin/prettier --check src/client.ts src/internal/utils/values.ts tests/index.test.ts
  • ./node_modules/.bin/eslint src/client.ts src/internal/utils/values.ts tests/index.test.ts
  • ./node_modules/typescript/bin/tsc
  • ./scripts/build

@fallintoplace fallintoplace requested a review from a team as a code owner June 23, 2026 18:49
@HAYDEN-OAI HAYDEN-OAI added the upstream Needs to be addressed in Stainless upstream label Jun 23, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Needs to be addressed in Stainless upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants