Skip to content

fix: remove dead ArtistAgent code and GET /api/agents endpoint#1737

Merged
sweetmantech merged 2 commits into
testfrom
fix/remove-dead-artist-agents-code
May 8, 2026
Merged

fix: remove dead ArtistAgent code and GET /api/agents endpoint#1737
sweetmantech merged 2 commits into
testfrom
fix/remove-dead-artist-agents-code

Conversation

@ahmednahima0-beep
Copy link
Copy Markdown
Collaborator

@ahmednahima0-beep ahmednahima0-beep commented May 8, 2026


Summary by cubic

Removed the dead ArtistAgent code and the GET /api/agents endpoint. All chat UI, hooks, and helpers now use Conversation only; agentId paths are removed.

  • Refactors
    • Removed GET /api/agents, lib/supabase/getArtistAgents, and hooks/useArtistAgents.
    • Updated Sidebar modals, Recent Chats (ChatItem, RecentChatList), useRecentChats, useCreateChat, and useRenameModal to accept Conversation only.
    • Dropped agentId handling; active chat derives from roomId only.
    • Simplified helpers: getChatDisplayInfo returns a display name from Conversation (fallback "Chat Analysis"); getChatRoomId returns id.
    • Conversations now come solely from fetchedConversations (no agent merge).

Written for commit 6b72609. Summary will update on new commits.

Summary by CodeRabbit

  • Removed Features

    • Artist agent support has been removed from the app; chat management now focuses exclusively on conversations.
  • Updates

    • Sidebar, recent chats, rename and delete modals simplified to operate only on conversations.
    • Conversation list and chat-creation flows streamlined; agent-based fetching and related UI are no longer present.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview May 8, 2026 8:39pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4e9a2018-7caf-4b75-bdc6-d7194912bb3c

📥 Commits

Reviewing files that changed from the base of the PR and between 741037d and 6b72609.

📒 Files selected for processing (1)
  • components/Sidebar/Modals/DeleteConfirmationModal.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/Sidebar/Modals/DeleteConfirmationModal.tsx

📝 Walkthrough

Walkthrough

This 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.

Changes

Removal of ArtistAgent Support and Type Consolidation

Layer / File(s) Summary
API Endpoint & Data Functions
app/api/agents/route.ts, lib/supabase/getArtistAgents.ts
API route for fetching agents and Supabase query function are deleted entirely, including imports and route-level Next.js exports.
Type Contracts & Helper Simplification
lib/chat/getChatDisplayInfo.ts, lib/chat/getChatRoomId.ts
Utility functions simplified to accept Conversation only; getChatDisplayInfo returns displayName from topic, and getChatRoomId returns id directly without branching.
Data Source Integration
hooks/useArtistAgents.ts, hooks/useConversations.tsx
useArtistAgents hook is removed; useConversations derives data exclusively from fetched conversations, filtering by selectedArtist or org artist IDs without merging agent entries.
Hook Type Narrowing
components/Sidebar/RecentChats/useRecentChats.ts, hooks/useCreateChat.tsx, hooks/useRenameModal.ts
Hooks updated to accept Conversation only—useRecentChats removes agentId fallback; useCreateChat and useRenameModal eliminate type casts and use id/topic directly.
UI Component Updates
components/Sidebar/RecentChats/RecentChatList.tsx, components/Sidebar/RecentChats/ChatItem.tsx, components/Sidebar/Modals/RenameModal.tsx, components/Sidebar/Modals/DeleteConfirmationModal.tsx
Component props narrowed to Conversation type; modal and list logic use direct id and topic access and simplified optimistic-message detection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cubic-dev-ai
  • sweetmantech

Poem

✂️ ArtistAgent trimmed from the tree,
Conversations hum in clarity.
No unions, no casts, clean and bright,
Hooks and helpers now just right.
🌿 One-type path, tidy and light.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Solid & Clean Code ✅ Passed Removes dead ArtistAgent code while maintaining SOLID principles. Helper functions simplified. No lingering references, improved type safety.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-dead-artist-agents-code

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
components/Sidebar/RecentChats/useRecentChats.ts (1)

27-41: 💤 Low value

conversations is an unused dependency in this useEffect.

The effect body only reads params?.roomId and window.location.pathnameconversations is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 13ab4c4 and 741037d.

📒 Files selected for processing (13)
  • app/api/agents/route.ts
  • components/Sidebar/Modals/DeleteConfirmationModal.tsx
  • components/Sidebar/Modals/RenameModal.tsx
  • components/Sidebar/RecentChats/ChatItem.tsx
  • components/Sidebar/RecentChats/RecentChatList.tsx
  • components/Sidebar/RecentChats/useRecentChats.ts
  • hooks/useArtistAgents.ts
  • hooks/useConversations.tsx
  • hooks/useCreateChat.tsx
  • hooks/useRenameModal.ts
  • lib/chat/getChatDisplayInfo.ts
  • lib/chat/getChatRoomId.ts
  • lib/supabase/getArtistAgents.ts
💤 Files with no reviewable changes (3)
  • hooks/useArtistAgents.ts
  • lib/supabase/getArtistAgents.ts
  • app/api/agents/route.ts

Comment thread components/Sidebar/Modals/DeleteConfirmationModal.tsx Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Auto-approved: PR removes dead ArtistAgent code and associated API endpoint. All references updated; blast radius is low and no core logic broken.

@sweetmantech sweetmantech merged commit a77ca7f into test May 8, 2026
4 checks passed
@sweetmantech sweetmantech deleted the fix/remove-dead-artist-agents-code branch May 8, 2026 21:36
@sweetmantech sweetmantech mentioned this pull request May 8, 2026
1 task
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