-
Notifications
You must be signed in to change notification settings - Fork 51
Daily branch 2025 12 06 #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe PR updates AI model provider mappings to use Grok models, adds subscription-based guards to prevent free-tier analytics tracing, unconditionally initializes PostHogClient, and extends the system prompt to include mode reminders for paid subscribers. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
lib/api/chat-handler.ts (1)
161-163: Unconditional PostHog initialization is OK; consider also gating manual capture for free tierCalling
PostHogClient()unconditionally here is fine;createTrackedProvidernow cleanly falls back tomyProviderwhenphClientis null orsubscription === "free", so provider-level tracing is disabled for free users while keeping the call site simple.However,
onChunkstill does:if (posthog) { posthog.capture({ distinctId: userId, ... }); }so free-tier ASK sessions will still emit tool-call events to PostHog when the client is configured. If the goal is to avoid all analytics for free users (not just model tracing), you may want to add a
subscription !== "free"check around that block as well.lib/system-prompt.ts (1)
165-180: ASK-mode prompt changes look good; minor type reuse nitThe new
modeReminderfor non-free subscriptions correctly explains ASK MODE’s limited tools and when to switch to AGENT MODE, while omitting that block for free users so you don’t advertise a mode they can’t access. The updated call site passingsubscriptionintogetAskModeSectionis consistent.Optionally, you could reuse a shared
SubscriptionTiertype here instead of repeating the union literal to avoid drift if tiers change.Also applies to: 299-300
lib/ai/providers.ts (1)
17-18: Provider and tracing updates make sense; double-check summarization cutoffPointing both
"title-generator-model"and"summarization-model"atxai("grok-4-1-fast-non-reasoning")is consistent, and the new guard:if (!phClient || subscription === "free") { return myProvider; }nicely ensures PostHog tracing is only enabled when a client exists and the user is non-free, falling back cleanly otherwise.
Given both models now share the same underlying provider, consider whether
"summarization-model"’smodelCutoffDatesentry should also be bumped to match"title-generator-model"for consistency, unless there’s a deliberate reason to keep it at "November 2024".Also applies to: 48-50
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
lib/ai/providers.ts(2 hunks)lib/api/chat-handler.ts(1 hunks)lib/system-prompt.ts(2 hunks)scripts/attach-failing-card.ts(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
lib/system-prompt.ts (1)
lib/ai/providers.ts (2)
ModelName(21-21)getModelCutoffDate(34-36)
lib/api/chat-handler.ts (1)
app/posthog.js (1)
PostHogClient(3-17)
🔇 Additional comments (1)
scripts/attach-failing-card.ts (1)
75-79: Console log reformatting is fineThese are pure formatting changes to long
console.logcalls; no behavior change and the wrapped style is clear and consistent.Also applies to: 82-84, 104-106, 118-120
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.