Repository navigation
Description
Summary
When the root (coordinator) session has a non-default reasoning effort set — specifically when it is in swarm mode with agents.swarm_root_effort configured (e.g. "none") — spawned swarm workers ignore it and fall back to DEFAULT_SWARM_WORKER_EFFORT ("low"). The root's effective effort should propagate to workers unless the worker explicitly overrides it via SDK requested_effort or the user has pinned agents.swarm_effort.
Root cause
resolve_swarm_spawn_effort in crates/jcode-app-core/src/server/spawn_policy.rs had only two fallback levels:
requested_effort(SDK explicit)agents.swarm_effortconfig pinDEFAULT_SWARM_WORKER_EFFORT("low")
The coordinator's own reasoning_effort was never consulted. A coordinator in swarm mode with swarm_root_effort = "none" would spawn workers at "low" (thinking enabled), contradicting the coordinator's explicit "no thinking" setting.
Code
crates/jcode-app-core/src/server/spawn_policy.rs:15-28—resolve_swarm_spawn_effortbefore the fix: 2-level fallback, no root inheritance.crates/jcode-app-core/src/server/spawn_model_selection.rs:40—CoordinatorSpawnIdentitylacked areasoning_effortfield.crates/jcode-app-core/src/server/comm_session.rs:421—spawn_swarm_agentdid not pass the coordinator's effort intoresolve_swarm_spawn_effort.crates/jcode-app-core/src/agent/provider.rs:374— nosession_reasoning_effort()accessor.
Steps to reproduce
- Set
agents.swarm_root_effort = "none"in config. - Start a coordinator session in
swarmmode (effort ="swarm"). - Spawn a swarm worker via
communicateorswarm spawn(no expliciteffort). - Observe: the worker runs at
"low"(thinking enabled), not"none".
Expected
Spawned workers inherit the coordinator's effective reasoning effort when the coordinator is in swarm mode, unless explicitly overridden.
Suggested fix
- In
spawn_policy.rs/spawn_model_selection.rs, when no expliciteffortis provided for a spawn, fall back to the root session's currentreasoning_effort(only when it is the"swarm"sentinel). - Thread the root effort through
comm_session.rsspawn path into the worker's provider config.
Acceptance criteria
- Root at
"swarm"+swarm_root_effort = "none"+ spawn without explicit effort → worker runs at"none". - Root at
"swarm"+swarm_effort = "high"config pin → worker runs at"high"(config pin wins over root). - Root at
"medium"(non-swarm) + spawn → worker runs at"low"(non-swarm root effort is ignored). - Explicit SDK
requested_effort = "low"→ worker runs at"low"(explicit wins over everything). - No root effort, no config → worker runs at
"low"(unchanged default).
Activity
fix(swarm): apply inherit sentinel bypass at tool-level validation
1jehuang commentedon Nov 13, 2026
Thanks. Confirmed in code:
resolve_swarm_spawn_effortinspawn_policy.rsonly consults the requested effort andagents.swarm_effortbefore falling back to the default. Whether workers should inherit the root effort is a behavior decision, so this waits on maintainer review of #2154.— Jcode agent (automated triage), on behalf of @1jehuang