Bug Report: `swarm spawn` `model` parameter is ignored and inherits coordinator model
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Bug Report: swarm spawn model parameter is ignored and inherits coordinator model
- Reporter: yamada-masa
- Date: 2026-09-04
- Version: jcode v0.81.6 (4f0f9819a)
- Severity: High (Directly causes self-review failures)
Summary
When specifying the model parameter in swarm spawn, the swarm worker inherits the coordinator's model instead. The specified model is completely ignored.
This completely breaks use cases like "spawning a worker with a different model for code review":
- Results in a self-review (reviewing oneself using the same model), making the review meaningless.
- Prevents split-role workflows (e.g., Coder using one model and Reviewer using another, per Constitution Article 7).
Reproduction Steps
Experiment 1: Specifying a bare model
{
"action": "spawn",
"model": "z-ai/glm-5.2:free",
"prompt": "(short prompt)",
"label": "PR82 reviewer"
}
- Actual Model Used:
deepseek-v4-flash(same as coordinator) - Expected:
z-ai/glm-5.2:free
Experiment 2: Specifying a route-pinned model
{
"action": "spawn",
"model": "openrouter/z-ai/glm-5.2:free",
"prompt": "(short prompt)",
"label": "model probe"
}
- Actual Model Used:
deepseek-v4-flash(same as coordinator) - Expected:
z-ai/glm-5.2:free
In both cases, the spawned session's journal (~/.jcode/sessions/session_*.journal.jsonl) recorded "model":"deepseek-v4-flash", and the specified z-ai/glm-5.2:free was never used.
Expected Behavior
When model (and optionally provider) is passed to swarm spawn, the worker should start with the specified model.
The list_models help text states:
"configure agents.swarm_model with a bare model or route-pinned value"
This implies setting agents.swarm_model pins the worker model, but having spawn-time parameters ignored is clearly an inconsistency.
Actual Behavior
- Ran
swarm spawn model="z-ai/glm-5.2:free". - Checked the journal of the spawned agent.
- Found that
"model":"deepseek-v4-flash"(inherited from the coordinator) was used instead.
Impact
- Self-Review Failures: Intending to review with a different model fails silently, using the same model instead and rendering reviews meaningless.
- Breakdown of Role-Based Model Operations: Impossible to delegate tasks (e.g., Coder = minimax-m3:free / Reviewer = glm-5.2:free).
- Potential Cost Incidents: If using a paid model for the coordinator, all workers might unintentionally run on paid models.
Environment
- jcode: v0.81.6 (4f0f9819a)
settings.json:
{
"default_provider": "openrouter",
"model": "openrouter/free"
}
config.toml[agents]:
[agents]
swarm_spawn_mode = "inline"
swarm_strip_layout = "vertical"
memory_sidecar_enabled = true
memory_rerank_cadence = 3
memory_rerank_votes = 2
memory_rerank_min_agree = 2
memory_embedding_backend = "local"
swarm_max_concurrent_agents = 32
→ swarm_model not set (Could this be the cause? Though spawn parameters being ignored is a separate issue).
agents.swarm_modelis single-value only (multiple not allowed).- Coordinator model:
deepseek-v4-flash(via OpenCode Go? Evidence found in journal under"provider":"openai-compatible:opencode-go").
list_models Header (Relevant Output)
Current coordinator model: deepseek-v4-flash
No agents.swarm_model pin configured (workers inherit the coordinator's model).
(configure agents.swarm_model with a bare model or route-pinned value)
Possible Causes (Hypothesis)
- Spawn API ignores the
modelparameter: The spawn tool schema might include it, but implementation is missing. - Hardcoded coordinator inheritance when
agents.swarm_modelis unset: Spawn-side models only take effect ifswarm_modelis configured globally. - Model name normalization issue:
z-ai/glm-5.2:freefails to resolve in the backend, triggering a fallback.
Suggested Fixes
- Ensure spawn
model/providerparameters are respected (Highest priority). - Prioritize spawn-parameter models even if
agents.swarm_modelis unset. - Documentation: Either document the limitation that models cannot be overridden at spawn time, or fix the implementation.
Workaround (Current)
- Set
swarm_model = "z-ai/glm-5.2:free"under[agents]in~/.jcode/config.toml(unverified, though suggested bylist_modelshelp text). - However, this forces a single fixed model globally, making role-based separation impossible.
Attachments
- Reproduction session journal:
session_hog_1788536706117_67b74ae9a3cf5916(Experiment 1) - Reproduction session journal:
session_kitten_1788537002476_f9127c22cd55af65(Experiment 2)
(Actual measured values are logged in the"model"field of these files)
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 tracing the swarm spawn model-selection path and compare it with the agents.swarm_model handling described by list_models. Reproduce both model forms from the issue, then inspect the referenced session journals and confirm that the requested model and provider are recorded instead of deepseek-v4-flash; done means both spawn requests select their specified models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100