claude_swarm 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4085d9345464dcd7fc7be4c78155aa03f2467f7f089b056f2be0589f5de260f2
4
- data.tar.gz: fda22e57619c30b1d9e1efcabb5a8a0b2b74f9f6df2d969944e07d27753adbd9
3
+ metadata.gz: 4f802dadf6aa3673a354582aed75d8887d8ff83c4d30d700eba89f7f3663eec9
4
+ data.tar.gz: a2aea35f422333fd2421d078bf336745c61172c900ac96da1d20d50100fef607
5
5
  SHA512:
6
- metadata.gz: 216ff3a7bfda3f2763195eec1e32821596d7047c155d0757d33da0718ad1dbb3c51f04fe50591c2a99d98da37d53255a9bda11c9bf9b6bf79dff788ac27fc0c9
7
- data.tar.gz: 39784e3be63360c32ec3388983a10068f9d8193bde6cebef190aae856a2da9caa47cb63c772e268203a85eb8a8fad2e0717a901401fffbd0ce8e716979cd3f20
6
+ metadata.gz: 7fb47e9059f561852a81411920dc0a0d568c5c47a2361823ee5425e3820ef21699c26072e1bf330fdfff4514b8fc3c182df59975266f3f62b5e89aeba31dd63a
7
+ data.tar.gz: dec84ec9eb8b0f95edb1d079fcc7ab155ed754713343f8730f68d248f28db1e9ad0571b734f885cbcc30fbda58a0cde077d5e7d18c960c5a9ad1e5c03df396a6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [0.2.1]
2
+
3
+ ### Added
4
+ - **Ruby-OpenAI version validation**: Added validation to ensure ruby-openai >= 8.0 when using OpenAI provider with `api_version: "responses"`
5
+ - The responses API requires ruby-openai version 8.0 or higher
6
+ - Configuration validation now checks the installed version and provides helpful error messages
7
+ - Gracefully handles cases where ruby-openai is not installed
8
+
9
+ ### Changed
10
+ - **Relaxed ruby-openai dependency**: The gemspec now accepts ruby-openai versions 7.x and 8.x (`>= 7.0, < 9.0`)
11
+ - Version 7.x works with the default chat_completion API
12
+ - Version 8.x is required for the responses API
13
+
1
14
  ## [0.2.0]
2
15
 
