Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bc29a43
feat: Add server compatibility with swift-log and pluggable memory ba…
christopherkarani Dec 15, 2025
d3f935a
fix: Use Swiftly to install Swift 6.2 on macOS CI
christopherkarani Dec 15, 2025
fd6295c
fix: Critical documentation and platform configuration updates
github-actions[bot] Dec 15, 2025
2677fec
docs: Add comprehensive migration guide for server compatibility update
github-actions[bot] Dec 15, 2025
900b334
fix: Update Swiftly installation for Ubuntu 24.04 support
christopherkarani Dec 15, 2025
8ae2a3f
feat: Enable Swift build verification in Claude Code CI workflows
christopherkarani Dec 15, 2025
627fdb8
fix: Address code review issues - optimize trimming, enhance security…
github-actions[bot] Dec 15, 2025
44b93a5
fix: Resolve Swiftly env.sh path expansion failure in Linux CI
christopherkarani Dec 15, 2025
c10ef96
fix: Resolve pre-existing test compilation errors across DSL test suite
christopherkarani Dec 15, 2025
aeb5ccb
fix: Wrap CalculatorTool in conditional compilation for Linux compati…
github-actions[bot] Dec 15, 2025
2e70e2f
fix: Wrap CalculatorTool test in AgentTests.swift for Linux compatibi…
github-actions[bot] Dec 15, 2025
0549b27
fix: Resolve Linux CI build errors for NSExpression unavailability
christopherkarani Dec 15, 2025
097a293
fix: Resolve all SwiftLint violations (138 → 0)
christopherkarani Dec 15, 2025
8d6d89f
style: Apply SwiftFormat across codebase and fix config
christopherkarani Dec 15, 2025
ae76f68
fix: Align SwiftLint and SwiftFormat modifier order for Swift 6 concu…
christopherkarani Dec 15, 2025
745ca2f
fix: Use cross-platform Swiftly shell installer for CI
christopherkarani Dec 15, 2025
1e0021e
fix: Use swift-actions/setup-swift for reliable CI installation
christopherkarani Dec 15, 2025
9de2f0a
fix: Skip GPG signature verification on Linux runners
christopherkarani Dec 15, 2025
6ae8467
fix: Resolve test failures across DSL and Memory test suites
christopherkarani Dec 15, 2025
5fe4f2c
fix: Resolve parallel test race conditions causing Linux CI failures
christopherkarani Dec 15, 2025
ea59582
fix: Resolve actor streaming race conditions for Linux CI compatibility
christopherkarani Dec 15, 2025
02493f3
fix: Add #if canImport(Darwin) to CalculatorToolTests for Linux compa…
christopherkarani Dec 15, 2025
d5fdff6
fix: Replace unsafe AsyncThrowingStream patterns in StreamOperations.…
christopherkarani Dec 15, 2025
5918b4f
fix: Add missing @Sendable annotations to test Task closures
christopherkarani Dec 15, 2025
4aa7568
test: Temporarily disable catchErrorsInStream test to isolate CI crash
christopherkarani Dec 15, 2025
8860345
test: Temporarily disable halfOpenRequestLimit test to isolate CI crash
christopherkarani Dec 15, 2025
b69b199
test: Re-enable all temporarily disabled tests
christopherkarani Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,41 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup Swift 6.2
uses: swift-actions/setup-swift@v3
with:
swift-version: "6.2"
skip-verify-signature: true

- name: Install SwiftLint and SwiftFormat
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
brew install swiftlint swiftformat

- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
env:
REPO_NAME: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
You are reviewing a pull request.
Repository: Use the REPO_NAME environment variable
PR Number: Use the PR_NUMBER environment variable

Please review this pull request and provide feedback on:
- Code quality and best practices
Expand All @@ -47,11 +72,17 @@ jobs:
- Security concerns
- Test coverage

IMPORTANT: You have access to Swift build tools. After reviewing the code:
1. Run `swift build` to verify the code compiles
2. Run `swift test` to verify tests pass
3. Run `swiftlint lint` to check for style violations
4. Include build/test results in your review

Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
claude_args: >-
--allowed-tools
"Bash(swift build:*),Bash(swift test:*),Bash(swift package:*),Bash(swiftlint:*),Bash(swiftformat:*),Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"

35 changes: 26 additions & 9 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,40 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup Swift 6.2
uses: swift-actions/setup-swift@v3
with:
swift-version: "6.2"
skip-verify-signature: true

- name: Install SwiftLint and SwiftFormat
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
brew install swiftlint swiftformat

- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'
# Claude can build, test, lint, and format Swift code
claude_args: >-
--allowed-tools
"Bash(swift build:*),Bash(swift test:*),Bash(swift package:*),Bash(swiftlint:*),Bash(swiftformat:*),Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr create:*),Bash(git:*)"

62 changes: 52 additions & 10 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwiftAgents CI Workflow
# Builds and tests the SwiftAgents framework on macOS 26 (Tahoe)
# Builds and tests on macOS and Linux

name: Swift CI

Expand All @@ -15,37 +15,79 @@ concurrency:
cancel-in-progress: true

jobs:
build-and-test:
name: Build & Test
runs-on: macos-26
# macOS Build & Test (full features including SwiftData)
build-macos:
name: Build & Test (macOS)
runs-on: macos-15

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Swift 6.2
uses: swift-actions/setup-swift@v3
with:
swift-version: "6.2"

- name: Show Swift version
run: swift --version

- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
key: ${{ runner.os }}-swift-6.2-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-6.2-

- name: Resolve dependencies
run: swift package resolve

- name: Build
run: swift build

- name: Run tests
run: swift test --no-parallel

# Linux Build & Test (core features, no SwiftData)
build-linux:
name: Build & Test (Linux)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Swift 6.2
uses: swift-actions/setup-swift@v3
with:
swift-version: "6.2"
skip-verify-signature: true

- name: Verify Swift version
run: swift --version

- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: linux-swift-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-
linux-swift-

- name: Resolve dependencies
run: swift package resolve

- name: Build (warnings as errors)
run: swift build -Xswiftc -warnings-as-errors
- name: Build
run: swift build

- name: Run tests
run: swift test --parallel
run: swift test --no-parallel

# Code Quality (macOS only - SwiftLint/SwiftFormat)
code-quality:
name: Code Quality
runs-on: macos-26
runs-on: macos-15

steps:
- name: Checkout repository
Expand Down
96 changes: 46 additions & 50 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,69 @@
--swiftversion 6.2

# File options
--exclude .build,Package.swift
--exclude .build,Package.swift,Sources/SwiftAgentsMacros

# Indentation
--indent 4
--tabwidth 4
--smarttabs enabled
--indentcase false
--tab-width 4
--smart-tabs enabled
--indent-case false
--ifdef indent

# Braces and spacing
--allman false
--brace-on-same-line true
--elseposition same-line
--guardelse same-line

# Wrapping
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first
--wrapconditions after-first
--wrapreturntype preserve
--wrapeffects preserve
--maxwidth 120
--closingparen balanced

# Spacing
--operatorfunc spaced
--nospaceoperators
--ranges spaced
--typedelimiter spaced
--else-position same-line
--guard-else same-line

# Wrapping - use preserve to avoid breaking valid code
--wrap-arguments preserve
--wrap-parameters preserve
--wrap-collections preserve
--wrap-conditions preserve
--wrap-return-type preserve
--wrap-effects preserve
--max-width 120
--closing-paren balanced

# Spacing - use safe defaults
--operator-func spaced
--ranges preserve
--type-delimiter space-after

# Blank lines
--emptybraces no-space
--trimwhitespace always
--empty-braces no-space
--trim-whitespace always
--linebreaks lf

# Semicolons
--semicolons never

# Commas
--commas inline

# Redundant
--redundanttype inferred
--redundantself remove
--redundantextensionacl on
--redundantlet remove
--redundantnil remove
--redundantpattern remove
--redundantinit remove
--redundantclosure remove
--trailing-commas never

# Types
--property-types infer-locals-only
--self remove
--extension-acl on-extension
--nil-init remove

# Void
--voidtype void
--void-type Void

# Marks
--marktypes always
--markextensions always
--extensionmark "MARK: - %t + %c"
--groupedextension "MARK: %c"
--mark-types always
--mark-extensions always
--extension-mark "MARK: - %t + %c"
--grouped-extension "MARK: %c"

# Imports
--importgrouping alpha
--import-grouping alpha

# Self
--self remove
--selfrequired
--self-required

# Modifiers
--modifierorder acl,setterACL,override,mutating,lazy,final,required,convenience,typeMethods,owned
--modifier-order nonisolated,acl,setterACL,override,mutating,lazy,final,required,convenience,typeMethods,owned

# Enabled rules
--enable isEmpty
Expand All @@ -87,14 +80,17 @@
--enable organizeDeclarations
--enable sortImports

# Disabled rules
# Disabled rules - disable potentially breaking rules
--disable trailingCommas
--disable wrapMultilineStatementBraces
--disable blankLineAfterImports
--disable acronyms
--disable wrap
--disable wrapArguments
--disable wrapConditionalBodies

# Declaration organization (matches MARK style in codebase)
--organizetypes actor,class,enum,struct,extension,protocol
--organizationmode visibility
--visibilityorder public,internal,fileprivate,private
--typeorder beforeMarks,nestedType,staticProperty,staticPropertyWithBody,classPropertyWithBody,instanceProperty,instancePropertyWithBody,staticMethod,classMethod,instanceMethod,subscript
--organize-types actor,class,enum,struct,extension,protocol
--organization-mode visibility
--visibility-order open,public,package,internal,fileprivate,private
--type-order beforeMarks,nestedType,staticProperty,staticPropertyWithBody,classPropertyWithBody,instanceProperty,instancePropertyWithBody,instanceLifecycle,staticMethod,classMethod,instanceMethod
11 changes: 7 additions & 4 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,18 @@ force_try: warning
# File header format (matches project style)
file_header:
required_pattern: |
\/\/ [\w+]+\.swift\n\/\/ SwiftAgents Framework
\/\/ [\w+]+\.swift\n\/\/ SwiftAgents(Tests|Macros|MacrosTests| Framework)?

# Modifier order (Swift 6 conventions)
# Modifier order (Swift 6 conventions - matches SwiftFormat)
# Valid groups: override, isolation, acl, setterACL, dynamic, mutators, lazy, final, required, convenience, typeMethods, owned
modifier_order:
preferred_modifier_order:
- override
- isolation
- acl
- setterACL
- override
- mutating
- dynamic
- mutators
- lazy
- final
- required
Expand Down
Loading
Loading