Skip to content

Honor single-model mode for titles and default agents to the parent model - #575

Merged
m-aebrer merged 5 commits into
masterfrom
feature/issue-574-parent-model-defaults
Nov 12, 2026
Merged

m-aebrer merged 5 commits into
masterfrom
feature/issue-574-parent-model-defaults

Conversation

@aebrer

@aebrer aebrer commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #574

Honor single-model mode in the title generator's default Explore route and remove bundled provider-specific agent model defaults so unconfigured agents inherit the parent model.

Preserve explicit title pins and user-configured agent routing. Include regression coverage for exact parent provider/model inheritance.

Planning only: this draft currently contains an empty setup commit. Implementation plan follows in a comment.

@aebrer

aebrer commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Implementation Plan

Scope and analysis

Authoritative scope: #574 and its four acceptance criteria. Related historical issues are context, not additional requirements.

TabTitleGenerator.resolveModel() currently handles an explicit title pin, then the Explore settings/frontmatter route, then the parent. It has no single-model-mode dependency. There are three production construction sites: automatic TUI, automatic RPC, and on-demand RPC used by Dashboard's saved-session title generator.

Subagent spawning already has a no-model-configured parent-inheritance path. All eleven bundled definitions currently supply Anthropic/ZAI fallback lists, preventing that path from being the ordinary default. Removing those fields should reuse existing precedence rather than introduce a new routing policy.

Exact parent identity needs protection: resolveModelStringSingle() treats any slash-containing string as a potentially provider-qualified selection and drops the supplied parent-provider constraint. A read-only, in-memory resolver fixture confirmed that a parent at provider openrouter, model ID anthropic/claude-fixture, can resolve to provider anthropic, model ID claude-fixture. The implementation must preserve the known parent provider/model pair, not reinterpret an inherited model ID as user routing input.

Deliverables and approach

  1. Make default title routing honor single-model mode. Add a live settings getter to the title generator's dependencies and wire it at all three construction sites. Preserve the existing explicit tabTitle.model branch. For the unpinned route, check single-model mode before reading Explore overrides/frontmatter or entering model resolution/probing, and use the current parent model directly when enabled. Keep existing automatic/on-demand failure reporting and title-generation lifecycle behavior.
  2. Make bundled agents inherit by default. Remove model frontmatter from all eleven bundled definitions without replacing it with another model list. Preserve agent names, tools, prompts, and role contracts. Reuse the existing override/settings/definition/parent precedence, while ensuring inherited selections retain the exact parent provider and model ID, including IDs containing slashes. Keep explicitly configured routing and the optional arbiter's existing behavior; single-model mode continues to bypass the arbiter.
  3. Align model-routing instructions and docs. Explain that model frontmatter is optional and bundled agents inherit the parent unless explicitly configured. Remove claims that built-in roles automatically select a model tier or provide model-family diversity. Document the unpinned title route's single-model-mode exception and leave explicit title-pin semantics unchanged.
  4. Add regression evidence at the shared generator, caller wiring, and actual subagent-spawn boundaries. Use the existing Vitest infrastructure with mocked inference/processes and isolated agent definitions; no new framework or dependencies are needed.

Acceptance criteria and verification

Issue acceptance criterion Verification
Unpinned title generation uses the exact parent provider/model in single-model mode in TUI and RPC/Dashboard, regardless of Explore model configuration, without resolving/probing those models Generator tests exercise settings-override and frontmatter configurations; caller tests cover TUI and both RPC construction paths
No bundled agent retains Anthropic/ZAI model selections or fallback lists Enumerate and parse every bundled definition using the production parser; assert model is absent while required metadata and role contracts remain valid
With single-model mode disabled and no explicit model configuration, absent/empty agent settings inherit the exact parent; omitted agent still defaults to Explore Drive production executeSingle() and the real subagent tool with mocked child processes, asserting exact --provider and --model values
Unpinned title generation inherits the parent when Explore has no model/fallback configuration Exercise the unconfigured Explore route with absent and empty settings overrides and a definition without model frontmatter

Files to modify or create

Paths below are under packages/coding-agent/ unless explicitly marked otherwise.

Runtime

  • src/core/tab-title.ts — live single-model-mode dependency and unpinned-route enforcement.
  • src/modes/interactive/interactive-mode.ts — supply effective settings through a getter.
  • src/modes/rpc/rpc-mode.ts — supply the getter for automatic and on-demand generation; retain durable-settings reload behavior.
  • src/core/tools/subagent.ts — preserve exact inherited parent identity and update model-routing prompt guidance. Avoid redesigning explicit model-string resolution.

