You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SSE watchdog and improve connection error handling (#20)
* Add SSE watchdog for connection health monitoring
Adds a watchdog thread that monitors SSE connection health by tracking
when data (including keepalives) is received. If no data is received for
120 seconds (configurable), the watchdog:
1. Logs a warning
2. Polls the checkpoint API for fresh config data
3. Closes the SSE client to force reconnection
This helps detect and recover from stuck SSE connections that may not
trigger normal timeout/error handling (e.g., proxy issues, half-open
connections).
Additional improvements:
- Changed except Exception to except BaseException to catch GeneratorExit
and other BaseException subclasses that could silently kill the thread
- Added logging when streaming loop exits (with shutdown reason)
- Fixed backoff logging to show actual sleep time instead of pre-doubled value
- Removed dead code (ConfigSDK.sse_client was never assigned)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix 401/403 handling in SSE streaming loop
The previous code caught UnauthorizedException which is never raised
by raise_for_status(). Instead, HTTPError is raised. This change:
- Catches HTTPError and inspects response.status_code for 401/403
- Removes dead UnauthorizedException catch block
- Adds specific tests for 401 and 403 responses
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Ensure streaming starts even when checkpoint loading fails
If load_checkpoint() fails (no data found or unexpected exception),
streaming would never start because finish_init() was never called.
This fix starts streaming as a fallback when checkpoint loading fails,
but does NOT call finish_init() - this preserves the timeout behavior
where get() blocks until timeout if no data is available.
- Start streaming when CDN and cache both fail to load
- Start streaming when unexpected exception occurs
- Do NOT start streaming on UnauthorizedException (handled separately)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Bump version to 1.2.0 and add dev runner script
- Bump version to 1.2.0 for SSE watchdog and error handling improvements
- Add dev_runner.py for observing SDK behavior during development
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Pin Poetry version to 1.8.5 in CI workflows
Poetry 2.x installation was failing in GitHub Actions.
Pin to 1.8.5 for stability.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments