Skip to content

Update main from test#1635

Merged
arpitgupta1214 merged 13 commits into
mainfrom
test
Apr 3, 2026
Merged

Update main from test#1635
arpitgupta1214 merged 13 commits into
mainfrom
test

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented Apr 3, 2026

Summary by CodeRabbit

  • New Features

    • Introduced improved runtime API base URL configuration and synchronization.
  • Refactoring

    • Centralized API base URL handling across the application with dynamic resolution instead of static configuration.
    • Streamlined API override mechanism to use session storage-based synchronization.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 3, 2026

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

Project Deployment Actions Updated (UTC)
recoup-chat Building Building Preview Apr 3, 2026 3:51pm

Request Review

@arpitgupta1214 arpitgupta1214 merged commit 1caeea0 into main Apr 3, 2026
1 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0b116963-b08a-448d-b4a6-b68b062ef2fd

📥 Commits

Reviewing files that changed from the base of the PR and between f554b06 and 9aabc10.

📒 Files selected for processing (45)
  • hooks/useAccountOrganizations.ts
  • hooks/useAddArtistToOrganization.ts
  • hooks/useApiOverride.ts
  • hooks/useArtistFromRoom.ts
  • hooks/useChatSegment.ts
  • hooks/useChatTransport.ts
  • hooks/useCreateArtistTool.ts
  • hooks/useCreateChat.tsx
  • hooks/useCreateOrganization.ts
  • hooks/useDeleteChat.ts
  • hooks/useMessageLoader.ts
  • hooks/useOrgSettings.ts
  • hooks/useVercelChat.ts
  • lib/api/artist/getArtistSocials.ts
  • lib/api/getClientApiBaseUrl.ts
  • lib/artists/fetchArtists.ts
  • lib/catalog/getCatalogSongs.ts
  • lib/catalog/postCatalogSongs.ts
  • lib/chat/validateHeaders.ts
  • lib/chats/deleteChat.ts
  • lib/chats/getChatArtist.ts
  • lib/chats/getChatSegment.ts
  • lib/chats/updateChat.ts
  • lib/composio/api/authorizeConnectorApi.ts
  • lib/composio/api/disconnectConnectorApi.ts
  • lib/composio/api/fetchConnectorsApi.ts
  • lib/consts.ts
  • lib/getConversations.tsx
  • lib/keys/createApiKey.ts
  • lib/keys/deleteApiKey.ts
  • lib/keys/fetchApiKeys.ts
  • lib/messages/copyMessages.ts
  • lib/messages/getChatMessages.ts
  • lib/pulse/getPulse.ts
  • lib/pulse/updatePulse.ts
  • lib/sandboxes/deleteSandbox.ts
  • lib/sandboxes/getFileContents.ts
  • lib/sandboxes/getSandboxes.ts
  • lib/sandboxes/uploadSandboxFiles.ts
  • lib/spotify/getSpotifyFollowers.ts
  • lib/tasks/getTaskRuns.ts
  • lib/tasks/getTasks.ts
  • lib/tools/getArtistSegments.ts
  • providers/ApiOverrideSync.tsx
  • providers/Providers.tsx

📝 Walkthrough

Walkthrough

Replace hard-coded API base URL constant with dynamic runtime function across ~40 files. Remove useApiOverride hook, eliminate optional baseUrl parameters from API utilities, add ApiOverrideSync component to synchronize query parameters to session storage, and update calls to derive base URLs from getClientApiBaseUrl().

Changes

