fix: remove dead code, wire retryPolicy and circuit breaker#22
Merged
Conversation
- Remove @unchecked Sendable across Sources/ and Tests/; replace with actor isolation or @mainactor where appropriate - Add AgentTransport protocol and HttpAgentTransport (strategy pattern replaces open-class inheritance) - Expose retryPolicy on AgUiAgentConfig and wire through to HttpAgentConfiguration so callers can configure SSE retry behaviour - Wire ToolErrorHandler (retry loop + CircuitBreaker) into ToolExecutionManager.executeToolCall; add errorHandler param to init with sensible defaults (3 retries, exponential jitter, opens at 5 consecutive failures) - SSE reconnection: EventStream.lastEventId is now async (actor-backed) and HttpAgentTransport propagates Last-Event-ID on reconnect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
@unchecked Sendableeliminated acrossSources/andTests/; replaced withactorisolation,@MainActor, or compiler-synthesisedSendableon pure-value typesAgentTransportprotocol +HttpAgentTransportextracted (strategy pattern replaces open-class inheritance)retryPolicyonAgUiAgentConfig— previously users could not configure SSE retry behaviour through the high-level API; now wired through toHttpAgentConfigurationand active inHttpAgentTransportToolErrorHandlerwired intoToolExecutionManager.executeToolCall— retry loop with configurable backoff strategy andCircuitBreakerprotection;errorHandlerparameter added toToolExecutionManager.initwith sensible defaults (3 retries, exponential jitter, circuit opens after 5 consecutive failures)EventStream.lastEventIdis nowasync(actor-backedLastEventIdBox);HttpAgentTransportpropagatesLast-Event-IDon reconnectTest plan
swift build— cleanswift test— 1229/1229 passing, 0 failures@unchecked SendableinSources/orTests/retryPolicyflows fromAgUiAgentConfig→HttpAgentConfiguration→HttpAgentTransportToolExecutionManagerretries transient failures and short-circuits on repeated failures viaCircuitBreaker🤖 Generated with Claude Code