| 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 |