release: promote test to main#1727
Conversation
* chore(chat): migrate YouTube connector to Composio
- Add youtube to allowedArtistConnectors so the YouTube card appears in
the artist settings Connectors tab alongside TikTok/Instagram
- Rewrite useYoutubeChannel to call POST /api/connectors/actions with
YOUTUBE_GET_CHANNEL_STATISTICS; consume the raw Google channels.list
response (snippet/statistics/thumbnails) directly, no remapping
- Rewrite useYoutubeStatus to derive connection state from the Composio
connectors list instead of the legacy channel-info endpoint
- Rewrite ConnectYouTubeButton + YoutubeLogoutButton to use the Composio
authorize/disconnect flow already used by TikTok/Instagram
- Drop legacy chat-side OAuth surface: /api/youtube/*,
/api/auth/callback/google, lib/youtube OAuth/token helpers,
lib/supabase/youtube_tokens, types/youtube.ts, useYouTubeLoginSuccess,
the four LLM-tool result components for login/channels/playlist/thumb
(those tools now come from Composio's YouTube toolkit)
Keeps the get_youtube_revenue MCP tool dispatch in ToolComponents and the
matching VercelChat result components — Composio has no YouTube
Analytics action, so revenue stays custom on the api side.
* fix(chat): request snippet+statistics from YOUTUBE_GET_CHANNEL_STATISTICS
Composio's action defaults the `part` parameter to "statistics" only,
so the response had `snippet: null` and the UI rendered without title
or thumbnail. Pass `part: "snippet,statistics"` so the channel name,
description, and thumbnail come back too.
* chore(chat): remove unused ChatInputYoutubeButton + popover
Both components were orphaned — ChatInputYoutubeButton had zero callers,
which made ChatInputYoutubeButtonPopover and its StatCard / PopoverContent
unreachable too. Drop them entirely.
* fix(chat): unwrap Composio envelope in executeConnectorActionApi
api now passes Composio's ToolExecuteResponse through unchanged
({successful, data, error}). Consumer adapter unwraps once so all
chat-side callers get the underlying provider payload directly
(e.g. youtube.channels.list with `items`); upstream failures throw.
* fix(chat): address AI review feedback on youtube migration
- Share connector refresh across useConnectors instances so logout updates
sibling status (P1: useYoutubeStatus stale after disconnect)
- Disable disconnect button while in-flight to prevent duplicate requests
- Add aria-label to icon-only disconnect button
- Add aria-label to ConnectYouTubeButton for dense (icon-only) mode
- Propagate connector errors from useYoutubeStatus instead of hard-coded null
- Use semantic <span> for static section caption in ChannelInfo
- Provide fallback message in YouTubeRevenueResult when error text missing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(chat): simplify executeConnectorActionApi envelope handling
The api endpoint always returns Composio's ToolExecuteResponse envelope
(`{ successful, data, error }`) — every Composio Vercel-AI-SDK tool returns
that shape. Drop the defensive non-envelope branch and read the typed shape
directly, removing the `as unknown` casts and inline type guards.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(chat): React Query for useConnectors + extract fetchYoutubeChannel
- useConnectors now uses React Query so all instances share one cache;
disconnect/authorize invalidate the connectors key and sibling instances
re-render automatically. Drops the module-level Set<()=>void> broadcast.
- Extract fetchYoutubeChannel + types to lib/youtube/fetchYoutubeChannel.ts,
matching the fetchConnectorsApi / authorizeConnectorApi pattern. The hook
is now ~20 lines and just wires React Query to the helper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(chat): drop redundant queryFn return-type annotation
fetchConnectorsApi already returns Promise<ConnectorInfo[]>, so TS infers
the queryFn type correctly without the explicit annotation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chat): restore authorize catch to honor Promise<string | null> contract
Dropped during the React Query refactor — without the catch, an API failure
rejects the promise instead of returning null, which the only caller
(ConnectYouTubeButton) doesn't handle.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chat): gate useYoutubeChannel on Privy authenticated flag
Matches the codebase convention (useTaskRunStatus, useCatalogs, useArtistPosts,
etc.) — without it, the query runs and immediately throws "Not authenticated"
when the user isn't signed in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(chat): use shared useConnectorHandlers in YouTube buttons
Address sweetman's DRY review feedback on PR #1719: both ConnectYouTubeButton
and YoutubeLogoutButton open-coded the connect/disconnect state machine that
useConnectorHandlers (and ConnectorCard) already provide. Add an optional
onDisconnectSuccess callback to the hook so the logout button can still
invalidate the youtube-channel-info query after a successful disconnect.
* fix(chat): display "YouTube" as one word in connectors UI
Why: the formatConnectorName fallback regex inserts a space before
each capital, turning the API's "YouTube" into "You Tube". Add
youtube to the explicit display-name map alongside the other
multi-cap brands.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chat): add YouTube connector description
Without an explicit metadata entry, the YouTube card showed the
generic "Connect to enable this connector" placeholder. Match the
TikTok/Instagram pattern.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Sweets Sweetman <sweetmantech@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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 (1)
📒 Files selected for processing (54)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 48 minutes and 24 seconds.Comment |
There was a problem hiding this comment.
No issues found across 55 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: This is a significant refactor (55 files) migrating the YouTube integration to a new connector system (Composio), involving core API and logic changes that require human review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 868850511e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| status: error | ||
| ? "error" | ||
| : connectors.find((c) => c.slug === "youtube")?.isConnected | ||
| ? "valid" | ||
| : "invalid", |
There was a problem hiding this comment.
Derive YouTube validity from channel fetch, not connector flag alone
This now marks YouTube as valid solely from isConnected, so a connector that is still listed but has expired/revoked credentials will be treated as healthy. In that state, StandaloneYoutubeComponent renders ChannelInfo, but useYoutubeChannel can fail and leave the badge empty with no reconnect path, which is a regression from the previous token/channel validation flow. Please gate valid on a successful channel stats fetch (or propagate channel-fetch errors back into this status) so broken auth does not present as connected.
Useful? React with 👍 / 👎.
| ); | ||
| const { connectors, isLoading, authorize, disconnect } = | ||
| useConnectors(config); | ||
| const youtube = connectors.find((c) => c.slug === "youtube"); |
There was a problem hiding this comment.
Normalize connector slug before YouTube lookup
The YouTube lookup is now case-sensitive (c.slug === "youtube"), but useConnectors already normalizes slugs with toLowerCase() when filtering, which implies upstream slug casing is not guaranteed. If the API returns YOUTUBE/mixed case, this lookup fails and the disconnect control never appears even though the connector is present. Compare with a normalized check (e.g. c.slug.toLowerCase()) to avoid false negatives.
Useful? React with 👍 / 👎.
Promote
testtomain. Includes:🤖 Generated with Claude Code
Summary by cubic
Migrates the YouTube integration to Composio connectors and removes the legacy OAuth/supabase flow, simplifying connect/disconnect and unifying channel data fetching. The revenue tool remains custom on the API side.
Refactors
youtubeto allowed artist connectors, display names, and connector metadata./api/youtube/*, callback route, token libs, and unused UI.executeConnectorActionApiandfetchYoutubeChannel;useYoutubeChannelnow callsYOUTUBE_GET_CHANNEL_STATISTICSand readsitems[].snippet/statistics.useConnectorsto React Query with a shared cache;useYoutubeStatusderives state from connectors; updatedChannelInfoto the new response shape.ConnectYouTubeButtonandYoutubeLogoutButtonto useuseConnectorHandlersand addedonDisconnectSuccesssupport.Bug Fixes
part: "snippet,statistics"so channel title and thumbnail render correctly.YouTubeRevenueResult.Written for commit 8688505. Summary will update on new commits.