( error: unknown, context: Pick<ToolUseContext, 'addNotification'>, )
| 1118 | } |
| 1119 | |
| 1120 | function addErrorNotificationIfNeeded( |
| 1121 | error: unknown, |
| 1122 | context: Pick<ToolUseContext, 'addNotification'>, |
| 1123 | ) { |
| 1124 | if ( |
| 1125 | !hasExactErrorMessage(error, ERROR_MESSAGE_USER_ABORT) && |
| 1126 | !hasExactErrorMessage(error, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES) |
| 1127 | ) { |
| 1128 | context.addNotification?.({ |
| 1129 | key: 'error-compacting-conversation', |
| 1130 | text: 'Error compacting conversation', |
| 1131 | priority: 'immediate', |
| 1132 | color: 'error', |
| 1133 | }) |
| 1134 | } |
| 1135 | } |
| 1136 | |
| 1137 | export function createCompactCanUseTool(): CanUseToolFn { |
| 1138 | return async () => ({ |
no test coverage detected