File tree Expand file tree Collapse file tree 5 files changed +16
-4
lines changed
Expand file tree Collapse file tree 5 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ func (t *Toolset) validate() error {
6666
6767 switch t .Type {
6868 case "memory" :
69- // path is optional; defaults to ~/.cagent/memory/<agent-name>/memory.db
69+ if t .Path == "" {
70+ return errors .New ("memory toolset requires a path to be set" )
71+ }
7072 case "mcp" :
7173 count := 0
7274 if t .Command != "" {
Original file line number Diff line number Diff line change @@ -87,7 +87,9 @@ func (t *Toolset) validate() error {
8787 return errors .New ("sandbox requires at least one path to be set" )
8888 }
8989 case "memory" :
90- // path is optional; defaults to ~/.cagent/memory/<agent-name>/memory.db
90+ if t .Path == "" {
91+ return errors .New ("memory toolset requires a path to be set" )
92+ }
9193 case "mcp" :
9294 count := 0
9395 if t .Command != "" {
Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ func (t *Toolset) validate() error {
110110 return errors .New ("sandbox requires at least one path to be set" )
111111 }
112112 case "memory" :
113- // path is optional; defaults to ~/.cagent/memory/<agent-name>/memory.db
113+ if t .Path == "" {
114+ return errors .New ("memory toolset requires a path to be set" )
115+ }
114116 case "mcp" :
115117 count := 0
116118 if t .Command != "" {
Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ func (t *Toolset) validate() error {
113113 return errors .New ("sandbox requires at least one path to be set" )
114114 }
115115 case "memory" :
116- // path is optional; defaults to ~/.cagent/memory/<agent-name>/memory.db
116+ if t .Path == "" {
117+ return errors .New ("memory toolset requires a path to be set" )
118+ }
117119 case "tasks" :
118120 // path defaults to ./tasks.json if not set
119121 case "mcp" :
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ func TestValidationErrors(t *testing.T) {
3636 name string
3737 path string
3838 }{
39+ {
40+ name : "memory toolset missing path" ,
41+ path : "missing_memory_path_v2.yaml" ,
42+ },
3943 {
4044 name : "path in non memory toolset" ,
4145 path : "invalid_path_v2.yaml" ,
You can’t perform that action at this time.
0 commit comments