fix: remove dead ArtistAgent code and GET /api/agents endpoint#1737
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR removes artist-agent support by deleting the /api/agents endpoint, the getArtistAgents function, and the useArtistAgents hook. It narrows hooks, utilities, and component props to accept Conversation exclusively and simplifies helper logic accordingly. ChangesRemoval of ArtistAgent Support and Type Consolidation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
No issues found across 13 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Removal of dead ArtistAgent code and associated endpoint: all references removed consistently, no new logic introduced, low risk of breakage as feature is unused.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/Sidebar/RecentChats/useRecentChats.ts (1)
27-41: 💤 Low value
conversationsis an unused dependency in thisuseEffect.The effect body only reads
params?.roomIdandwindow.location.pathname—conversationsis never referenced inside it. Its presence causes the effect to re-run on every conversations update, which is misleading and wasteful even if React's state bail-out prevents a cascading re-render.🛠️ Proposed fix
- }, [params, conversations]); + }, [params]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/Sidebar/RecentChats/useRecentChats.ts` around lines 27 - 41, The useEffect in useRecentChats.ts re-runs because `conversations` is listed in the dependency array but never used; remove `conversations` from the dependency array so the effect only depends on `params` (e.g., change the dependency array on the effect that defines `updateActiveChatId` to [params] or [params?.roomId] ), leaving the logic in `updateActiveChatId` and `setActiveChatId` unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/Sidebar/Modals/DeleteConfirmationModal.tsx`:
- Line 38: The confirmation dialog builds chatName using chatsToDelete[0].topic
which can be an empty string; update the logic in DeleteConfirmationModal (the
chatName definition) to defensively fallback when Conversation.topic is
falsy/empty (same pattern as getChatDisplayInfo) — e.g., use
chatsToDelete[0].topic || "Chat Analysis" (or another project-default label) for
isSingleDelete, and ensure any error messages that reference chatName also use
this fallback so the dialog and logs never show an empty title.
---
Nitpick comments:
In `@components/Sidebar/RecentChats/useRecentChats.ts`:
- Around line 27-41: The useEffect in useRecentChats.ts re-runs because
`conversations` is listed in the dependency array but never used; remove
`conversations` from the dependency array so the effect only depends on `params`
(e.g., change the dependency array on the effect that defines
`updateActiveChatId` to [params] or [params?.roomId] ), leaving the logic in
`updateActiveChatId` and `setActiveChatId` unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 46fca635-9f3b-4ce4-aa62-47afc148b2be
📒 Files selected for processing (13)
app/api/agents/route.tscomponents/Sidebar/Modals/DeleteConfirmationModal.tsxcomponents/Sidebar/Modals/RenameModal.tsxcomponents/Sidebar/RecentChats/ChatItem.tsxcomponents/Sidebar/RecentChats/RecentChatList.tsxcomponents/Sidebar/RecentChats/useRecentChats.tshooks/useArtistAgents.tshooks/useConversations.tsxhooks/useCreateChat.tsxhooks/useRenameModal.tslib/chat/getChatDisplayInfo.tslib/chat/getChatRoomId.tslib/supabase/getArtistAgents.ts
💤 Files with no reviewable changes (3)
- hooks/useArtistAgents.ts
- lib/supabase/getArtistAgents.ts
- app/api/agents/route.ts
Summary by cubic
Removed the dead ArtistAgent code and the GET
/api/agentsendpoint. All chat UI, hooks, and helpers now useConversationonly;agentIdpaths are removed.GET /api/agents,lib/supabase/getArtistAgents, andhooks/useArtistAgents.ChatItem,RecentChatList),useRecentChats,useCreateChat, anduseRenameModalto acceptConversationonly.agentIdhandling; active chat derives fromroomIdonly.getChatDisplayInforeturns a display name fromConversation(fallback "Chat Analysis");getChatRoomIdreturnsid.fetchedConversations(no agent merge).Written for commit 6b72609. Summary will update on new commits.
Summary by CodeRabbit
Removed Features
Updates