Skip to content

Commit 0340733

Browse files
committed
refactor(tools): combine duplicate file_write/file_edit extractPattern cases
1 parent fbd68c4 commit 0340733

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

agent/tools/approval_rules.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,7 @@ func extractPattern(toolName string, input json.RawMessage) string {
131131
return firstToken(s)
132132
}
133133
}
134-
case "file_write":
135-
if p, ok := m["path"]; ok {
136-
var s string
137-
if json.Unmarshal(p, &s) == nil {
138-
return s
139-
}
140-
}
141-
case "file_edit":
134+
case "file_write", "file_edit":
142135
if p, ok := m["path"]; ok {
143136
var s string
144137
if json.Unmarshal(p, &s) == nil {

0 commit comments

Comments
 (0)