Improve reconnection reliability and surface disconnect events in chat#91
Open
zmanian wants to merge 1 commit intomcintyre94:mainfrom
Open
Improve reconnection reliability and surface disconnect events in chat#91zmanian wants to merge 1 commit intomcintyre94:mainfrom
zmanian wants to merge 1 commit intomcintyre94:mainfrom
Conversation
Owner
|
I'm hoping that #74 fixes a lot of the stability here in a different way. We now persist our long streaming connections instead of killing them when you leave the chat, and reconnect to them all when the app resumes from background. Hoping this is going to make it a lot more robust! |
- Pass max_run_after_disconnect=300 on service creation so Claude keeps running for 5 minutes even if the client disconnects - Increase idle timeout from 30s to 45s to avoid false timeouts during Claude thinking pauses (requires 2+ missed heartbeats) - Increase post-stop retries from 1 to 3 with exponential backoff (1s, 2s, 4s) - Add exponential backoff to reconnect polling (2s to 30s, resets on new events) - Add WebSocket ping every 15s in ExecSession to detect dead connections - Add .systemNotice content type to show disconnect/reconnect events inline in chat history (persisted across sessions) - Prepend disconnect context to next --resume prompt so Claude knows its previous output may be incomplete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7a7842e to
f70d26d
Compare
Contributor
Author
|
so I think one thing that you might want to extract out of this is claude awareness of disconnects and other chat issues. I've found that claude adapt how it's work in ways that also help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
max_run_after_disconnect=300on service creation so Claude keeps running for 5 minutes even if the iOS client disconnects (phone lock, background, network blip).systemNoticecontent type renders inline capsule banners showing "Connection lost — reconnecting...", "Reconnected — response complete", or "Reconnection gave up — response may be incomplete"Test plan
🤖 Generated with Claude Code