Bundled definitions — remove only their model defaults

  • agents/explore.md
  • agents/sandbox.md
  • agents/feature-dev.md
  • agents/code-reviewer.md
  • agents/error-auditor.md
  • agents/test-reviewer.md
  • agents/completeness-checker.md
  • agents/simplifier.md
  • agents/independent-assessor.md
  • agents/developers-advocate.md
  • agents/devils-advocate.md

Tests

  • test/tab-title.test.ts
  • test/interactive-mode-tab-title.test.ts — new focused TUI initialization/wiring tests, following the existing fake-instance/prototype test pattern.
  • test/rpc-dashboard-commands.test.ts
  • test/rpc-generate-session-title.test.ts
  • test/builtin-agents.test.ts
  • test/subagent-model-fallback.test.ts

Documentation and shipped workflow instructions

  • Repository-root README.md and packages/coding-agent/README.md — default agent inheritance and title routing.
  • docs/agent-models.md and docs/settings.md — optional model configuration, absent/empty overrides, and the single-model-mode title exception.
  • docs/mach6.md — remove the bundled strong-tier/fallback-list claim.
  • skills/mach6-issue/SKILL.md and skills/mach6-plan/SKILL.md — correct the claim that definitions always specify their own model.
  • skills/mach6-review/SKILL.md — qualify model-family diversity as dependent on configured routing, not an automatic result of choosing different agent roles. Do not change review stages or authority rules.

Check adjacent documentation references for conflicting statements; retain intentional explicit model examples and historical changelog entries. AGENTS.md and Dashboard integration were checked: no development-guide rule, Dashboard layout, transport, or settings-schema changes are required.

Testing approach

  • Title generator: Parameterize Explore settings/frontmatter selections under single-model mode and assert parent-model completion with no Explore parser/resolver/probe path. Verify disabled/omitted single-model-mode dependencies keep existing routing. Cover current parent-model/settings values at generation time, exact provider identity, absent/empty overrides, and missing-parent behavior without escaping to Explore. Retain tests for explicit pins, invalid pins, provider failure, parent retries, disabled generation, named-session protection, and on-demand errors.
  • TUI wiring: Invoke the actual title initializer with a lightweight fake session/settings manager and capture generator dependencies. Verify the settings and model getters reflect current effective values rather than construction-time snapshots. Reuse the existing prototype-testing pattern without starting a terminal or making inference calls.
  • RPC wiring: Extend the existing automatic-constructor dependency capture in rpc-dashboard-commands.test.ts. In rpc-generate-session-title.test.ts, use mocked completions/resolution plus real shared-settings fixtures to verify on-demand single-model-mode enforcement and durable changes. Update runtime/settings mocks for the added getter.
  • Bundled defaults and subagent inheritance: Use production parsing over all bundled files, isolate user/project overrides, and exercise normal mode with no model in the definition and absent/empty settings. Include omitted-agent/default Explore, a named bundled role, representative parallel/chain paths, a live parent switch, and a slash-containing parent ID whose prefix is also another registered provider. Assert actual child CLI arguments rather than only acceptance of configuration. Preserve existing explicit per-call/settings/frontmatter precedence, fallback, and single-model-mode tests.
  • Model-facing guidance: Extend existing prompt-guideline tests to state inheritance and optional configuration, without asserting automatic role-specific model tiers. Existing role-boundary tests must remain intact.
  • Validation after implementation: Run focused tests, then the complete coding-agent package suite; run Biome on changed files and npx tsgo --noEmit; run the full npm run build and npm run verify-workspace-links. Build before any real-binary test. No live provider tests or manual billed inference without explicit approval. No screenshot regeneration is needed because the plan changes no Dashboard layout or appearance.

Risks, boundaries, and open questions

  • A single-model-mode check before the explicit title-pin branch would change excluded behavior; keep the pin's existing precedence and error/retry semantics.
  • Inherited IDs and explicit provider/model strings are different inputs. Protect the known parent identity without broadening changes to user-specified routing or changing explicit fallback precedence.
  • User/project agent definitions may intentionally retain model lists; do not rewrite or migrate them. Tests must not depend on agent definitions installed on the developer's machine.
  • Removing shipped defaults also removes automatic model-tier and family separation. Documentation must not promise either; agent roles and user configuration remain available.
  • Reuse the shared generator for the on-demand path so Dashboard does not keep a separate policy; the parent for saved-session generation remains the utility runtime's current model.
  • No new setting, UI, protocol field, dependency, routing-policy redesign, or changes to agent role contracts. No blocking open scope questions remain.

Planning checkpoint

This PR currently contains only an empty setup commit, with no implementation changes. Its normal commit hooks passed lint/type-check and the offline test suite: 7,328 passed, 0 failed, 752 skipped.


