Skip to content

feat(notifications): add Grok Code Fast 1 Optimized discontinued notification#3496

Merged
chrarnoldus merged 2 commits into
mainfrom
notifications/grok-code-fast-1-optimized-discontinued
May 26, 2026
Merged

feat(notifications): add Grok Code Fast 1 Optimized discontinued notification#3496
chrarnoldus merged 2 commits into
mainfrom
notifications/grok-code-fast-1-optimized-discontinued

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented May 26, 2026

Summary

  • Adds a new conditional notification that informs former Grok Code Fast 1 Optimized users that the model has been discontinued, suggesting Auto Free as the replacement.
  • Audience is sourced from the PostHog view 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.ts to confirm the new generator is wired into conditionalNotifications and follows the established PostHog-cached lookup pattern. Full pnpm typecheck was 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_15 must exist and expose a kilo_user_id column for this to surface notifications in production. The notification has no expiresAt; remove the generator (mirroring PR #2902) when the audience has been informed.

Comment thread apps/web/src/lib/notifications.ts Outdated
_ctx: NotificationContext
): Promise<KiloNotification[]> {
try {
const users = await cachedPosthogQuery(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
  );
  // ...
}

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented May 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The previous WARNING is resolved: cachedPosthogQuery is now correctly hoisted to module scope (getGrokCodeFast1OptimizedDiscontinuedUsers), ensuring the in-memory L1 cache works as intended. The notification message and suggestModelId update are straightforward.

Files Reviewed (1 file)
  • apps/web/src/lib/notifications.ts — 0 issues (previous WARNING fixed)

Reviewed by claude-4.6-sonnet-20260217 · 133,123 tokens

Review guidance: REVIEW.md from base branch main

@chrarnoldus chrarnoldus merged commit e4ea364 into main May 26, 2026
13 checks passed
@chrarnoldus chrarnoldus deleted the notifications/grok-code-fast-1-optimized-discontinued branch May 26, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants