Skip to content

Commit e7b6103

Browse files
committed
update opencode
1 parent b538e04 commit e7b6103

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

go/deployment-operator/pkg/agentrun-harness/tool/opencode/opencode_templates_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,21 @@ func TestConfigTemplate_Provider(t *testing.T) {
201201
})
202202
}
203203

204+
func TestConfigTemplate_SkillPermissions(t *testing.T) {
205+
t.Run("analysis and autonomous agents allow all skills", func(t *testing.T) {
206+
out := renderJSON(t, baseInput(console.AgentRunModeWrite))
207+
208+
agent := out["agent"].(map[string]any)
209+
for _, name := range []string{"analysis", "autonomous"} {
210+
permission := agent[name].(map[string]any)["permission"].(map[string]any)
211+
skill := permission["skill"].(map[string]any)
212+
if skill["*"] != "allow" {
213+
t.Fatalf("agent.%s permission.skill.* = %v, want allow", name, skill["*"])
214+
}
215+
}
216+
})
217+
}
218+
204219
func TestConfigTemplate_AgentTools(t *testing.T) {
205220
t.Run("analysis agent has plural* tool only", func(t *testing.T) {
206221
out := renderJSON(t, baseInput(console.AgentRunModeWrite))

go/deployment-operator/pkg/agentrun-harness/tool/opencode/templates/opencode.json.gotmpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
},
3131
{{- end }}
3232
"edit": "deny",
33-
"webfetch": "allow"
33+
"webfetch": "allow",
34+
"skill": {
35+
"*": "allow"
36+
}
3437
}
3538
},
3639
"autonomous": {
@@ -48,7 +51,10 @@
4851
"bash": "allow",
4952
"edit": "allow",
5053
"webfetch": "allow",
51-
"git": "deny"
54+
"git": "deny",
55+
"skill": {
56+
"*": "allow"
57+
}
5258
}
5359
}
5460
},

0 commit comments

Comments
 (0)