Skip to content

Commit a531f3f

Browse files
committed
core: run command build agent now auto-accepts file edits to reduce workflow interruptions while still requiring confirmation for bash commands
1 parent bb33823 commit a531f3f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/opencode/src/cli/cmd/run.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ export const RunCommand = cmd({
350350
action: "deny",
351351
pattern: "*",
352352
},
353+
{
354+
permission: "edit",
355+
action: "allow",
356+
pattern: "*",
357+
},
353358
]
354359

355360
function title() {

packages/opencode/test/agent/agent.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test("build agent has correct default properties", async () => {
3838
expect(build).toBeDefined()
3939
expect(build?.mode).toBe("primary")
4040
expect(build?.native).toBe(true)
41-
expect(evalPerm(build, "edit")).toBe("allow")
41+
expect(evalPerm(build, "edit")).toBe("ask")
4242
expect(evalPerm(build, "bash")).toBe("allow")
4343
},
4444
})
@@ -203,8 +203,8 @@ test("agent permission config merges with defaults", async () => {
203203
expect(build).toBeDefined()
204204
// Specific pattern is denied
205205
expect(PermissionNext.evaluate("bash", "rm -rf *", build!.permission).action).toBe("deny")
206-
// Edit still allowed
207-
expect(evalPerm(build, "edit")).toBe("allow")
206+
// Edit still asks (default behavior)
207+
expect(evalPerm(build, "edit")).toBe("ask")
208208
},
209209
})
210210
})

0 commit comments

Comments
 (0)