Skip to content

Fix/swift6 strict sendable concurrency#21

Merged
paduh merged 2 commits into
mainfrom
fix/swift6-strict-sendable-concurrency
Apr 14, 2026
Merged

Fix/swift6 strict sendable concurrency#21
paduh merged 2 commits into
mainfrom
fix/swift6-strict-sendable-concurrency

Conversation

@paduh

@paduh paduh commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Summary

Changes

Type of Change

  • feat - New feature
  • fix - Bug fix
  • refactor - Code refactoring
  • docs - Documentation update
  • test - Test additions/updates
  • chore - Build/tooling changes

Testing

  • Unit tests added/updated
  • All tests pass (swift test)
  • Integration tests pass
  • Manual testing performed

Code Quality

  • Code formatted (swift package plugin swiftformat)
  • SwiftLint passes (swiftlint lint)
  • No violations in production code
  • Documentation comments added/updated for public APIs

Screenshots

Related Issues

Closes #
Relates to #

Breaking Changes

  • This PR includes breaking changes
  • Migration guide added to CHANGELOG

Breaking changes:

Additional Context


Reviewer Checklist

  • Code follows project standards (CLAUDE.md)
  • Tests are comprehensive and pass
  • Documentation is clear and complete
  • No unnecessary changes or scope creep
  • Commit messages follow conventions
  • CI checks pass

paduh added 2 commits April 14, 2026 18:25
Replace open-class inheritance with final-class composition across
AbstractAgent, HttpAgent, AgUiAgent, and StatefulAgUiAgent. Extract
AgentTransport protocol (Sendable) and HttpAgentTransport struct so
all stored properties are `let` + Sendable — no @unchecked needed.

Also fix five concurrency correctness gaps (Phases 1-5):
- Convert @unchecked Sendable helper classes to structs (ToolCallBuilder,
  MutableToolExecutionStats, HttpAgentConfig headers mutation)
- Remove didSet from config types to satisfy Swift 6 Sendable rules
- Rewrite TimeBatchedAsyncSequence with producer-consumer actor pattern
  to eliminate element loss at window boundaries
- Add continuation.onTermination task cancellation to all bare Task {}
  sites inside AsyncThrowingStream continuations
- Back LastEventIdBox with NSLock for genuine thread safety

Tests: 1229 passed, 0 failed
@paduh paduh self-assigned this Apr 14, 2026
@paduh
paduh merged commit e29435c into main Apr 14, 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