Skip to content

swarm: root session effort not propagated to spawned workers #2153

Open

Description

@osmanaksu

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:

  1. requested_effort (SDK explicit)
  2. agents.swarm_effort config pin
  3. DEFAULT_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_effort before the fix: 2-level fallback, no root inheritance.
  • crates/jcode-app-core/src/server/spawn_model_selection.rs:40 — CoordinatorSpawnIdentity lacked a reasoning_effort field.
  • crates/jcode-app-core/src/server/comm_session.rs:421 — spawn_swarm_agent did not pass the coordinator's effort into resolve_swarm_spawn_effort.
  • crates/jcode-app-core/src/agent/provider.rs:374 — no session_reasoning_effort() accessor.

Steps to reproduce

  1. Set agents.swarm_root_effort = "none" in config.
  2. Start a coordinator session in swarm mode (effort = "swarm").
  3. Spawn a swarm worker via communicate or swarm spawn (no explicit effort).
  4. 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 explicit effort is provided for a spawn, fall back to the root session's current reasoning_effort (only when it is the "swarm" sentinel).
  • Thread the root effort through comm_session.rs spawn 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

  1. added
    bug
    type: bug
    area: swarm
    triage: needs-decision
    on Nov 13, 2026
  2. 1jehuang commented on Nov 13, 2026

    @1jehuang
    Owner

    Thanks. Confirmed in code: resolve_swarm_spawn_effort in spawn_policy.rs only consults the requested effort and agents.swarm_effort before 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: swarmbugtriage: needs-decisiontype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions