fix(subagents): ensure model selection works for bare model IDs

- Handle bare model IDs by inheriting parent's authType
- Create dedicated ContentGenerator for any explicit model selection
- Add tests for model override scenarios

Previously, only cross-provider prefixed models (e.g., "openai:gpt-4o")
triggered ContentGenerator creation. Bare IDs like "qwen-coder" were
ignored, causing subagents to always use the parent's model.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-30 09:33:54 +00:00
parent 7ffadfbaf7
commit 7b29d1f4a3
3 changed files with 113 additions and 8 deletions

View file

@ -116,7 +116,7 @@ Use the optional `model` frontmatter field to control which model a subagent use
- `inherit`: Use the same model as the main conversation
- Omit the field: Same as `inherit`
- `glm-5`: Use that model ID with the main conversation's auth type
- `sonnet`, `opus`, `haiku`: Alias-style values are also accepted as model strings
- `openai:gpt-4o`: Use a different provider (resolves credentials from env vars)
#### Example Usage