Skip to content

feat: default to no artist, require artist name in Slack prompt (REC-64)#437

Open
recoup-coding-agent wants to merge 1 commit intotestfrom
feat/rec-64-default-no-artist
Open

feat: default to no artist, require artist name in Slack prompt (REC-64)#437
recoup-coding-agent wants to merge 1 commit intotestfrom
feat/rec-64-default-no-artist

Conversation

@recoup-coding-agent
Copy link
Copy Markdown
Collaborator

@recoup-coding-agent recoup-coding-agent commented Apr 14, 2026

Summary

  • Remove hardcoded Gatsby Grace artist default from the content agent Slack bot
  • Bot now requires an artist name in the prompt (e.g. "generate a video for Mac Miller")
  • New selectAccountByNameInOrg function looks up artist by name (case-insensitive partial match) within the organization
  • artistName added to content prompt AI schema for extraction from natural language
  • If no artist specified, prompts user; if not found, shows error

Test plan

  • 20 registerOnNewMention tests pass (17 existing updated + 3 new)
  • 13 parseContentPrompt tests pass (11 existing + 2 new for artistName)
  • 5 selectAccountByNameInOrg tests pass (all new)
  • Verify in Slack: mentioning bot without artist name shows prompt
  • Verify in Slack: mentioning bot with "for Mac Miller" resolves artist
  • Verify in Slack: mentioning bot with unknown artist shows error

🤖 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

    • Added artistName to the content prompt schema for extraction from natural language.
    • Introduced selectAccountByNameInOrg for case-insensitive, partial artist lookup within the org.
    • Updated registerOnNewMention to resolve artist from the prompt; prompts if missing and errors if not found.
  • Migration

    • In Slack, include an artist name in your prompt (e.g., “make a video for Mac Miller”).

Written for commit 69b3e3b. Summary will update on new commits.

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@recoup-coding-agent has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 9 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8a1a7a50-a8db-4f5f-87ca-76b625c687a5

📥 Commits

Reviewing files that changed from the base of the PR and between b9341e3 and 69b3e3b.

⛔ Files ignored due to path filters (3)
  • lib/agents/content/__tests__/parseContentPrompt.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/agents/content/__tests__/registerOnNewMention.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/supabase/accounts/__tests__/selectAccountByNameInOrg.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (3)
  • lib/agents/content/createContentPromptAgent.ts
  • lib/agents/content/handlers/registerOnNewMention.ts
  • lib/supabase/accounts/selectAccountByNameInOrg.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rec-64-default-no-artist

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.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 14, 2026

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

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Apr 14, 2026 8:48pm

Request Review

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.

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
Loading

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) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 14, 2026

Choose a reason for hiding this comment

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

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>
Fix with Cubic

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.

1 participant