Skip to content

fix(agent): retry interrupted streams and show reconnect status - #533

Merged
huichen merged 3 commits into
mainfrom
claude/stream-reconnect
Sep 9, 2026
Merged

huichen merged 3 commits into
mainfrom
claude/stream-reconnect

Conversation

@ace331

@ace331 ace331 commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Retry interrupted upstream model streams up to five additional times per model step, with interruptible 2/4/8/16/32-second backoff separate from HTTP request retries.
  • Preserve partial responses, completed tool history and reported usage; do not execute interrupted tool calls.
  • Route both clean EOF and HTTP body errors through adapter cleanup before retrying. Strip unfinished OpenAI Responses item identifiers while retaining completed reasoning metadata; ignore broken buffered SSE tails after transport errors.
  • Normalize malformed/null Anthropic historical tool inputs to objects only in the outgoing request projection, preserving original partial arguments in the durable conversation.
  • Publish non-terminal stream_retry / stream_resumed events through the existing RPC journal and projection path. Show localized desktop reconnect attempts, including before the first token and after reattaching; clear them on recovery, cancellation or failure.

Validation

Updated with origin/main and checked in an isolated worktree using Rust 1.97.0:

  • Agent: 1,729 tests passed; 10 existing ignored tests. Includes new HTTP recovery regressions for truncated Responses bodies and partial Anthropic tool arguments, plus object-input normalization cases.
  • RPC: 116 tests passed.
  • Agent/RPC fmt and clippy: all targets, warnings denied, passed.
  • Desktop: TypeScript, ESLint, 750 tests and production build passed.
  • Mobile/shared-projector consumer: TypeScript, ESLint and 600 tests passed.
  • Regenerated RPC bindings match committed output; git diff --check passed.
  • Installer regressions brought in by the main sync: 6 tests passed.

The running Agent/desktop were not restarted. Disconnect recovery was verified with local HTTP mocks, not a live-provider disconnect or native desktop end-to-end test.

@huichen
huichen enabled auto-merge (squash) September 9, 2026 12:41
@huichen
huichen merged commit 0d3a073 into main Sep 9, 2026
12 checks passed
auto-merge was automatically disabled September 9, 2026 12:48

Pull Request is not mergeable

@huichen
huichen deleted the claude/stream-reconnect branch September 9, 2026 12:48
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.

2 participants