feat(agent): configure subagent roles and model bindings - #576
Open
changer-changer wants to merge 4 commits into
Open
changer-changer wants to merge 4 commits into
changer-changer wants to merge 4 commits into
Conversation
This was referenced Sep 13, 2026
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
Subagent types currently have fixed descriptions and tool presets, while a shared default or automatic routing determines their models. A parent cannot select a user-configured role such as visual inspection or careful review and reliably get the model and input capabilities intended for that role.
Add Settings → Agents → Subagents for built-in and custom roles: description, model binding, tool allowlist, read-only/enabled state, and maximum delegation depth. The parent selects
subagent_typeby description; the runtime applies the user's model binding. The settings preview and model-facing role catalog share the same formatter. Model names are not added to the catalog.agent.subagents.profiles; retain existing defaults and automatic routing for unbound roles. A bound model stays selected across child tool turns with its own token limits and input capabilities. Invalid bindings fail visibly.agenttool when permitted by the parent's tools andmaxDepth(default 1, supported range 0–5). Enforce depth, inherited read-only restrictions and cancellation at runtime; forward descendant activity to the root while preserving transcript parentage.Uses PilotDeck's existing synchronous child sessions.
task_idrestoration and background task management are outside this change. No new dependencies. Configuration and examples:docs/subagent-model-selection.md.Validation
tests/network/fetch.spec.tscases cancel on the unchanged baseline withPromise resolution is still pending but the event loop has already resolved; no network-test changes are included.Remote workflow approval and maintainer review remain separate from these local results.
补充背景:我是面壁智能黑客松参赛者,此前与团队成员交流时了解到这方面的使用需求,因此尝试补上实现,供团队评审。
Merge sequencing (added 2026-09-14)
This PR is one of four coordinated subagent-lifecycle PRs (#579, #576, #580, #581). The features are semantically independent but overlap textually in the agent core, so an explicit merge order is proposed in #583.
Proposed order: #579 → #576 → #580 → #581 (this PR: 2).
This branch's known conflicts: clean against current
main; 1 UI file with #579, 4 core files with #580 (AgentLoop.ts,SubAgentSession.ts,agent.ts,tool/protocol/types.ts), 3 core files with #581.After each sibling PR merges, I will rebase the remaining branches onto
mainand re-run the targeted test suites before updating the PRs.