Plan created by mach6

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Vitest coverage

Metric Covered Total Coverage
Statements 40583 59971 67.67%
Branches 22827 37808 60.37%
Functions 9010 12897 69.86%
Lines 29191 43424 67.22%

View full coverage run

@aebrer

aebrer commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Progress Update

Implemented the approved plan for issue 574 and pushed it to feature/issue-574-parent-model-defaults.

Commit: a48add9e013311cbc6c7a642a1b97fb695b85eee — fix: honor single-model titles and inherit parent models by default

Changes

  • Unpinned titles now read single-model mode at generation time and use the current parent model directly, without consulting Explore configuration/frontmatter or resolving/probing its alternatives. Wired live getters into TUI automatic, RPC automatic, and saved-session title generation. Explicit tabTitle.model pins retain their existing behavior.
  • Removed model defaults from all 11 bundled agent definitions. Unconfigured agents, including omitted-agent/default Explore calls, inherit the exact parent provider/model with absent or empty per-agent settings.
  • Inherited slash-containing model IDs are no longer interpreted as explicit provider/model selections. Exact parent identity is preserved in normal mode, single-model mode, and final parent fallback paths; missing models/authentication still fail explicitly. User-defined agent files and explicit routing precedence remain unchanged.
  • Added regression coverage for live mode/model changes, saved settings reloads, title failure/pin behavior, production parsing of bundled agents, and actual mocked child provider/model arguments in single, parallel, and chain calls.
  • Updated root/package READMEs, routing/settings/RPC/Dashboard/mach6 docs, tool guidance, and relevant skills to describe parent inheritance and explicitly configured model diversity accurately.

Validation

  • Full offline workspace suite: 7,361 passed, 0 failed, 752 skipped, also rerun successfully by the commit hook. Live provider tests remained disabled.
  • Complete coding-agent suite: 3,658 passed, 51 skipped.
  • Repository-wide Biome and npx tsgo --noEmit: passed.
  • Full npm run build and npm run verify-workspace-links: passed.
  • Diff checks passed; the build left the lockfile and generated model source unchanged. Working tree is clean after pushing.

Implementation is durably saved. Formal review has not started; the PR remains draft.


Progress tracked by mach6

@m-aebrer
m-aebrer marked this pull request as ready for review November 12, 2026 18:31
@m-aebrer

Copy link
Copy Markdown
Collaborator

Unverified Review Candidates — Pending Assessment

Review round: 1
Reviewed commit: a48add9

These are unverified candidates. Severity reflects reviewer confidence; do not treat any item as a merge blocker until the assessment comment is posted.

Critical

None.

Important

Finding 1 — Inherited parent identity is re-parsed by the child CLI and can silently change models (code-reviewer 100, error-auditor 88)
packages/coding-agent/src/core/tools/subagent.ts — resolveParentModel (≈970–998) correctly approves the exact pair, and spawnSubagent (≈414–422) passes --model <id> --provider <provider>. The child's resolveCliModel (model-resolver.ts ≈422–427) then strips a leading <provider>/ from the model ID ("tolerate --model /") and pattern-matches the remainder. For built-in registry models whose IDs begin with their own provider name, the child runs a different model:

  • openrouter / openrouter/auto → child resolves openrouter / auto (a separate "Auto" entry, not "Auto Router") — reproduced against the production resolver at this commit.
  • openrouter / openrouter/free → reported by error-auditor to fuzzy-match an unrelated :free model.
  • Self-prefixed built-in IDs: openrouter/auto, openrouter/auto-beta, openrouter/auto-code, openrouter/free, openrouter/pareto-code (plus any custom models.json provider using the same convention).
    Since bundled agents now inherit the parent by default, every unconfigured subagent (and single-model mode, which promises the parent model) takes this path, with no warning. The new tests assert spawn arguments only, not the child's resolution of them.

Finding 2 — A parent running on a custom (non-catalog) model cannot be inherited; every default subagent call fails with a misleading error (code-reviewer 98, error-auditor 80)
packages/coding-agent/src/core/tools/subagent.ts ≈984–990: resolveParentModel requires registry.getAll() to contain the exact pair. The main CLI deliberately accepts custom IDs on known providers via resolveCliModel's synthetic fallback (e.g. dreb --provider openai --model gpt-99-preview) and does not register that object. Such a session now gets Parent model "openai/gpt-99-preview" not found. Use --list-models… for every default subagent call (default Explore, all mach6 reviewers, single-model mode), even though a child given the same flags would accept the model. Reviewers suggest either inheriting the exact pair or failing with an accurate, actionable message.

Suggestions

