feat: default to no artist, require artist name in Slack prompt (REC-64)#437
feat: default to no artist, require artist name in Slack prompt (REC-64)#437recoup-coding-agent wants to merge 1 commit intotestfrom
Conversation
Remove hardcoded Gatsby Grace artist default from the content agent Slack bot. The bot now requires an artist name in the prompt (e.g. "generate a video for Mac Miller") and looks up the artist by name within the organization. - Add artistName field to contentPromptFlagsSchema for AI extraction - Add selectAccountByNameInOrg for case-insensitive artist name lookup - Update registerOnNewMention to resolve artist from prompt instead of hardcoding - If no artist specified, prompt user to include one - If artist not found, inform user with error message - 38 tests passing (20 registerOnNewMention, 13 parseContentPrompt, 5 selectAccountByNameInOrg) Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 41 minutes and 9 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (3)
✨ Finishing Touches🧪 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 3/5
- There is a concrete user-impacting risk in
lib/supabase/accounts/selectAccountByNameInOrg.ts: returning[]on query failure can mask real database errors as “artist not found.” - Because this issue is severity 6/10 with high confidence (9/10), the change carries some merge risk until error handling distinguishes lookup misses from backend failures.
- Pay close attention to
lib/supabase/accounts/selectAccountByNameInOrg.ts- ensure query errors are propagated or surfaced explicitly instead of being converted into empty results.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/supabase/accounts/selectAccountByNameInOrg.ts">
<violation number="1" location="lib/supabase/accounts/selectAccountByNameInOrg.ts:25">
P2: Do not return an empty array on query errors; this misreports database failures as “artist not found.”</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as Slack User
participant Bot as Content Agent Bot
participant AI as AI Parser (LLM)
participant DB as Supabase DB
Note over User, DB: Content Generation Flow (REC-64)
User->>Bot: @Bot "generate a video for Mac Miller"
Bot->>AI: NEW: parseContentPrompt(message)
AI-->>Bot: return { ..., artistName: "Mac Miller" }
alt NEW: artistName is missing
Bot-->>User: post("Please specify an artist name...")
else artistName is present
Bot->>DB: NEW: selectAccountByNameInOrg(orgId, "Mac Miller")
DB-->>Bot: return matchedAccounts[]
alt No accounts found
Bot-->>User: post("No artist found matching...")
else Account found
Bot->>Bot: CHANGED: Use matched artist ID
Bot->>Bot: resolveArtistSlug(artistId)
Bot->>Bot: triggerCreateContent(...)
Bot-->>User: post(Task Card)
end
end
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| .eq("organization_id", organizationId) | ||
| .ilike("account.name", `%${name}%`); | ||
|
|
||
| if (error || !data) { |
There was a problem hiding this comment.
P2: Do not return an empty array on query errors; this misreports database failures as “artist not found.”
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/supabase/accounts/selectAccountByNameInOrg.ts, line 25:
<comment>Do not return an empty array on query errors; this misreports database failures as “artist not found.”</comment>
<file context>
@@ -0,0 +1,31 @@
+ .eq("organization_id", organizationId)
+ .ilike("account.name", `%${name}%`);
+
+ if (error || !data) {
+ return [];
+ }
</file context>
Summary
selectAccountByNameInOrgfunction looks up artist by name (case-insensitive partial match) within the organizationartistNameadded to content prompt AI schema for extraction from natural languageTest plan
🤖 Generated with Claude Code
Summary by cubic
Removes the default artist from the content agent and requires an artist name in Slack prompts, resolving the artist by name within the org. Implements REC-64 to prevent accidental content routing to the wrong artist.
New Features
Migration
Written for commit 69b3e3b. Summary will update on new commits.