Skip to content

Model router: unpinned agent-def delegations bypass the operator taxonomy — route defs that express no model intent #286

Closed

Description

@JAORMX

What happens

The semantic model router (ADR 0031/0042) is gated off for every agent: delegation — maybeRouteModel returns early on args.Agent != "" under the precedence rule "the router fills the gap; it never overrides pinned intent." But a def with no model: key never pinned model intent — it pinned scope (prompt/catalog/hooks). Its model resolves via def.Model > --subagent-model > session model (internal/app/agentdefs.go resolveModel), so an unpinned def silently inherits the session model.

Impact (observed)

Two dev-pipeline sessions, same operator taxonomy (large → glm-5.2, medium → deepseek-v4-pro):

  • Kimi K3 session (2e4ccc75db19): the plain spec/QA review delegations routed to medium → deepseek-v4-pro, while the agent: software-architect / ux-reviewer / code-duplication-reviewer / library-reuse-reviewer delegations all inherited kimi-k3 — a def-based review panel gets zero routing.
  • GLM-5.2 session (a4ba66b5d9ae): the same agent: software-architect delegation inherited glm-5.2 and only looked routed.

The effective model of a specialist is an accident of which session model the user picked — the operator's routing taxonomy, written to control exactly this, never applies.

Design opening

The model: inherit sentinel already exists (builtinModelAliases), so absent-vs-inherit can carry different semantics with no new syntax:

  • absent model: → the def is routable: router > --subagent-model > session model;
  • explicit model: inherit → pinned-to-parent, router gated (today's behaviour, opt-in).

Mechanics already exist

The per-call agent+model factory (ADR 0035, buildAgentModelEngineFactory) rebuilds a specialist's scoped engine (catalog/prompt/hooks/memory) on an override model. Routing an unpinned def is the same seam driven by the router instead of an explicit arg. Needs: composition telling the Subagent tool which def names are unpinned (e.g. a WithRoutableAgents(set) option), maybeRouteModel consulting it, and the routed model threading through agentModelFactory — with the existing inline-MCP decline (fail-soft inherit) and the writable-specialist path (read-write+agent) staying unrouted.

At minimum, if the design is rejected: document loudly that unpinned defs inherit the session model and are never routed, and recommend pinning model: in defs.

Related: ADR 0031, ADR 0035, ADR 0042; #285 (the read-write sibling gap).

Activity

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