1jehuang / 1jehuang/jcode

Swarm agents ignore default_provider configuration

Open
#1,001 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-info triage: unclear
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.toml
  • default_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

  1. Configure a non-Anthropic provider as default_provider
  2. Spawn a swarm agent without explicit model parameter
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.