(state *security.PermissionState)
| 1519 | if state.PermissionState != nil && state.PermissionState.IsToolConfirmed(tc.Name) { |
| 1520 | return false |
| 1521 | } |
| 1522 | if tool.ConfirmsFilePaths() && state.PermissionState != nil { |
| 1523 | if fp := stringFromAny(tc.Input["file_path"]); fp != "" && state.PermissionState.IsPathConfirmed(fp) { |
| 1524 | return false |
| 1525 | } |
| 1526 | } |
| 1527 | return tool.NeedsPermission(validated) |
| 1528 | } |
| 1529 | |
| 1530 | func (e *CoreExecutionEngine) rememberAPIError(state *AgentState, msg string) { |
| 1531 | state.RecentApiErrors = append(state.RecentApiErrors, msg) |
| 1532 | if len(state.RecentApiErrors) > 5 { |
| 1533 | state.RecentApiErrors = state.RecentApiErrors[len(state.RecentApiErrors)-5:] |
| 1534 | } |
| 1535 | } |
| 1536 | |
| 1537 | func (e *CoreExecutionEngine) apiErrorEvent(msg string, metadata map[string]any) StreamEvent { |
no test coverage detected