feat(notifications): add Grok Code Fast 1 Optimized discontinued notification#3496
Conversation
| _ctx: NotificationContext | ||
| ): Promise<KiloNotification[]> { | ||
| try { | ||
| const users = await cachedPosthogQuery( |
There was a problem hiding this comment.
WARNING: In-memory cache is bypassed — new Map created on every call
Calling cachedPosthogQuery(schema) inline inside the function body creates a new memoryCache = new Map() closure on every invocation. This means the 1-hour in-memory L1 cache layer is never populated or reused; every request falls through to Redis (or PostHog if Redis is cold).
The existing pattern in generateByokProvidersNotification (line 239) correctly stores the curried function at module scope so the in-memory cache persists across calls:
// Module scope — correct pattern (mirrors generateByokProvidersNotification)
const getGrokCodeFast1OptimizedDiscontinuedUsers = cachedPosthogQuery(
z.array(z.tuple([z.string()]).transform(([userId]) => userId))
);
async function generateGrokCodeFast1OptimizedDiscontinuedNotification(...) {
const users = await getGrokCodeFast1OptimizedDiscontinuedUsers(
'grok-code-fast-1-optimized-discontinued-users',
'select kilo_user_id from notification_grok_code_may_15 limit 5e5'
);
// ...
}
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe previous WARNING is resolved: Files Reviewed (1 file)
Reviewed by claude-4.6-sonnet-20260217 · 133,123 tokens Review guidance: REVIEW.md from base branch |
Summary
notification_grok_code_may_15, following the same pattern previously used for the MiMo and Trinity Large Thinking discontinuation notifications.Verification
Read
apps/web/src/lib/notifications.tsto confirm the new generator is wired intoconditionalNotificationsand follows the established PostHog-cached lookup pattern. Fullpnpm typecheckwas skipped per repo guidance to avoid long-running checks during agent execution.Visual Changes
N/A — backend notification only; renders through existing notification UI.
Reviewer Notes
The PostHog view
notification_grok_code_may_15must exist and expose akilo_user_idcolumn for this to surface notifications in production. The notification has noexpiresAt; remove the generator (mirroring PR #2902) when the audience has been informed.