Skip to content

fix(python): honor zero reconnect attempts#1798

Open
fjbarrett wants to merge 1 commit into
pmxt-dev:mainfrom
fjbarrett:fix/python-zero-reconnect-attempts
Open

fix(python): honor zero reconnect attempts#1798
fjbarrett wants to merge 1 commit into
pmxt-dev:mainfrom
fjbarrett:fix/python-zero-reconnect-attempts

Conversation

@fjbarrett

Copy link
Copy Markdown

Summary

  • default maxReconnectAttempts only when the option is missing or None
  • preserve an explicit 0, matching the TypeScript WebSocket client
  • cover both the None default and zero-attempt behavior with regression tests

Testing

  • python -m pytest sdks/python/tests/test_ws_client.py -q (10 passed)
  • python -m pytest sdks/python/tests -q (269 passed, 66 deselected)
  • npm test (51 core suites passed; 822 core tests and 269 Python tests passed)

AI assistance

OpenAI Codex assisted with implementation and verification. I reviewed the complete diff and take responsibility for the change.

Closes #1797

Treat only a missing or None maxReconnectAttempts value as the default. This preserves an explicit zero so Python matches the TypeScript WebSocket client configuration semantics.

Add regression coverage for both the None default and zero-attempt cases.

Co-Authored-By: Codex <codex@openai.com>
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.

SDK drift: maxReconnectAttempts: 0 silently falls back to the default of 3 in Python's WS client but is honored (zero attempts) in TypeScript

1 participant