Skip to content

Subagent mode:"read-write" silently ignores the per-call model (and the router pick) — the writable explorer is pinned to the child-default engine #285

Closed

Description

@JAORMX

What happens

A mode:"read-write" Subagent call with a per-call model runs on the inherited child-default model, not the requested one. The requested model is silently ignored — no error, no warning. The semantic model router (ADR 0031/0042) is discarded the same way: maybeRouteModel runs for writable calls (it gates only on model/agent/fork/resume), the classifier spends a turn, selectChildEngine may even mint an engine on the routed model — and then resolveEngineAndLimits unconditionally clobbers it:

// engine/agent/subagent.go (~1662)
if writable && strings.TrimSpace(args.Agent) == "" {
    engine = t.writableChildEngine
}

Why it's a bug, not a scope limit

The tool's published contract promises the combination in three places:

  • the model param spec: "Optional provider model id to pin THIS subagent to … Omit to inherit the parent's model" — no read-write carve-out;
  • the mode param spec: read-write "Cannot be combined with 'background' or with 'agent'+'model' together" — implying model alone composes;
  • validateMode's own rejection text for read-write+agent+model: "…or omit agent for a writable explorer on a chosen model".

ADR 0041 records "the per-call model arg does not re-engine a writable explorer, an accepted v1 residual" — but the contract that shipped says the opposite, and the model acts on the contract.

Impact (observed)

Session 2e4ccc75db19 (dev-pipeline on issue #246): the implementation delegation ("Implement effort confirm overlay", mode:"read-write") ran on the session/orchestrator model (kimi-k3) even though the operator taxonomy routes coding-heavy work to large → glm-5.2. Any workflow that implements via read-write subagents structurally pins all coding work to the session model — the exact task class the operator's large category exists for can never reach it. Plus one wasted classifier call + engine mint per writable delegation.

Fix sketch

  1. Add a writable per-model engine factory — the ADR 0058 precedent (buildAgentWritableEngineFactory rebuilds a writable specialist engine per call) shows the seam; the explorer needs the sibling (WithWritableEngineFactory / buildWritableModelEngineFactory: the writable explorer engine rebuilt on the override model, MAIN runner, direct-write parity). Consume it in resolveEngineAndLimits for writable && agent=="" when args.Model or routedModel is set; fall back to t.writableChildEngine when unwired (honest error for explicit model, fail-soft inherit for the router).
  2. Until (1) lands: validateMode should reject read-write+model loudly ("not supported yet; omit model") instead of silently ignoring — contract honesty — and maybeRouteModel should gate on writable so the classifier isn't spent on a call whose result is discarded.
  3. Update the model/mode spec text to match whatever behaviour ships.

Related: ADR 0041, ADR 0058, ADR 0031/0042.

Activity

  1. added 2 commits that reference this issue on Jul 21, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions