返回 DeepSeek-Reasonix
tool_hooks_mutation.go
根目录 / internal / agent / tool_hooks_mutation.go
1 package agent
2
3 type toolMutationHookReporter interface {
4 ToolMutationHooksEnabled() bool
5 }
6
7 func toolHooksMayMutateWorkspace(hooks ToolHooks) bool {
8 if hooks == nil {
9 return false
10 }
11 if reporter, ok := hooks.(toolMutationHookReporter); ok {
12 return reporter.ToolMutationHooksEnabled()
13 }
14 // Custom ToolHooks implementations predate the capability report. Preserve
15 // conservative coverage because their callbacks may write files.
16 return true
17 }
18
18 lines GO