Skip to content

Conversation

@Nauxie
Copy link
Member

@Nauxie Nauxie commented Dec 20, 2025

Note

Updates default engine URL to the deployments service and centralizes its usage by importing it in ChatWidget.

  • API Client (src/api/client.ts):
    • Config: Export DEFAULT_ENGINE_URL pointing to https://deployments-z71a.onrender.com.
  • UI (src/components/ChatWidget/ChatWidget.tsx):
    • Config: Import and use DEFAULT_ENGINE_URL from api/client instead of a local constant to standardize the default base URL.

Written by Cursor Bugbot for commit 3ffe326. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Dec 20, 2025

Greptile Summary

Centralized the DEFAULT_ENGINE_URL constant by exporting it from src/api/client.ts and removing the duplicate definition in ChatWidget.tsx, updating the URL from WhatsApp server to deployments server.

  • Exported DEFAULT_ENGINE_URL from api/client.ts for reuse across components
  • Updated engine URL from whatsapp-based-server.onrender.com to deployments-z71a.onrender.com
  • Removed duplicate constant definition in ChatWidget.tsx, now imports from centralized location
  • Added clear TODO comment indicating the URL is temporary pending chat embed deployment service
  • Updated localhost port from 8000 to 8003 in commented fallback

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Simple refactoring that centralizes a constant, eliminates duplication, and follows DRY principles. No logic changes, no new dependencies, and the URL update appears intentional with clear documentation.
  • No files require special attention

Important Files Changed

Filename Overview
src/api/client.ts Exported DEFAULT_ENGINE_URL constant and updated URL to deployments server with clear TODO comment
src/components/ChatWidget/ChatWidget.tsx Removed duplicate URL constant, now imports from centralized location in client.ts

Sequence Diagram

sequenceDiagram
    participant CW as ChatWidget Component
    participant AC as api/client.ts
    participant Server as Deployments Server

    Note over AC: DEFAULT_ENGINE_URL<br/>exported constant
    
    CW->>AC: Import DEFAULT_ENGINE_URL
    CW->>AC: Call createAPIClient(apiBaseUrl)
    AC->>AC: Use DEFAULT_ENGINE_URL as default
    
    Note over CW,Server: Configuration Fetch
    CW->>AC: apiClient.getDeploymentConfig(embedId)
    AC->>Server: GET /chat/config/{embed_id}
    Server-->>AC: Return config (agentName, primaryColor, etc.)
    AC-->>CW: Return DeploymentConfig
    
    Note over CW,Server: Message Sending
    CW->>AC: apiClient.sendMessage(params)
    AC->>Server: POST /chat/message
    Server-->>AC: Stream response (SSE)
    AC-->>CW: Return ReadableStream
Loading

@Nauxie Nauxie closed this Dec 23, 2025
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