Skip to content

Commit ddcf766

Browse files
authored
hotfix (#1128)
# READ CAREFULLY THEN REMOVE Remove bullet points that are not relevant. PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI. - Pull requests that do not follow these guidelines will be closed without review or comment. - If you use AI to write your PR description your pr will be close without review or comment. - If you are unsure about anything, feel free to ask for clarification. ## Description Please provide a clear description of your changes. --- ## Type of Change Please delete options that are not relevant. - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature with breaking changes) - [ ] 📝 Documentation update - [ ] 🎨 UI/UX improvement - [ ] 🔒 Security enhancement - [ ] ⚡ Performance improvement ## Areas Affected Please check all that apply: - [ ] Email Integration (Gmail, IMAP, etc.) - [ ] User Interface/Experience - [ ] Authentication/Authorization - [ ] Data Storage/Management - [ ] API Endpoints - [ ] Documentation - [ ] Testing Infrastructure - [ ] Development Workflow - [ ] Deployment/Infrastructure ## Testing Done Describe the tests you've done: - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] Cross-browser testing (if UI changes) - [ ] Mobile responsiveness verified (if UI changes) ## Security Considerations For changes involving data or authentication: - [ ] No sensitive data is exposed - [ ] Authentication checks are in place - [ ] Input validation is implemented - [ ] Rate limiting is considered (if applicable) ## Checklist - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in complex areas - [ ] I have updated the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix/feature works - [ ] All tests pass locally - [ ] Any dependent changes are merged and published ## Additional Notes Add any other context about the pull request here. ## Screenshots/Recordings Add screenshots or recordings here if applicable. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
1 parent d756bc0 commit ddcf766

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

apps/mail/components/ui/ai-sidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ import { PromptsDialog } from './prompts-dialog';
1212
import { Button } from '@/components/ui/button';
1313
import { useHotkeys } from 'react-hotkeys-hook';
1414
import { useLabels } from '@/hooks/use-labels';
15+
import { useSession } from '@/lib/auth-client';
1516
import { useAgentChat } from 'agents/ai-react';
1617
import { X, Expand, Plus } from 'lucide-react';
1718
import { Gauge } from '@/components/ui/gauge';
1819
import { useParams } from 'react-router';
20+
import { useChat } from '@ai-sdk/react';
1921
import { useAgent } from 'agents/react';
2022
import { useQueryState } from 'nuqs';
2123
import { cn } from '@/lib/utils';
@@ -373,9 +375,11 @@ function AISidebar({ className }: AISidebarProps) {
373375
const { folder } = useParams<{ folder: string }>();
374376
const { refetch: refetchLabels } = useLabels();
375377
const [searchValue] = useSearchValue();
378+
const { data: session } = useSession();
376379

377380
const agent = useAgent({
378381
agent: 'ZeroAgent',
382+
name: session?.user.email ?? 'general',
379383
host: `${import.meta.env.VITE_PUBLIC_BACKEND_URL}`,
380384
});
381385

apps/server/src/routes/chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class ZeroAgent extends AIChatAgent<typeof env> {
9393
if (_connection) {
9494
await this.ctx.storage.put('connectionId', _connection.id);
9595
this.driver = connectionToDriver(_connection);
96+
this.setName(session.user.email);
9697
}
9798
console.log('session exists', session.user.email);
9899
} else {

0 commit comments

Comments
 (0)