-
Notifications
You must be signed in to change notification settings - Fork 20
Disable mallory proactive message in client #26
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
Disable mallory proactive message in client #26
Conversation
Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>
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.
Additional Comments:
apps/client/hooks/useChatState.ts (lines 31-50):
Unused code remains after disabling the proactive message feature. The markUserOnboardingComplete function and hasTriggeredProactiveMessage ref are no longer called or used since their only references were in the now-disabled useEffect.
View Details
📝 Patch Details
diff --git a/apps/client/hooks/useChatState.ts b/apps/client/hooks/useChatState.ts
index a1d67ea..edde50a 100644
--- a/apps/client/hooks/useChatState.ts
+++ b/apps/client/hooks/useChatState.ts
@@ -24,32 +24,6 @@ type StreamState =
| { status: 'reasoning'; startTime: number }
| { status: 'responding'; startTime: number }
-/**
- * Mark user as having completed onboarding
- * This is a one-time flag to prevent infinite loops of intro messages
- */
-async function markUserOnboardingComplete(userId: string): Promise<boolean> {
- try {
- console.log('🎯 [Onboarding] Marking user onboarding as complete for userId:', userId);
-
- const { error } = await supabase
- .from('users')
- .update({ has_completed_onboarding: true })
- .eq('id', userId);
-
- if (error) {
- console.error('❌ [Onboarding] Failed to update has_completed_onboarding:', error);
- return false;
- }
-
- console.log('✅ [Onboarding] Successfully marked onboarding as complete');
- return true;
- } catch (err) {
- console.error('❌ [Onboarding] Exception updating onboarding flag:', err);
- return false;
- }
-}
-
export function useChatState({ currentConversationId, userId, walletBalance, userHasCompletedOnboarding }: UseChatStateProps) {
// Transaction guard for Grid session validation
const { ensureGridSession } = useTransactionGuard();
@@ -60,7 +34,6 @@ export function useChatState({ currentConversationId, userId, walletBalance, use
// Supporting state for UI
const [liveReasoningText, setLiveReasoningText] = useState('');
const [pendingMessage, setPendingMessage] = useState<string | null>(null); // Preserve message during OTP
- const hasTriggeredProactiveMessage = useRef(false);
// AI Chat using Vercel's useChat hook
const aiChatResult = useAIChat({
Analysis
Unused code remains after disabling proactive message feature in useChatState.ts
What fails: markUserOnboardingComplete function (lines 31-50) and hasTriggeredProactiveMessage ref (line 63) are declared but unused after the proactive message useEffect was disabled
How to reproduce:
- Search codebase for
markUserOnboardingComplete- only found in disabled useEffect block (line 252) - Search codebase for
hasTriggeredProactiveMessage- only found in disabled useEffect block (lines 218, 247) - Verify useEffect is commented out in block comment (lines 196-278)
Result: Dead code clutters codebase with unused function and ref declaration
Expected: Unused declarations should be removed when their only consumers are disabled to maintain clean codebase
* feat: Disable proactive message for onboarding Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com> * feat: Disable proactive message feature Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This pull request contains changes generated by a Cursor Cloud Agent