mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-07 08:37:28 +08:00
fix: enforce subagent prompt files and refine webui
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user