Skip to content

fix: remove dead code, wire retryPolicy and circuit breaker#22

Merged
paduh merged 2 commits into
mainfrom
fix/deadcode
Apr 20, 2026
Merged

fix: remove dead code, wire retryPolicy and circuit breaker#22
paduh merged 2 commits into
mainfrom
fix/deadcode

Conversation

@paduh

@paduh paduh commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • @unchecked Sendable eliminated across Sources/ and Tests/; replaced with actor isolation, @MainActor, or compiler-synthesised Sendable on pure-value types
  • AgentTransport protocol + HttpAgentTransport extracted (strategy pattern replaces open-class inheritance)
  • retryPolicy on AgUiAgentConfig — previously users could not configure SSE retry behaviour through the high-level API; now wired through to HttpAgentConfiguration and active in HttpAgentTransport
  • ToolErrorHandler wired into ToolExecutionManager.executeToolCall — retry loop with configurable backoff strategy and CircuitBreaker protection; errorHandler parameter added to ToolExecutionManager.init with sensible defaults (3 retries, exponential jitter, circuit opens after 5 consecutive failures)
  • SSE reconnectionEventStream.lastEventId is now async (actor-backed LastEventIdBox); HttpAgentTransport propagates Last-Event-ID on reconnect

Test plan

  • swift build — clean
  • swift test — 1229/1229 passing, 0 failures
  • No remaining @unchecked Sendable in Sources/ or Tests/
  • retryPolicy flows from AgUiAgentConfigHttpAgentConfigurationHttpAgentTransport
  • ToolExecutionManager retries transient failures and short-circuits on repeated failures via CircuitBreaker

🤖 Generated with Claude Code

- 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>
@paduh paduh self-assigned this Apr 14, 2026
@paduh
paduh merged commit 16c09f0 into main Apr 20, 2026
9 checks passed
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.

1 participant