feat(subagents): use fastModel for Explore subagent#4086
Conversation
Adds a "fast" keyword to the subagent model selector. When set, the runtime resolves it via Config.getFastModel() under the parent authType, falling back to inheriting the parent model when fastModel is unset or invalid for the current authType. The built-in Explore subagent opts in, so a configured fastModel automatically powers codebase searches without affecting other subagents or the main session.
E2E test summaryAll five scenarios run headless via
Known unrelated issue surfaced by T1 / T5When the Explore subagent runs under a model whose provider has a different |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
LaZzyMan
left a comment
There was a problem hiding this comment.
Review
Small, well-scoped feature that threads a new fast model selector through the existing subagent resolution pipeline and attaches it to the built-in Explore agent. The runtime path correctly reuses the single getFastModel() validity gate, so an unset or cross-authType-invalid fastModel silently falls back to inheriting the parent session model — matching the asymmetric behavior of every other getFastModel() call site. Tests cover the happy path and the qwen3-coder-flash / Fast look-alike disambiguation. The unquoted model: fast parses cleanly through the YAML frontmatter coercion.
Verdict
APPROVE — well-scoped, behavior is consistent with existing fastModel call sites; the silent-fallback debug log and a validateModel('fast') test would be nice non-blocking follow-ups.
Summary
Exploresubagent now uses the configuredfastModel(e.g.qwen3-coder-flash) when one is available, falling back to inheriting the main session model when it isn't.fastModel; Explore was the missing piece.fastkeyword in the subagent model selector, and the silent-fallback behavior whenfastModelis unset or invalid for the current authType.Validation
fastModelset, the Explore subagent's API calls go out under the fastModel id; the main session keeps using the main model. WithfastModelunset or set to an id not available for the current authType, Explore silently falls back to the main model (no error).fastModelin settings, runqwen --openai-logging --openai-logging-dir /tmp/logs "Use the Explore subagent to find any .md file", thenjq '.request.model' /tmp/logs/*.jsonand confirm the Explore-system-prompt call uses fastModel while parent calls use the main model.Scope / Risk
fastkeyword introduces an asymmetry in subagent model resolution —fastsilently degrades to inherit, while a bare model id error-surfaces if the provider rejects it. This is intentional (matches every othergetFastModel()call site in the codebase) and documented in the design doc.fastkeyword is only wired into Explore in this PR. User-defined subagents can opt in via frontmatter (model: fast) but that path hasn't been added to the subagent UI/wizard.model: fastare unchanged.Testing Matrix
Testing matrix notes:
node dist/cli.js). The change is platform-agnostic — pure TypeScript model-selection logic with no filesystem or OS-specific code paths.Linked Issues / Bugs
None.