feat(coding-agent): enabled task model role configuration for independent subtask execution

- Added task model role configuration enabling dedicated subtask execution with independent model selection.
- Changed default agent model from 'default' to 'pi/task' for independent subtask model configuration.
- Added single-pattern inheritance fallback allowing pi/task agents to inherit session model when unconfigured.
- Refactored model resolution logic into resolveAgentModelPatterns() function with structured fallback handling.
- Added resolveConfiguredModelPatterns() and helper functions for improved model pattern resolution.
This commit is contained in:
can1357
2026-03-14 13:38:11 +01:00
parent b5faa7d4be
commit 090a9cd14c
9 changed files with 158 additions and 80 deletions
+1 -1
View File
@@ -877,7 +877,7 @@ Key orchestration responsibilities in `TaskTool.execute(...)`:
- Re-discover available agents on each call with `discoverAgents(this.session.cwd)`.
- Validate agent existence (`getAgent(...)`), disabled-agent settings (`task.disabledAgents`), and task list integrity (non-empty IDs, case-insensitive duplicate detection).
- Resolve model/thinking/output schema precedence:
- model: `task.agentModelOverrides[agentName]` → agent frontmatter model (if non-default alias) → parent active model
- model: `task.agentModelOverrides[agentName]` → resolved agent frontmatter patterns (single inheriting aliases fall back to the parent active model) → parent active model
- output schema: agent frontmatter `output` → tool params `schema` → parent session schema
- Prepare shared context (`context.md`) and unique per-task IDs via `AgentOutputManager.allocateBatch(...)`.
- Execute all tasks with bounded concurrency using `mapWithConcurrencyLimit(...)` from `src/task/parallel.ts`.