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

@@ -42,3 +42,20 @@ func TestValidateSubagentsRejectsUnknownPeer(t *testing.T) {
t.Fatalf("expected validation errors")
}
}
func TestValidateSubagentsRejectsAbsolutePromptFile(t *testing.T) {
t.Parallel()
cfg := DefaultConfig()
cfg.Agents.Subagents["coder"] = SubagentConfig{
Enabled: true,
SystemPromptFile: "/tmp/AGENT.md",
Runtime: SubagentRuntimeConfig{
Proxy: "proxy",
},
}
if errs := Validate(cfg); len(errs) == 0 {
t.Fatalf("expected validation errors")
}
}