mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-03 04:47:29 +08:00
Slim subagent runtime surface and remove legacy interfaces
This commit is contained in:
@@ -45,7 +45,6 @@ type AgentRouterConfig struct {
|
||||
AllowDirectAgentChat bool `json:"allow_direct_agent_chat,omitempty"`
|
||||
MaxHops int `json:"max_hops,omitempty"`
|
||||
DefaultTimeoutSec int `json:"default_timeout_sec,omitempty"`
|
||||
DefaultWaitReply bool `json:"default_wait_reply,omitempty"`
|
||||
StickyThreadOwner bool `json:"sticky_thread_owner,omitempty"`
|
||||
}
|
||||
|
||||
@@ -465,7 +464,7 @@ func DefaultConfig() *Config {
|
||||
Execution: AgentExecutionConfig{
|
||||
RunStateTTLSeconds: 1800,
|
||||
RunStateMax: 500,
|
||||
ToolParallelSafeNames: []string{"read_file", "list_files", "find_files", "grep_files", "memory_search", "web_search", "repo_map", "system_info"},
|
||||
ToolParallelSafeNames: []string{"read_file", "list_files", "find_files", "grep_files", "memory_search", "web_search", "system_info"},
|
||||
ToolMaxParallelCalls: 2,
|
||||
},
|
||||
SummaryPolicy: SystemSummaryPolicyConfig{
|
||||
@@ -490,7 +489,6 @@ func DefaultConfig() *Config {
|
||||
AllowDirectAgentChat: false,
|
||||
MaxHops: 6,
|
||||
DefaultTimeoutSec: 600,
|
||||
DefaultWaitReply: true,
|
||||
StickyThreadOwner: true,
|
||||
},
|
||||
Communication: AgentCommunicationConfig{
|
||||
|
||||
@@ -46,7 +46,6 @@ type NormalizedRuntimeRouterConfig struct {
|
||||
AllowDirectAgentChat bool `json:"allow_direct_agent_chat,omitempty"`
|
||||
MaxHops int `json:"max_hops,omitempty"`
|
||||
DefaultTimeoutSec int `json:"default_timeout_sec,omitempty"`
|
||||
DefaultWaitReply bool `json:"default_wait_reply,omitempty"`
|
||||
StickyThreadOwner bool `json:"sticky_thread_owner,omitempty"`
|
||||
Rules []AgentRouteRule `json:"rules,omitempty"`
|
||||
}
|
||||
@@ -119,7 +118,6 @@ func (c *Config) NormalizedView() NormalizedConfig {
|
||||
AllowDirectAgentChat: c.Agents.Router.AllowDirectAgentChat,
|
||||
MaxHops: c.Agents.Router.MaxHops,
|
||||
DefaultTimeoutSec: c.Agents.Router.DefaultTimeoutSec,
|
||||
DefaultWaitReply: c.Agents.Router.DefaultWaitReply,
|
||||
StickyThreadOwner: c.Agents.Router.StickyThreadOwner,
|
||||
Rules: append([]AgentRouteRule(nil), c.Agents.Router.Rules...),
|
||||
},
|
||||
@@ -223,7 +221,6 @@ func (c *Config) ApplyNormalizedView(view NormalizedConfig) {
|
||||
if view.Runtime.Router.DefaultTimeoutSec > 0 {
|
||||
c.Agents.Router.DefaultTimeoutSec = view.Runtime.Router.DefaultTimeoutSec
|
||||
}
|
||||
c.Agents.Router.DefaultWaitReply = view.Runtime.Router.DefaultWaitReply
|
||||
c.Agents.Router.StickyThreadOwner = view.Runtime.Router.StickyThreadOwner
|
||||
c.Agents.Router.Rules = append([]AgentRouteRule(nil), view.Runtime.Router.Rules...)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -62,9 +63,10 @@ func TestValidateSubagentsRejectsAbsolutePromptFile(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cfg := DefaultConfig()
|
||||
absolutePrompt := filepath.Join(t.TempDir(), "AGENT.md")
|
||||
cfg.Agents.Subagents["coder"] = SubagentConfig{
|
||||
Enabled: true,
|
||||
SystemPromptFile: "/tmp/AGENT.md",
|
||||
SystemPromptFile: absolutePrompt,
|
||||
Runtime: SubagentRuntimeConfig{
|
||||
Provider: "openai",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user