3
16
  ### Added
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Claude Swarm
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/claude_swarm.svg?cache_bust=0.1.17)](https://badge.fury.io/rb/claude_swarm)
3
+ [![Gem Version](https://badge.fury.io/rb/claude_swarm.svg?cache_bust=0.2.0)](https://badge.fury.io/rb/claude_swarm)
4
4
  [![CI](https://github.com/parruda/claude-swarm/actions/workflows/ci.yml/badge.svg)](https://github.com/parruda/claude-swarm/actions/workflows/ci.yml)
5
5
 
6
6
  Claude Swarm orchestrates multiple Claude Code instances as a collaborative AI development team. It enables running AI agents with specialized roles, tools, and directory contexts, communicating via MCP (Model Context Protocol) in a tree-like hierarchy. Define your swarm topology in simple YAML and let Claude instances delegate tasks through connected instances. Perfect for complex projects requiring specialized AI agents for frontend, backend, testing, DevOps, or research tasks.
@@ -320,6 +320,7 @@ When using `provider: openai`, the following additional fields are available:
320
320
  - GPT models support `temperature` but not `reasoning_effort`
321
321
  - OpenAI instances default to and ONLY operate as `vibe: true` and use MCP for tool access
322
322
  - By default it comes with Claude Code tools, connected with MCP to `claude mcp serve`
323
+ - **Using the responses API requires ruby-openai >= 8.0** - the gem will validate this requirement at runtime
323
324
 
324
325
  ```yaml
325
326
  instance_name:
@@ -119,6 +119,7 @@ module ClaudeSwarm
119
119
  validate_connections
120
120
  detect_circular_dependencies
121
121
  validate_openai_env_vars
122
+ validate_openai_responses_api_compatibility
122
123
  end
123
124
 
124
125
  def parse_instance(name, config)
@@ -330,5 +331,28 @@ module ClaudeSwarm
330
331
  raise Error, "Main instance '#{@main_instance}' cannot have a provider setting in interactive mode"
331
332
  end
332
333
  end
334
+
335
+ def validate_openai_responses_api_compatibility
336
+ # Check if any instance uses OpenAI provider with responses API
337
+ responses_api_instances = @instances.select do |_name, instance|
338
+ instance[:provider] == "openai" && instance[:api_version] == "responses"
339
+ end
340
+
341
+ return if responses_api_instances.empty?
342
+
343
+ # Check ruby-openai version
344
+ begin
345
+ require "openai/version"
346
+ openai_version = Gem::Version.new(::OpenAI::VERSION)
347
+ required_version = Gem::Version.new("8.0.0")
348
+
349
+ if openai_version < required_version
350
+ instance_names = responses_api_instances.keys.join(", ")
351
+ raise Error, "Instances #{instance_names} use OpenAI provider with api_version 'responses', which requires ruby-openai >= 8.0. Current version is #{openai_version}. Please update your Gemfile or run: gem install ruby-openai -v '>= 8.0'"
352
+ end
353
+ rescue LoadError
354
+ # ruby-openai is not installed, which is fine - it will be caught later when trying to use it
355
+ end
356
+ end
333
357
  end
334
358
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeSwarm
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -16,6 +16,8 @@ module ClaudeSwarm
16
16
  end
17
17
  @created_worktrees = {} # Maps "repo_root:worktree_name" to worktree_path
18
18
  @instance_worktree_configs = {} # Stores per-instance worktree settings
19
+ @instance_directories = {} # Stores original resolved directories for each instance
20
+ @instance_worktree_paths = {} # Stores worktree paths for each instance
19
21
  end
20
22
 
21
23
  def setup_worktrees(instances)
@@ -40,12 +42,23 @@ module ClaudeSwarm
40
42
  puts "Debug [WorktreeManager]: Worktree config: #{worktree_config.inspect}"
41
43
  end
42
44
 
43
- next if worktree_config[:skip]
45
+ # Store original directories (resolved)
46
+ original_dirs = instance[:directories] || [instance[:directory]]
47
+ resolved_dirs = original_dirs.map { |dir| dir ? File.expand_path(dir) : nil }.compact
48
+ @instance_directories[instance[:name]] = resolved_dirs
49
+
50
+ if worktree_config[:skip]
51
+ # No worktree, paths remain the same
52
+ @instance_worktree_paths[instance[:name]] = resolved_dirs
53
+ next
54
+ end
44
55
 
45
56
  worktree_name = worktree_config[:name]
46
- original_dirs = instance[:directories] || [instance[:directory]]
47
57
  mapped_dirs = original_dirs.map { |dir| map_to_worktree_path(dir, worktree_name) }
48
58
 
59
+ # Store the worktree paths
60
+ @instance_worktree_paths[instance[:name]] = mapped_dirs
61
+
49
62
  if ENV["CLAUDE_SWARM_DEBUG"]
50
63
  puts "Debug [WorktreeManager]: Original dirs: #{original_dirs.inspect}"
51
64
  puts "Debug [WorktreeManager]: Mapped dirs: #{mapped_dirs.inspect}"
@@ -166,11 +179,22 @@ module ClaudeSwarm
166
179
  end
167
180
 
168
181
  def session_metadata
182
+ # Build instance details with resolved paths and worktree mappings
183
+ instance_details = {}
184
+
185
+ @instance_worktree_configs.each do |instance_name, worktree_config|
186
+ instance_details[instance_name] = {
187
+ worktree_config: worktree_config,
188
+ directories: @instance_directories[instance_name] || {},
189
+ worktree_paths: @instance_worktree_paths[instance_name] || {},
190
+ }
191
+ end
192
+
169
193
  {
170
194
  enabled: true,
171
195
  shared_name: @shared_worktree_name,
172
196
  created_paths: @created_worktrees.dup,
173
- instance_configs: @instance_worktree_configs.dup,
197
+ instance_configs: instance_details,
174
198
  }
175
199
  end
176
200
 
data/single.yml CHANGED
@@ -313,7 +313,6 @@ swarm:
313
313
  5. IDENTIFY PATTERNS: Look for repeated code patterns across tests
314
314
  6. CREATE NEW HELPERS: When you find repeated patterns, create or suggest new helper methods
315
315
  7. RUN TESTS to check coverage: `bundle exec rake test`
316
- 8. VIEW COVERAGE REPORT: Open coverage/index.html after running tests
317
316
 
318
317
  The codebase typically provides helpers for:
319
318
  - File operations (temporary directories, config files)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude_swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda
@@ -69,16 +69,22 @@ dependencies:
69
69
  name: ruby-openai
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '7.0'
75
+ - - "<"
73
76
  - !ruby/object:Gem::Version
74
- version: '8.1'
77
+ version: '9.0'
75
78
  type: :runtime
76
79
  prerelease: false
77
80
  version_requirements: !ruby/object:Gem::Requirement
78
81
  requirements:
79
- - - "~>"
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '7.0'
85
+ - - "<"
80
86
  - !ruby/object:Gem::Version
81
- version: '8.1'
87
+ version: '9.0'
82
88
  description: |
83
89
  Claude Swarm enables you to run multiple Claude Code instances that communicate with each other
84
90
  via MCP (Model Context Protocol). Create AI development teams where each instance has specialized