Finding 3 — Stale "Explore route" wording for the unpinned title route (code-reviewer 99, completeness-checker 82)
With single-model mode on, the unpinned route no longer uses Explore, but:

  • packages/dashboard/src/client/screens/settings.tsx:677 button label "automatic (Explore route)", :1489 picker clearLabel, and comment at :454.
  • packages/coding-agent/README.md:282 (paragraph edited by this PR) still says "clearing a pinned model back to the automatic Explore route", while the root README.md now says "the automatic route".

Finding 4 — No test exercises the provider-equality clause of exact parent matching (test-reviewer 82)
resolveParentModel matches m.provider === parentProvider && m.id === parentModel, but no fixture registers the same bare ID under two providers. Test-reviewer confirmed in a scratch copy that dropping the provider clause leaves all subagent tests green. A regression would let a gateway/proxy parent (e.g. github-copilot/gpt-4o alongside openai/gpt-4o) spawn children on whichever provider getAll() returns first.

Finding 5 — parentFallback ternary in executeSingle is now dead (simplifier 95)
subagent.ts ≈1420–1433: const parentFallback = configuredModelSpec ? parentModel : undefined; — the resolveModelForSubagentSpawn arm is only reachable when configuredModelSpec is truthy, so parentFallback is always parentModel. The variable and ternary can be removed with identical behavior.

Strengths

  • All three production TabTitleGenerator construction sites (TUI automatic, RPC automatic, RPC on-demand) receive live getSingleModelMode getters; test-reviewer confirmed removing any one fails its tests.
  • The single-model check sits after the explicit tabTitle.model pin and before any Explore lookup/probe, with tests asserting no Explore parse/resolve/probe.
  • All 11 bundled model: defaults removed without touching role prompts; builtin-agents.test.ts now uses the production parser and asserts model is absent.
  • The slash-ID parent fixture (openrouter / anthropic/primary-model with a real anthropic provider) genuinely fails on the old resolver at all four call sites.
  • Real-tool tests isolate from user-level agent definitions and assert actual child --provider/--model args; focused suites pass (312/312).
  • Documentation consistently removes claims of automatic model tiers / model-family diversity.

Agents run: code-reviewer, error-auditor, test-reviewer, completeness-checker, simplifier


Reviewed by mach6

@m-aebrer

Copy link
Copy Markdown
Collaborator

Review Assessment

Findings: #575 (comment)

Review round: 1 (independent-assessor only)
Assessed commit: a48add9

Classifications

Finding Classification Reasoning
Finding 1 — child CLI re-parses the inherited parent identity merge blocker Factual: Confirmed. resolveParentModel approves the exact pair, and spawnSubagent passes --model <id> --provider <provider>. The child's unchanged resolveCliModel (model-resolver.ts ≈421–427) removes a leading <provider>/ and pattern-matches the rest. Probes against the production resolver and the real catalog show openrouter / openrouter/auto resolving to the separate auto entry, and openrouter / openrouter/free resolving to an unrelated xingchen-agi/xing4.0-29b-a4b:free. The other self-prefixed IDs happen to resolve correctly. Scope: Acceptance criterion 3 requires that subagents "inherit the parent's exact provider/model". The approved plan commits to keeping the exact parent provider and model ID, "including IDs containing slashes". Single-model mode had the same wrong result on master. This PR makes parent inheritance the default for every unconfigured subagent, so the problem now reaches default Explore and every bundled role. Practical: A user whose parent session runs on OpenRouter's Auto Router or Free router gets every default subagent on a different upstream model, including in single-model mode, with no warning. That is a silent model substitution and a direct violation of the criterion. The new tests check spawn arguments only, so they cannot catch it.
Finding 2 — a parent on a custom (non-catalog) model cannot be inherited useful follow-up Factual: Confirmed. main.ts (≈554–568) accepts resolveCliModel's synthetic fallback with only a warning, and that object is never registered. resolveParentModel (≈984–990) therefore rejects it with Parent model "…" not found. Use --list-models…, which is misleading because a child given the same flags would accept the ID. Scope: Edge of scope. Missing parents failing explicitly was a stated design choice, and single-model mode failed the same way on master. In normal mode this is a partial behavior change: on master, users with zai/anthropic auth used to land on those bundled models. Practical: Rare trigger (a deliberate custom, non-catalog main model). The failure is loud and has simple workarounds (a models.json entry or agentModels). Only the error message is wrong. Worth fixing later, either by inheriting the exact pair when the provider is known and authenticated, or by giving an accurate, actionable message.
Finding 3 — stale "Explore route" wording nitpick Factual: Confirmed. dashboard/src/client/screens/settings.tsx:677 (button label), :1489 (clearLabel), and the comment at :454 are unconditional. packages/coding-agent/README.md:282, a paragraph this PR rewrote, still says "back to the automatic Explore route", while the root README now says "the automatic route". Scope: The plan excluded dashboard settings changes, but the issue asks for accurate package README docs. Practical: Cosmetic. Behavior and the authoritative docs (settings.md, dashboard.md, rpc.md, root README) are correct. It is cheap to fold into the fix round.
Finding 4 — the provider-equality clause has no test useful follow-up Factual: Confirmed. resolveParentModel matches m.provider === parentProvider && m.id === parentModel, but no fixture registers the same bare ID under two providers. A scratch mutation that drops the provider clause leaves every test green. Scope: The code is correct today. A missing test alone is not a blocker. Practical: The clause matters: about 230 bare IDs in the real catalog exist under several providers (for example gpt-4 and claude-sonnet-4-5). If the clause regressed, children would silently move to another provider, with different auth and billing. One small fixture would protect it.
Finding 5 — dead parentFallback ternary in executeSingle useful follow-up Factual: Confirmed. The resolveModelForSubagentSpawn arm is reachable only when configuredModelSpec is truthy, so configuredModelSpec ? parentModel : undefined always evaluates to parentModel. Scope: The ternary predates this PR; the new first arm is what makes it dead. Practical: No effect on behavior. It is a trivial cleanup, in line with the project's view that dead code is a liability.

