Skip to content

chore: remove dead segments surface#447

Merged
sweetmantech merged 1 commit into
testfrom
chore/remove-segments-surface
Apr 17, 2026
Merged

chore: remove dead segments surface#447
sweetmantech merged 1 commit into
testfrom
chore/remove-segments-surface

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented Apr 16, 2026

Summary

  • Deletes GET /api/artist/segments and GET /api/chats/[id]/segment route handlers
  • Removes the create_segments MCP tool registration from lib/mcp/tools/index.ts and deletes lib/mcp/tools/registerCreateSegmentsTool.ts
  • Prunes the two live tool-chain references to create_segments in lib/chat/toolChains/toolChains.ts and lib/chat/toolChains/createNewArtistToolChain.ts
  • Deletes lib/segments/*, lib/artist/{getArtistSegments,getArtistSegmentsHandler,mapArtistSegments,validateArtistSegmentsQuery}.ts, and lib/chats/getChatSegmentHandler.ts (+ its test)
  • Deletes lib/supabase/{artist_segments,fan_segments,segments,segment_rooms}/ directories

Context

The Segments surface is being removed entirely from chat, api, and docs. The earlier migration effort (docs #135, #136, api #443, #444, chat #1679, #1680) was abandoned and those PRs were closed unmerged.

Do not merge until the chat cleanup PRs are merged, otherwise the chat frontend will 404 on /api/chats/[id]/segment and on the segment list surface it still references.

Depends on:

Followed by:

Test plan

  • pnpm lint:check clean
  • pnpm test green (328 files, 2067 tests pass)
  • npx tsc --noEmit no new errors vs. test baseline (204 on baseline, 201 on branch — 3 fewer from deleted test file)
  • pnpm build succeeds modulo pre-existing env-var failures (RESEND_API_KEY, PRIVY_PROJECT_SECRET, etc.)

Notes

Synced test with main successfully before branching (no push rejection).

The two create_segments references outside the MCP registration (in lib/chat/toolChains/) were pruned in this PR — they are dead orchestration references to the now-removed tool, not a separate product surface.

Deletes GET /api/artist/segments, GET /api/chats/[id]/segment, the
create_segments MCP tool registration, and the lib/segments,
lib/artist/*segments*, lib/chats/getChatSegmentHandler, and
lib/supabase/{artist_segments,fan_segments,segments,segment_rooms}
modules. Also prunes the two remaining tool-chain references to the
create_segments tool in lib/chat/toolChains/{toolChains.ts,
createNewArtistToolChain.ts} so the orchestration does not reference
a tool that no longer exists.

The Segments feature is being removed entirely; the earlier migration
plan is abandoned. Part of SEGMENTS_SURFACE_REMOVAL_PLAN.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Apr 16, 2026 9:58pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@arpitgupta1214 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 25 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 58 minutes and 25 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: c4584a13-e0fd-4d94-a248-64faa830a5ca

📥 Commits

Reviewing files that changed from the base of the PR and between e81eba1 and 61e15fe.

⛔ Files ignored due to path filters (1)
  • lib/chats/__tests__/getChatSegmentHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (25)
  • app/api/artist/segments/route.ts
  • app/api/chats/[id]/segment/route.ts
  • lib/artist/getArtistSegments.ts
  • lib/artist/getArtistSegmentsHandler.ts
  • lib/artist/mapArtistSegments.ts
  • lib/artist/validateArtistSegmentsQuery.ts
  • lib/chat/toolChains/createNewArtistToolChain.ts
  • lib/chat/toolChains/toolChains.ts
  • lib/chats/getChatSegmentHandler.ts
  • lib/mcp/tools/index.ts
  • lib/mcp/tools/registerCreateSegmentsTool.ts
  • lib/segments/consts.ts
  • lib/segments/createSegmentResponses.ts
  • lib/segments/createSegments.ts
  • lib/segments/generateSegments.ts
  • lib/segments/getAnalysisPrompt.ts
  • lib/segments/getFanSegmentsToInsert.ts
  • lib/supabase/artist_segments/insertArtistSegments.ts
  • lib/supabase/artist_segments/selectArtistSegments.ts
  • lib/supabase/artist_segments/selectArtistSegmentsCount.ts
  • lib/supabase/artist_segments/selectArtistSegmentsWithDetails.ts
  • lib/supabase/fan_segments/insertFanSegments.ts
  • lib/supabase/segment_rooms/selectSegmentRoomByRoomId.ts
  • lib/supabase/segments/deleteSegments.ts
  • lib/supabase/segments/insertSegments.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-segments-surface

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 26 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Large-scale feature removal (26 files, 950+ lines) with explicit cross-repo dependencies and a 'Do not merge' warning requires human coordination and verification of the removal plan.

Architecture diagram
sequenceDiagram
    participant UI as Client / Chat UI
    participant API as API Route Handler
    participant TC as Tool Chain Orchestrator
    participant MCP as MCP Tool Server
    participant LLM as LLM (Model)

    Note over UI,LLM: Flow 1: External API Access (Segments Surface)
    
    UI->>API: GET /api/artist/segments
    API-->>UI: CHANGED: 404 Not Found (Route Handler Deleted)

    UI->>API: GET /api/chats/[id]/segment
    API-->>UI: CHANGED: 404 Not Found (Route Handler Deleted)

    Note over UI,LLM: Flow 2: Artist Onboarding Orchestration (createNewArtistToolChain)
    
    TC->>LLM: Request next tool execution
    LLM-->>TC: Tool: update_artist_knowledges
    TC->>MCP: execute(update_artist_knowledges)
    MCP-->>TC: success

    Note over TC,MCP: CHANGED: 'create_segments' tool removed from chain and registration

    TC->>LLM: Request next tool execution
    LLM-->>TC: Tool: youtube_login
    TC->>MCP: execute(youtube_login)
    MCP-->>TC: success

    Note over MCP,LLM: Tool Registration & Discovery
    MCP->>MCP: internal: registerAllTools()
    Note right of MCP: CHANGED: registerCreateSegmentsTool() call removed
    MCP-->>LLM: Updated Tool Manifest (create_segments no longer available)
Loading

@sweetmantech sweetmantech merged commit 83a58c8 into test Apr 17, 2026
6 checks passed
@sweetmantech sweetmantech deleted the chore/remove-segments-surface branch April 17, 2026 01:23
sweetmantech added a commit that referenced this pull request Apr 17, 2026
Promote test → main (includes #447 segments-surface removal)
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