( error: unknown, context: Pick<ToolUseContext, 'addNotification'>, )
| 1106 | } |
| 1107 | |
| 1108 | function addErrorNotificationIfNeeded( |
| 1109 | error: unknown, |
| 1110 | context: Pick<ToolUseContext, 'addNotification'>, |
| 1111 | ) { |
| 1112 | if ( |
| 1113 | !hasExactErrorMessage(error, ERROR_MESSAGE_USER_ABORT) && |
| 1114 | !hasExactErrorMessage(error, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES) |
| 1115 | ) { |
| 1116 | context.addNotification?.({ |
| 1117 | key: 'error-compacting-conversation', |
| 1118 | text: 'Error compacting conversation', |
| 1119 | priority: 'immediate', |
| 1120 | color: 'error', |
| 1121 | }) |
| 1122 | } |
| 1123 | } |
| 1124 | |
| 1125 | export function createCompactCanUseTool(): CanUseToolFn { |
| 1126 | return async () => ({ |
no test coverage detected