Action Plan

  1. Finding 1: Make the inherited exact provider/model pair survive the child's CLI parsing. One direction: when both --provider and --model are given, try an exact ID match within that provider before stripping the <provider>/ prefix. The existing case of a provider-prefixed model with no exact ID would still fall through unchanged. Add a regression test that drives production executeSingle and feeds the spawned --provider/--model arguments through the real child-side resolver for a self-prefixed parent (openrouter / openrouter/auto and openrouter/free), asserting that the child resolves the identical pair in both normal and single-model mode.

Assessment by mach6

@m-aebrer

Copy link
Copy Markdown
Collaborator

Progress Update

Fixed the round 1 merge blocker (finding 1) and finding 2, the latter by explicit user request with the direction to inherit custom parents automatically from the working parent model.

Commit: 4a376731b8cd702c357c2dc64c36d71aa4276734: fix: keep inherited parent models exact through child resolution

Finding 1: the child could run a different model than the parent

  • Problem: when --provider is given, resolveCliModel (model-resolver.ts) stripped a leading <provider>/ from the model ID before matching it. As a result, openrouter / openrouter/auto resolved to the separate auto entry, and openrouter/free resolved to an unrelated :free model.
  • Fix: when --provider is given, an exact ID within that provider now wins before any prefix stripping. A redundant prefix is still stripped when no exact ID exists, e.g. --provider openai --model openai/gpt-4o.
  • Also changes the main CLI: --provider openrouter --model openrouter/auto now selects the Auto Router. The CLI options table documents this.
  • Verified: with the rebuilt resolver, all 1,377 built-in catalog models round-trip exactly through the child's --provider/--model arguments.

Finding 2: a custom parent model can now be inherited

  • Same resolution as the child: resolveParentModel (subagent.ts) now resolves the parent's model exactly the way the child will resolve its --provider/--model arguments. A custom (non-catalog) model that the main CLI accepted is therefore inherited as-is.
  • Thinking validation: the concrete model object is passed through the single-model, unconfigured, and last-resort parent-fallback paths. thinking overrides are validated against it, so custom parents no longer fail with "no concrete child model was resolved".
  • Loud failures remain: spawning still fails with a clear message when the provider is unknown or unauthenticated, or when the child would land on a different model. One example is a retired parent ID that would now fuzzy-match a sibling model; the message names the model it would run.

Tests

  • Every new path is tested in both normal and single-model mode. The tests drive production executeSingle and feed the spawned arguments through the real child-side resolver. Covered parents:

    • a slash ID whose prefix is another provider
    • openrouter/auto and openrouter/free
    • the same bare ID registered under two providers
    • a custom parent model

    Further tests cover thinking validation against an inherited custom model, the parent identity on both fallback paths, and three loud-rejection cases. model-resolver.test.ts adds a unit test for the exact-ID rule.

  • Updated tests: four existing tests used made-up parent IDs to mean "the parent cannot be resolved". Those IDs would now be inherited as custom models, so the tests use retired IDs that a child would resolve to another model. The tests keep their original intent.

  • Mutation checks: each regression was reintroduced in turn (the prefix-strip resolver, the old registry-only parent lookup, dropping the provider-equality match, removing the concrete-model hand-off). In each case the new tests failed.

Docs

docs/agent-models.md and packages/coding-agent/README.md now describe exact inheritance, covering provider-prefixed and custom IDs and the loud-failure cases, plus the CLI --model exact-ID behavior.

