Swarm agents ignore default_provider configuration
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Swarm agents ignore default_provider configuration
Description
When spawning swarm agents, they fail to inherit the default_provider configuration from config.toml and instead attempt to use the Anthropic API route, even when:
default_provider = "freemodel"is set in config.tomldefault_model = "claude-opus-5"is configured for the freemodel provider- The freemodel provider is properly configured with API credentials in env_file
- No explicit model parameter is passed to swarm spawn (should inherit default)
Expected Behavior
Spawned swarm agents should inherit the default provider configuration and use the freemodel provider.
Actual Behavior
All spawned agents fail with "No Anthropic API key found" error, indicating they're attempting to use the Anthropic API route instead of the configured freemodel provider.
Configuration
config.toml excerpt:
[provider]
default_provider = "freemodel"
default_model = "claude-opus-5"
[providers.freemodel]
type = "anthropic-compatible"
base_url = "https://cc.freemodel.dev/v1"
auth = "bearer"
api_key_env = "FREEMODEL_API_KEY"
env_file = "freemodel.env"
default_model = "claude-opus-5"
Steps to Reproduce
- Configure a non-Anthropic provider as default_provider
- Spawn a swarm agent without explicit model parameter
- Agent fails trying to use Anthropic API instead of configured provider
Impact
Swarm mode is completely non-functional for users who rely on alternative API providers (OpenRouter, freemodel, self-hosted, etc.)
Jcode Version
v0.78.0 (2f7e3bcc6)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided config.toml settings, then trace swarm-agent spawning and how default_provider and default_model are resolved when no explicit model is passed. Confirm that the spawned agent selects freemodel rather than the Anthropic route and no longer reports a missing Anthropic API key.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100