feat(subagent): add configurable subagent model via config.yaml

Allow users to configure a dedicated model for subagents spawned by
delegate_task, so narrowly-scoped subtasks can use a cheaper/faster
model while the parent agent runs on a more powerful one.

Config:
  subagent:
    model: google/gemini-3-flash-preview

Precedence: explicit model arg > config.subagent.model > parent model.

Cherry-picked from PR #751 by Bartok9, rebased onto current main
with conflict resolution and simplified to model-only override
(provider/base_url/api_key stay inherited from parent — covers the
common case of same-provider model swap via OpenRouter).

Closes #609

Co-authored-by: Bartok Moltbot <bartokmoltbot@users.noreply.github.com>
This commit is contained in:
Bartok Moltbot 2026-03-10 23:45:05 -07:00 committed by teknium1
parent 58dbd81f03
commit 6bd1726422
2 changed files with 22 additions and 1 deletions

View file

@ -119,6 +119,13 @@ DEFAULT_CONFIG = {
},
},
# Subagent configuration — model/provider for tasks spawned via delegate_task.
# By default subagents inherit the parent agent's model and provider.
# Set "model" to use a cheaper/faster model for delegated subtasks.
"subagent": {
# "model": "google/gemini-3-flash-preview",
},
"display": {
"compact": False,
"personality": "kawaii",