Validation

  • Tests: full offline workspace suite (commit hook) passed: 7,381 passed, 0 failed, 753 skipped. Live provider tests stayed disabled.
  • Lint and types: repository-wide Biome and npx tsgo --noEmit passed.
  • Build: full npm run build and npm run verify-workspace-links passed. The build left the lockfile untouched.

Findings 3–5 (nitpick and useful follow-ups) were not part of this batch.


Progress tracked by mach6

@m-aebrer

Copy link
Copy Markdown
Collaborator

Unverified Review Candidates — Pending Assessment

Review round: 2
Reviewed commit: 4a37673

These are unverified candidates. Severity reflects reviewer confidence; do not treat any item as a merge blocker until the assessment comment is posted.

Round-1 status (reported by agents, pending assessment)

  • Round-1 finding 1 (child CLI re-parses the inherited parent identity): code-reviewer and error-auditor report it fixed. All 1,377 built-in catalog models round-trip exactly through the spawned --provider/--model arguments, including openrouter/auto and openrouter/free.
  • Round-1 finding 2 (custom parent model): reported fixed for ordinary custom IDs. A self-prefixed custom ID is still rejected (finding 2 below).
  • Round-1 finding 4 (provider-equality test): now covered. Mutating the exact-ID rule to ignore the provider fails 9 tests.
  • Round-1 findings 3 and 5 are still present; they are carried forward as findings 5 and 6.

Critical

None.

Important

Finding 1: A thinking suffix bypasses the new exact-ID rule in resolveCliModel (code-reviewer 100)
packages/coding-agent/src/core/model-resolver.ts ≈427–438: the exact check compares the whole cliModel, so providerModels.find((m) => m.id === cliModel) misses when the argument carries a :<thinking> suffix. Prefix stripping then reinterprets the ID. Production-resolver probes against the built-in catalog:

--provider --model resolved ID
openrouter openrouter/auto openrouter/auto
openrouter openrouter/auto:high auto
openrouter openrouter/free:high thinkingmachines/inkling-2-small:free

The suffixed results come back with thinkingLevel: "high" and no warning, and main.ts accepts them. Subagent spawning passes thinking as a separate --thinking flag, so this affects only the main CLI's :level shorthand.

Finding 2: A self-prefixed custom (non-catalog) parent still cannot be inherited (code-reviewer 100)
packages/coding-agent/src/core/tools/subagent.ts ≈991–1001 (resolveParentModel): the main CLI accepts dreb --model openrouter/openrouter/future-router and creates provider openrouter, ID openrouter/future-router as a synthetic custom model. Inheritance passes --provider openrouter --model openrouter/future-router. The ID matches no catalog entry, so it misses the exact rule. The prefix is stripped to future-router, and the identity guard rejects every default subagent spawn. This was reproduced through production executeSingle() in normal mode, single-model mode, and the parent-fallback resolver. The failure is loud. Suggested direction: spawn with arguments that round-trip, such as the fully qualified form, or add an exact-identity spawn path.

Finding 3: The exact-inheritance check uses the parent's in-memory registry, but the child re-reads models.json (error-auditor 80)
resolveParentModel (subagent.ts ≈980–1011) checks the round trip against the parent's ModelRegistry, which is not refreshed before a spawn. The child builds a fresh registry from disk. Trigger sequence:

  1. A session runs on custom provider myproxy, model foo-v1.
  2. The user renames that entry to foo-v1.1 in models.json, without /reload or /model.
  3. The agent spawns any unconfigured subagent.

The parent-side check passes on the stale registry. The child's resolveCliModel partially matches foo-v1.1, with no warning and no synthetic flag. Reproduced with the built dist resolver and registry. docs/agent-models.md (added by this PR) promises that exactly this "parent ID since removed from models.json that now partially matches another model" case fails loudly. Suggested direction: verify the exact identity on the child side (an exact-model flag or env var), refresh the registry before resolving, or narrow the documentation claim.

Finding 4: The arbiter proposal and the single-model warning mis-render self-prefixed inherited parents, and no test covers either (test-reviewer 82)
executeSingle builds proposed.model (≈1482–1490) and the single-model "Using parent model …" warning (≈1434) with canonicalModelRef (≈310). That helper returns the ID unchanged when it already starts with provider/. Scratch test in a /tmp worktree with parent openrouter / openrouter/auto and a separate openrouter / auto registered:

  • Single-model warning: names "openrouter/auto", which in canonical form is the other model. The child actually ran the router.
  • Arbiter proposal: the arbiter receives proposed.model = "openrouter/auto". If it accepts the proposal unchanged, the decision is split at the first slash and registry.find("openrouter", "auto") selects the other model. Otherwise it fails as out of scope.

