Refine agent config schema and prompt file loading

This commit is contained in:
lpf
2026-03-06 13:56:38 +08:00
parent 1fec90643b
commit 2bc71870db
16 changed files with 483 additions and 250 deletions

View File

@@ -23,15 +23,16 @@ func DraftConfigSubagent(description, agentIDHint string) map[string]interface{}
keywords := inferDraftKeywords(role, lower)
systemPrompt := inferDraftSystemPrompt(role, desc)
return map[string]interface{}{
"agent_id": agentID,
"role": role,
"display_name": displayName,
"description": desc,
"system_prompt": systemPrompt,
"memory_namespace": agentID,
"tool_allowlist": toolAllowlist,
"routing_keywords": keywords,
"type": "worker",
"agent_id": agentID,
"role": role,
"display_name": displayName,
"description": desc,
"system_prompt": systemPrompt,
"system_prompt_file": "agents/" + agentID + "/AGENT.md",
"memory_namespace": agentID,
"tool_allowlist": toolAllowlist,
"routing_keywords": keywords,
"type": "worker",
}
}
@@ -69,6 +70,9 @@ func UpsertConfigSubagent(configPath string, args map[string]interface{}) (map[s
if v := stringArgFromMap(args, "system_prompt"); v != "" {
subcfg.SystemPrompt = v
}
if v := stringArgFromMap(args, "system_prompt_file"); v != "" {
subcfg.SystemPromptFile = v
}
if v := stringArgFromMap(args, "memory_namespace"); v != "" {
subcfg.MemoryNamespace = v
}