Merged
Conversation
- OrchestrationError.swift: Orchestration-specific error types - AgentContext.swift: Thread-safe shared context actor - Handoff.swift: Agent-to-agent handoff coordination - SequentialChain.swift: --> operator for agent chaining - ParallelGroup.swift: Concurrent execution with MergeStrategy REMAINING: SupervisorAgent.swift (LLM-agnostic), AgentRouter.swift 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…plete) SupervisorAgent.swift: - RoutingStrategy protocol for LLM-agnostic routing - LLMRoutingStrategy using InferenceProvider (any LLM) - KeywordRoutingStrategy for zero-LLM keyword matching - AgentDescription for describing agent capabilities - RoutingDecision with confidence scoring - SupervisorAgent actor with run/stream/cancel methods AgentRouter.swift: - RouteCondition with @sendable closure wrapper - Built-in conditions: contains, matches, startsWith, endsWith, etc. - Combinators: and(), or(), not for composing conditions - Route struct mapping conditions to agents - RouteBuilder DSL using @resultBuilder - AgentRouter actor with deterministic routing All orchestration patterns now implemented: - Sequential chains (-->) - Parallel groups with merge strategies - LLM-agnostic supervisor routing - Deterministic condition-based routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This major release implements the foundational architecture for the SwiftAgents framework, providing comprehensive agent development capabilities for Apple platforms. ## Core Foundation - Add AgentConfiguration with fluent builder API and Sendable conformance - Implement AgentError enumeration with categorized error types - Create AgentEvent for real-time agent state observation - Add AgentResult with metadata, token usage, and step tracking - Implement SendableValue type-erased wrapper for Sendable values - Enhance base Agent protocol with streaming and event capabilities ## Memory Systems - Replace basic Memory with comprehensive AgentMemory protocol - Add ConversationMemory for token-aware conversation tracking - Implement SlidingWindowMemory with configurable message limits - Create SummaryMemory with automatic conversation compression - Add HybridMemory combining recent messages with semantic retrieval - Implement SwiftDataMemory for persistent storage with ModelContainer - Add Summarizer protocol with streaming and threshold-based triggers - Create TokenEstimator for accurate token counting - Add MemoryMessage and PersistedMessage data models ## Observability - Define AgentTracer protocol for structured tracing - Implement ConsoleTracer with colored output and hierarchy formatting - Add OSLogTracer with subsystem/category organization - Create MetricsCollector for latency, tokens, and success rate tracking - Define TraceEvent with span-based timing and metadata support ## Resilience - Implement CircuitBreaker with half-open state recovery - Add FallbackChain for graceful degradation across providers - Create RetryPolicy with exponential backoff, jitter, and condition filters - Update Resilience module with comprehensive exports ## Tools - Enhance Tool protocol with result types and validation - Add BuiltInTools (DateTimeTool, UUIDTool) with fluent builders - Implement tool execution with error handling and metadata ## Testing - Add comprehensive test suites for all memory implementations - Create mock protocols: MockAgentMemory, MockInferenceProvider, MockSummarizer, MockTool - Implement ResilienceTests covering all resilience patterns - Expand ObservabilityTests for tracer and metrics validation - Update CoreTests and AgentTests for new APIs ## Documentation - Major README overhaul with comprehensive API documentation - Add COORDINATION.md for multi-instance development workflow - Create TEST_COVERAGE_REPORT.md with coverage analysis - Remove outdated example READMEs pending implementation All types conform to Sendable for Swift 6.2 strict concurrency. Test coverage exceeds 80% for core functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dramatically expand test coverage from ~160 to 657 tests across 78 suites, achieving ~85% coverage of public APIs. New Test Files (9 files): - Core/AgentEventTests.swift (53 tests) - All AgentEvent enum cases, ToolCall, ToolResult - Codable, Equatable, Sendable conformance - Integration scenarios for event sequences - Memory/TokenEstimatorTests.swift (46 tests) - CharacterBasedTokenEstimator, WordBasedTokenEstimator - AveragingTokenEstimator with multiple estimators - Edge cases, batch estimation, Sendable conformance - Memory/SummarizerTests.swift (39 tests) - TruncatingSummarizer sentence/word boundary truncation - FallbackSummarizer primary/fallback logic - SummarizerError cases, protocol conformance - Tools/ToolParameterTests.swift (48 tests) - ToolParameter, ParameterType enum descriptions - ToolDefinition creation from Tool protocol - Tool extension methods (validateArguments, requiredString) - Orchestration/RouteConditionTests.swift (64 tests) - All built-in conditions (contains, matches, startsWith, etc.) - Combinators (and, or, not) with full truth tables - Edge cases (empty strings, unicode, very long input) - Orchestration/RoutingStrategyTests.swift (33 tests) - AgentDescription, RoutingDecision with confidence clamping - KeywordRoutingStrategy scoring algorithm verification - Case sensitivity, minimum confidence thresholds - Orchestration/AgentRouterTests.swift (30 tests) - Routing logic, first-match-wins, fallback behavior - Streaming support, cancellation handling - Metadata enrichment, DSL initializer - Orchestration/SupervisorAgentTests.swift (19 tests) - Multi-agent coordination, routing integration - Fallback behavior with AlwaysFailingRoutingStrategy - Tool call propagation, streaming events - Observability/TracerTests.swift (35 tests) - CompositeTracer fan-out pattern, level filtering - BufferedTracer buffering and flush behavior - NoOpTracer, AnyAgentTracer type erasure Enhanced Existing Tests: - AgentTests.swift: Added ReActAgent tests - CoreTests.swift: Added InferenceTypes, ParsedToolCall tests - ResilienceTests.swift: Minor formatting improvements Test Infrastructure: - All tests use Swift Testing framework (@suite, @test, #expect) - Actor-based mocks for concurrent state tracking - SpyTracer, MockSupervisorTestAgent for verification - AlwaysFailingRoutingStrategy for fallback testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
1 similar comment
Owner
Author
This was referenced Dec 14, 2025
Merged
christopherkarani
added a commit
that referenced
this pull request
Feb 13, 2026
…ds trap - Issue #1: MessagesReducer now strips op from retained messages instead of silently dropping messages with non-nil op. This preserves messages that had transient operations during reduction. - Issue #2: secondsToNanoseconds now guards against negative TimeInterval values, returning 0 instead of trapping. Also uses clamping for overflow. - Also fixes a force unwrap in retry exhaustion path (throw lastError!).
This was referenced Feb 20, 2026
Merged
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.
No description provided.