Skip to content

Conversation

@jkebinger
Copy link
Collaborator

Summary

Add validation to reject zero-byte config payloads from both HTTP and SSE endpoints, treating them as connection errors that trigger retry logic.

Problem

The SDK could potentially attempt to process empty config data, which would likely cause parsing errors or unexpected behavior.

Solution

  • Added zero-byte validation in config_sdk.py for HTTP responses
  • Added zero-byte validation in _sse_connection_manager.py for SSE events
  • When zero-byte payloads are detected:
    • HTTP: Returns False to trigger fallback/retry logic
    • SSE: Returns early to trigger reconnection logic
  • Logs warning messages when zero-byte payloads are encountered

Testing

  • Added comprehensive test coverage for both HTTP and SSE scenarios
  • Tests verify that zero-byte payloads are properly rejected
  • Tests verify that valid payloads continue to work normally
  • All existing tests continue to pass

🤖 Generated with Claude Code

Added validation to reject zero-byte config payloads from both HTTP and SSE
endpoints, treating them as connection errors that trigger retries.

Changes:
- Added zero-byte validation in config_sdk.py for HTTP responses
- Added zero-byte validation in _sse_connection_manager.py for SSE events
- Return False/early when zero-byte payloads detected to trigger retry logic
- Added comprehensive tests for both HTTP and SSE scenarios

This prevents the SDK from attempting to process empty config data which
would likely cause parsing errors or unexpected behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@jdwyah jdwyah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@jkebinger jkebinger merged commit eb474e5 into main Sep 29, 2025
7 checks passed
@jkebinger jkebinger deleted the reject-zero-byte-configs branch September 29, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants