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
e4726cb to
7a93e23
Compare
…o router alias A subagent whose config pins `model: auto` (e.g. history-analyzer, since letta-ai#1436) had its recommended handle resolve to a server-side router alias (`letta/auto`) and, for a cloud non-BYOK parent, that alias beat the parent's explicitly selected model in resolveSubagentModel. So `/init` history-analyzer subagents ran on whatever the auto router picked instead of the session's selected model, contradicting the "inherits from parent" contract in the Task tool schema. Treat the router-alias handles (`letta/auto`, `letta/auto-fast`, `letta/auto-chat`, `letta/auto-memory`) as non-pinning: a recommended alias no longer overrides a parent model. When no parent model exists the alias is still used, and free-tier defaults and the reflection carve-out are untouched. Also correct the initializing-memory skill doc, which described history-analyzer as running a "cheaper model (sonnet)" — it now inherits the session's selected model. Fixes letta-ai#3248
7a93e23 to
e220442
Compare
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.