Skip to content

swarm: tool description advertises model/model: "inherit" but schema strips it; error does not name the config keys #2148

Open

Description

@osmanaksu

Type: bug
Labels: bug, swarm, good first issue

Problem
Spawning a swarm worker with model: "inherit" (or any model value) fails with:

Agent-selected swarm models are disabled. Omit model to use the user-configured default.

The swarm tool's description documents model and model: "inherit" as valid parameters, but the tool schema strips the model property by default. The agent is told one thing by the prose and a different thing by the schema, passes the parameter anyway, and gets a generic error that does not name the config keys to change.

Code

  • crates/jcode-app-core/src/tool/swarm_model_schema.rs:10 — apply_swarm_model_policy does properties.remove("model") when !agents.swarm_model_selection || agents.swarm_model_allowlist.is_empty().
  • crates/jcode-config-types/src/lib.rs:680-684 — validate_swarm_model_request returns the error when !swarm_model_selection.
  • crates/jcode-base/src/config/default_file.rs:609-613 — defaults are swarm_model_selection = false, swarm_model_allowlist = [].

Repro

  1. Default config (swarm_model_selection = false).
  2. swarm spawn with model: "inherit" (or any model).
  3. All 5 spawns in a batch fail with the generic error.
  4. Re-spawning without model succeeds.

Suggested fix

  1. Make the swarm tool description for model/model: "inherit" conditional on the same policy as apply_swarm_model_policy. When selection is off, say workers inherit the coordinator's model and overrides require agents.swarm_model_selection = true plus an agents.swarm_model_allowlist entry.
  2. Name the config keys in the error: ...disabled. Set agents.swarm_model_selection = true and add the exact route to agents.swarm_model_allowlist, or omit model.

Acceptance

  • With selection off, schema and description both omit/hide model (no prose/schema contradiction).
  • The error, if still reachable, names the exact config keys.
  • Regression test: default config → schema has no model property AND description makes no unconditional claim about model: "inherit".

Activity

  1. added
    bug
    type: bug
    area: swarm
    autonomous: likely
    on Nov 13, 2026
  2. 1jehuang commented on Nov 13, 2026

    @1jehuang
    Owner

    Thanks. Confirmed in code: the schema drops model when selection is off, and the error text in validate_swarm_model_request does not name the config keys. A fix is proposed in #2154, waiting on maintainer review.


    — 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: swarmautonomous: likelybugtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions