fix: enforce subagent prompt files and refine webui

This commit is contained in:
lpf
2026-03-09 11:24:31 +08:00
parent ba3be33c91
commit acf8a22c0a
25 changed files with 257 additions and 211 deletions

View File

@@ -77,7 +77,6 @@ type SubagentConfig struct {
DisplayName string `json:"display_name,omitempty"`
Role string `json:"role,omitempty"`
Description string `json:"description,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
SystemPromptFile string `json:"system_prompt_file,omitempty"`
MemoryNamespace string `json:"memory_namespace,omitempty"`
AcceptFrom []string `json:"accept_from,omitempty"`
@@ -88,6 +87,19 @@ type SubagentConfig struct {
Runtime SubagentRuntimeConfig `json:"runtime,omitempty"`
}
func (s *SubagentConfig) UnmarshalJSON(data []byte) error {
type alias SubagentConfig
var raw struct {
alias
LegacySystemPrompt string `json:"system_prompt"`
}
if err := json.Unmarshal(data, &raw); err != nil {
return err
}
*s = SubagentConfig(raw.alias)
return nil
}
type SubagentToolsConfig struct {
Allowlist []string `json:"allowlist,omitempty"`
Denylist []string `json:"denylist,omitempty"`