Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions apps/web/src/lib/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export async function generateUserNotifications(user: User): Promise<KiloNotific
generateAutoTopUpNotification,
generateAutoTopUpOrgsNotification,
generateByokProvidersNotification,
generateGrokCodeFast1OptimizedDiscontinuedNotification,
generateKiloPassNotification,
];

Expand Down Expand Up @@ -293,6 +294,46 @@ async function generateByokProvidersNotification(
}
}

const getGrokCodeFast1OptimizedDiscontinuedUsers = cachedPosthogQuery(
z.array(z.tuple([z.string()]).transform(([userId]) => userId))
);

async function generateGrokCodeFast1OptimizedDiscontinuedNotification(
user: User,
_ctx: NotificationContext
): Promise<KiloNotification[]> {
try {
const users = await getGrokCodeFast1OptimizedDiscontinuedUsers(
'grok-code-fast-1-optimized-discontinued-users',
'select kilo_user_id from notification_grok_code_may_15 limit 5e5'
);

if (!users.includes(user.id)) {
console.debug(
'[generateGrokCodeFast1OptimizedDiscontinuedNotification] not showing notification for user'
);
return [];
}

console.debug(
'[generateGrokCodeFast1OptimizedDiscontinuedNotification] showing notification for user'
);
return [
{
id: 'grok-code-fast-1-optimized-discontinued-may-15',
title: 'Grok Code Fast 1 Optimized is discontinued',
message:
'Grok Code Fast 1 Optimized has been discontinued. Give Grok Build 0.1 a try as a replacement.',
suggestModelId: 'x-ai/grok-build-0.1',
showIn: ['cli', 'extension'],
},
];
} catch (e) {
console.error('[generateGrokCodeFast1OptimizedDiscontinuedNotification]', e);
return [];
}
}

async function generateKiloPassNotification(
user: User,
ctx: NotificationContext
Expand Down