Cohort / File(s) Summary
Core Infrastructure
lib/api/getClientApiBaseUrl.ts, lib/consts.ts, providers/ApiOverrideSync.tsx, providers/Providers.tsx
Added API_OVERRIDE_STORAGE_KEY constant, enhanced getClientApiBaseUrl() to normalize URLs and read from sessionStorage, created new ApiOverrideSync component to sync query parameters to storage, and integrated it into provider tree.
Removed API Override Hook
hooks/useApiOverride.ts
Deleted entire useApiOverride hook (55 lines) that previously managed query parameter-based API override logic via sessionStorage.
Chat & Message Hooks
hooks/useAccountOrganizations.ts, hooks/useAddArtistToOrganization.ts, hooks/useCreateChat.tsx, hooks/useCreateOrganization.ts, hooks/useOrgSettings.ts
Updated to use getClientApiBaseUrl() instead of NEW_API_BASE_URL constant when constructing fetch URLs for organization/chat creation requests.
Hooks Removing API Override
hooks/useArtistFromRoom.ts, hooks/useChatSegment.ts, hooks/useDeleteChat.ts, hooks/useCreateArtistTool.ts, hooks/useMessageLoader.ts
Removed useApiOverride hook dependency and eliminated optional apiOverride parameter from downstream API calls (e.g., getChatArtist, getChatSegment, deleteChat, copyMessages). useMessageLoader signature changed to remove apiOverride parameter.
Chat Transport & Reload
hooks/useChatTransport.ts, hooks/useVercelChat.ts
Replaced useApiOverride() with getClientApiBaseUrl() for base URL derivation. useVercelChat introduces new handleReload callback wrapping regenerate with header retrieval logic.
Chat API Utilities
lib/chats/deleteChat.ts, lib/chats/getChatArtist.ts, lib/chats/getChatSegment.ts, lib/chats/updateChat.ts
Removed optional baseUrl parameter from function signatures and replaced with getClientApiBaseUrl() calls. All request/response logic unchanged.
Message APIs
lib/messages/getChatMessages.ts, lib/messages/copyMessages.ts
Removed optional baseUrl parameter and replaced constant with getClientApiBaseUrl() call for constructing request URLs.
Chat Utilities
lib/chat/validateHeaders.ts, lib/getConversations.tsx
Updated to use getClientApiBaseUrl() instead of NEW_API_BASE_URL when fetching account validation and conversation data.
Composio Connector APIs
lib/composio/api/authorizeConnectorApi.ts, lib/composio/api/disconnectConnectorApi.ts, lib/composio/api/fetchConnectorsApi.ts
Replaced static base URL constant with getClientApiBaseUrl() call in connector authorization, disconnection, and fetching operations.
Artist & Catalog APIs
lib/api/artist/getArtistSocials.ts, lib/artists/fetchArtists.ts, lib/tools/getArtistSegments.ts, lib/catalog/getCatalogSongs.ts, lib/catalog/postCatalogSongs.ts
Updated to construct request URLs using getClientApiBaseUrl() instead of NEW_API_BASE_URL constant.
API Key Management
lib/keys/createApiKey.ts, lib/keys/deleteApiKey.ts, lib/keys/fetchApiKeys.ts
Replaced static base URL with dynamic getClientApiBaseUrl() call when constructing API key endpoint requests.
Pulse APIs
lib/pulse/getPulse.ts, lib/pulse/updatePulse.ts
Removed exported PULSE_API_URL constant and updated both functions to construct URLs using getClientApiBaseUrl() at call time.
Sandbox APIs
lib/sandboxes/deleteSandbox.ts, lib/sandboxes/getFileContents.ts, lib/sandboxes/getSandboxes.ts, lib/sandboxes/uploadSandboxFiles.ts
Updated all sandbox-related utilities to use getClientApiBaseUrl() instead of NEW_API_BASE_URL for constructing fetch endpoints.
External & Task APIs
lib/spotify/getSpotifyFollowers.ts, lib/tasks/getTaskRuns.ts, lib/tasks/getTasks.ts
Replaced constant-based URL construction with dynamic getClientApiBaseUrl() calls for Spotify, task runs, and task fetching endpoints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested reviewers

  • sweetmantech

🔄 Constants yield to computation,
Query params dance to storage's percussion,
Forty files waltz in synchronization,
Static URLs give way to invocation,
The API base finds its home at runtime's station. ✨

✨ 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 test

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.

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