The helper predates this PR. This PR makes the inherited parent the default route for every unconfigured agent, so the path now carries those IDs. Mutations that blank the proposal for inherited routes, or that change canonicalModelRef to always prefix, leave all 14 subagent*/dispatch* test files and the 7 changed files green. The arbiter is optional and off by default.

Suggestions

Finding 5: Stale "Explore route" wording for the unpinned title route (completeness-checker 82; carried over from round-1 finding 3)

  • packages/coding-agent/README.md:282, in a paragraph this PR rewrote: "clearing a pinned model back to the automatic Explore route". The root README and docs/settings.md now say "the automatic route".
  • Related: packages/dashboard/src/client/screens/settings.tsx:677 and :1489 (label "automatic (Explore route)"), plus the comment at :454. These strings are asserted in packages/dashboard/test/client/screens.test.tsx.
  • packages/dashboard/src/shared/protocol.ts:537 ("restoring Explore-agent routing").
  • The doc comment at packages/coding-agent/src/core/tab-title.ts:77 and the comment at packages/coding-agent/src/modes/rpc/rpc-mode.ts:399.

Finding 6: The parentFallback ternary in executeSingle is dead (simplifier 93; carried over from round-1 finding 5)
subagent.ts ≈1437: in every reachable state of the resolveModelForSubagentSpawn arm, configuredModelSpec ? parentModel : undefined equals parentModel. Pass parentModel directly.

Finding 7: The lowercased model string is computed twice (simplifier 88)
model-resolver.ts ≈428 and ≈436: cliModel.toLowerCase().startsWith(...) recomputes lower, which is defined a few lines above.

Finding 8: The new block re-filters provider models that candidates computes below (simplifier 80)
model-resolver.ts ≈426 vs ≈441: providerModels is the same filter, over the same array in the same order, as candidates. Hoisting candidates above the block avoids a second catalog filter on every resolution.

Finding 9: The test re-derives an identical cartesian product (simplifier 80)
test/subagent-model-fallback.test.ts ≈1862 and ≈1931: the [provider, id, flag] product is built twice. Share one neutrally named constant.

Strengths

  • Exact-ID rule: it fixes the round-1 blocker, and all 1,377 catalog models round-trip exactly through the child-side resolver.
  • Thinking validation: concrete custom parent models now reach it on the single-model, unconfigured, and parent-fallback paths.
  • Loud rejections: the three rejection messages (unknown provider, missing auth, "would run X instead") name the parent reference.
  • Tab titles: the single-model check sits after the explicit pin and before any Explore read or probe. It is wired live at all three construction sites, and mutations to each are caught.
  • Bundled agents: all 11 model defaults are removed. builtin-agents.test.ts uses the production parser.
  • Test design: inherited-parent tests run in both modes and cover slash IDs, router IDs, the same ID on two providers, and custom parents. They feed the spawned arguments back through the production resolveCliModel. Mutations to the exact-ID rule, provider scoping, concrete-model hand-off, wiring, and pin precedence are each caught.
  • Acceptance criteria: completeness-checker confirmed all four issue acceptance criteria and every planned doc, skill, and prompt surface. The only exception is the README clause in finding 5.
  • Validation: focused suites pass (389 tests), and CI is green on the reviewed commit.

Agents run: code-reviewer, error-auditor, test-reviewer, completeness-checker, simplifier


Reviewed by mach6

@m-aebrer

Copy link
Copy Markdown
Collaborator

Review Assessment

Findings: #575 (comment)

Review round: 2 (independent-assessor only)
Assessed commit: 4a37673

Round-1 blocker verification: the round-1 finding 1 fix holds. Catalog IDs round-trip exactly through the child-side resolver; for example, openrouter / openrouter/auto stays the Auto Router. Ordinary custom parents inherit, and the provider-equality clause is covered by the two-provider fixture. All four issue acceptance criteria are verified.

Classifications

