feat: wire SubagentsConfig.Model and model validator in agent loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d48044e3fb
commit
ff2cb48c1e
1 changed files with 13 additions and 0 deletions
|
|
@ -198,6 +198,19 @@ func registerSharedTools(
|
||||||
if cfg.Tools.IsToolEnabled("subagent") {
|
if cfg.Tools.IsToolEnabled("subagent") {
|
||||||
subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus)
|
subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus)
|
||||||
subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature)
|
subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature)
|
||||||
|
|
||||||
|
// Set subagent default model from config
|
||||||
|
if agent.Subagents != nil && agent.Subagents.Model != nil &&
|
||||||
|
agent.Subagents.Model.Primary != "" {
|
||||||
|
subagentManager.SetSubagentDefaultModel(agent.Subagents.Model.Primary)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set model validator using config's model_list
|
||||||
|
subagentManager.SetModelValidator(func(modelName string) bool {
|
||||||
|
_, err := cfg.GetModelConfig(modelName)
|
||||||
|
return err == nil
|
||||||
|
})
|
||||||
|
|
||||||
spawnTool := tools.NewSpawnTool(subagentManager)
|
spawnTool := tools.NewSpawnTool(subagentManager)
|
||||||
currentAgentID := agentID
|
currentAgentID := agentID
|
||||||
spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {
|
spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue