Skip to content

Commit 213280d

Browse files
nunocoracaoclaude
andcommitted
Revert v2-v5 validation changes - frozen packages should not be modified
Only pkg/config/latest/validate.go retains the optional path change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b7719a6 commit 213280d

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

pkg/config/v2/validate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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 != "" {

pkg/config/v3/validate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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 != "" {

pkg/config/v4/validate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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 != "" {

pkg/config/v5/validate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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":

pkg/config/validation_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)