Finding Classification Reasoning
Finding 1: a :thinking suffix bypasses the exact-ID rule deferred Factual: Confirmed against the production resolver and catalog. --provider openrouter --model openrouter/auto:high resolves to auto, and openrouter/free:high resolves to the unrelated thinkingmachines/inkling-2-small:free. Both come back with no warning. The exact check compares the whole cliModel, suffix included. Scope: Subagent inheritance cannot reach it: spawnSubagent passes thinking as a separate --thinking flag and --model carries only the bare resolved ID. A master worktree gives identical results, so this is pre-existing main-CLI :level shorthand behavior that this PR did not change. It is outside the issue 574 acceptance criteria. Practical: This PR introduces no harm and amplifies none. It is a genuine pre-existing silent-substitution bug in resolveCliModel's suffix handling and deserves its own issue.
Finding 2: a self-prefixed custom parent cannot be inherited useful follow-up Factual: Confirmed. A parent on the synthetic openrouter / openrouter/future-router would resolve child-side to openrouter/future-router, so resolveParentModel rejects it loudly with an accurate "would run … instead" message. Ordinary custom parents, such as openai / gpt-99-preview, inherit correctly. Scope: The PR strictly improved this path: on master every custom parent failed with "not found". This is a narrow residual of the user-requested custom-parent fix, not a regression. Practical: The trigger is rare: an unregistered custom ID that starts with its own provider name. The failure is loud and accurate, and adding a models.json entry works around it.
Finding 3: the parent's check uses a stale in-memory registry while the child re-reads models.json useful follow-up Factual: Confirmed end to end. ModelRegistry.getAll() returns the cached list. refresh() runs on /reload and model switches but never before a spawn. Reproduced: a session on myproxy / foo-v1 whose models.json entry is renamed to foo-v1.1 without a reload passes the parent check, and the child silently runs foo-v1.1. The guard fires correctly once the registry is refreshed. The sentence this PR added to docs/agent-models.md ("fails loudly … a parent ID since removed from models.json") overclaims during that stale window. Scope: Master had the same window in single-model mode. This PR widens exposure by making inheritance the default route. Practical: The trigger is narrow and operational: hand-editing models.json mid-session, renaming the in-use model, skipping /reload, and hitting a fuzzy-match collision. The substitution lands on the user's own renamed entry, so it does not break a default workflow. Fix direction: call registry.refresh() before spawn-time parent resolution, or narrow the docs sentence.
Finding 4: the arbiter proposal and single-model warning mis-render self-prefixed inherited parents useful follow-up Factual: Confirmed. canonicalModelRef renders openrouter / openrouter/auto as openrouter/auto, which canonically names the separate auto entry; both exist in the catalog. The arbiter decision is split at the first slash. If the user's arbiter scope contains the auto alias, validateDecision accepts an echoed proposal and auto is spawned. Without the alias it fails loudly with out_of_scope_model. The single-model warning names openrouter/auto while the child correctly runs the router, so the text is misleading but execution is correct. Scope: The helper and the first-slash decoding predate this PR and were already reachable through doubly-prefixed configured specs. This PR makes them more reachable. Practical: Silent substitution needs all of these: the global-only arbiter, which is off by default; a non-empty explicit scope containing the colliding alias; a self-prefixed parent; and the arbiter echoing the proposal. Single-model mode, the issue's focus, bypasses the arbiter entirely. This is a real corner case behind an elaborate optional configuration and does not block merge.
Finding 5: stale "Explore route" wording nitpick Factual: Confirmed at packages/coding-agent/README.md:282, Dashboard settings.tsx:677/1489, protocol.ts:537, tab-title.ts:77, and rpc-mode.ts:399. Scope: The plan excluded Dashboard settings changes. The root README and docs/settings.md are correct. Practical: Cosmetic, and still accurate when single-model mode is off.
Finding 6: dead parentFallback ternary useful follow-up Factual: Still present at subagent.ts:1437. The resolveModelForSubagentSpawn arm is reachable only when configuredModelSpec is truthy, so the ternary always equals parentModel. Scope/Practical: It has no behavioral effect. It is a trivial cleanup, and project policy treats dead code as a liability.
Finding 7: lowercased model string computed twice nitpick Confirmed at model-resolver.ts:429 and :437. No behavioral impact.
Finding 8: redundant provider-models filter nitpick Confirmed: providerModels (:427) is the same filter as candidates (:441) when a provider is set. Trivial duplication.
Finding 9: duplicated test cartesian product nitpick Confirmed at subagent-model-fallback.test.ts:1862-1864 and :1931. The two flags mean different things, so sharing a constant saves little. Test style only.

Action Plan

No merge blockers.

Follow-ups outside the action plan, in priority order: finding 3 (refresh the registry before resolving the parent, or narrow the docs sentence), finding 4 (an exact-identity representation for arbiter proposals and decisions, plus disambiguated warning text), finding 2 (spawn arguments that round-trip self-prefixed custom IDs), and finding 6 (delete the dead ternary). Deferred to a separate issue: finding 1, the pre-existing main-CLI :thinking shorthand substitution.


Assessment by mach6

@m-aebrer
m-aebrer merged commit e140283 into master Nov 12, 2026
4 checks passed
@m-aebrer
m-aebrer deleted the feature/issue-574-parent-model-defaults branch November 12, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honor single-model mode for titles and default agents to the parent model

2 participants