MCPcopy Create free account
hub / github.com/Noumena-Network/code / addErrorNotificationIfNeeded

Function addErrorNotificationIfNeeded

src/services/compact/compact.ts:1120–1135  ·  view source on GitHub ↗
(
  error: unknown,
  context: Pick<ToolUseContext, 'addNotification'>,
)

Source from the content-addressed store, hash-verified

1118}
1119
1120function 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
1137export function createCompactCanUseTool(): CanUseToolFn {
1138 return async () => ({

Callers 2

compactConversationFunction · 0.85

Calls 1

hasExactErrorMessageFunction · 0.85

Tested by

no test coverage detected