fix(subagents): inherit parent model when recommended model is an auto router alias#3302
Open
abhay-codes07 wants to merge 1 commit into
Open
Conversation
…o router alias Builtin subagents like history-analyzer pin 'model: auto' in their frontmatter. resolveSubagentModel treated any non-inherit recommended model as an explicit pin that beats parent inheritance, so subagents spawned by /init ran on the server-side auto router's pick instead of the session's selected model, contradicting the Task tool's documented 'inherits from parent' contract. Treat a recommended model that resolves to a router alias (letta/auto, letta/auto-fast, letta/auto-chat, letta/auto-memory) as non-pinning: prefer the parent's model when one exists. The alias still applies when no parent model is set, free-tier defaults are unchanged, and the reflection carve-out is untouched. Fixes letta-ai#3248
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/inithistory-analyzer subagents (and any builtin whose frontmatter pinsmodel: auto) ran on the server-side auto router's pick (e.g.gpt-5.4) instead of the session's selected model (e.g.gpt-5.4-mini).resolveSubagentModeltreats any non-inheritrecommended model as an explicit pin that beats parent inheritance. Since chore: switch all subagent models to auto/auto-fast #1436 switched builtin subagents tomodel: auto, the resolvedletta/autohandle is always available, so for cloud non-BYOK parents the parent's model was unreachable — contradicting the Task tool's documented contract ("If not specified, inherits from parent"). Local-backend and BYOK parents already inherit; cloud non-BYOK was the remaining gap.letta/auto,letta/auto-fast,letta/auto-chat,letta/auto-memory) as non-pinning — prefer the parent's model when one exists. The alias still applies when no parent model is set, free-tier defaults (auto-fast/auto) are unchanged, and the reflection carve-out is untouched.Test plan
src/agent/subagent-model-resolution.test.ts:auto+ parent → parent;auto-fast+ parent → parent;autowith no parent →letta/auto(alias preserved); free tier + parent →letta/auto-fast(default preserved)resolveSubagentModelsuite (67 tests) +subagent-builtins+init-background-subagentpassbun run check— all 10 checks passAI disclosure
Per the disclosure policy proposed in #3139: this fix was developed with AI assistance (Claude Code). The root-cause analysis, implementation, and tests were AI-assisted; I reviewed, ran, and verified everything locally before submitting.
cc @devanshrj — follows the same shape as #3239; happy to adjust if you'd rather fix this at the frontmatter level (
model: inheriton history-analyzer) instead of in the resolver.