Skip to content

fix(copilot): default SIM_AGENT_API_URL to www.copilot.sim.ai#4700

Merged
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/issue-3891-final-comment
May 21, 2026
Merged

fix(copilot): default SIM_AGENT_API_URL to www.copilot.sim.ai#4700
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/issue-3891-final-comment

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Change SIM_AGENT_API_URL_DEFAULT from https://copilot.sim.ai to https://www.copilot.sim.ai to avoid the LB redirect that drops the request path (e.g. /api/copilot)
  • Resolves the workaround in #3891 where users had to manually set SIM_AGENT_API_URL

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 21, 2026 5:44pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 21, 2026

PR Summary

Low Risk
Low risk: changes only the default Copilot backend base URL; behavior is unchanged when SIM_AGENT_API_URL is explicitly configured, but could affect environments relying on the old default host.

Overview
Updates the Copilot agent default base URL (SIM_AGENT_API_URL_DEFAULT) from https://copilot.sim.ai to https://www.copilot.sim.ai, so requests to agent endpoints (e.g., /api/...) avoid redirects that can drop the path when no env override is set.

Reviewed by Cursor Bugbot for commit 4391bfb. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR changes the default copilot backend URL (SIM_AGENT_API_URL_DEFAULT) from https://copilot.sim.ai to https://www.copilot.sim.ai so that requests to /api/copilot are no longer silently dropped by a load-balancer redirect on the bare domain.

  • Changes one constant in apps/sim/lib/copilot/constants.ts; all other copilot logic is unaffected.
  • The existing env-override path (SIM_AGENT_API_URL) continues to work normally, so self-hosted deployments with a custom URL are not impacted.

Confidence Score: 5/5

This is a safe, one-line string change to a well-guarded constant; the env-override fallback is untouched and the www. prefix is the correct canonical hostname per the PR description.

The only changed line is the default URL value. All env-override and validation logic in the same file is unmodified, and the fix directly addresses a documented LB redirect issue by targeting the canonical www. subdomain.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/constants.ts Single-line URL change updating SIM_AGENT_API_URL_DEFAULT from https://copilot.sim.ai to https://www.copilot.sim.ai to prevent LB redirect that drops the /api/copilot path.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Next.js as Next.js (sim)
    participant LB as Load Balancer
    participant Backend as Copilot Backend

    Note over Client,Backend: Before fix (bare domain)
    Client->>Next.js: POST /api/copilot
    Next.js->>LB: POST https://copilot.sim.ai/api/copilot
    LB-->>Next.js: 301 Redirect → https://www.copilot.sim.ai (path dropped)
    Next.js-->>Client: Request fails / path lost

    Note over Client,Backend: After fix (www subdomain)
    Client->>Next.js: POST /api/copilot
    Next.js->>LB: POST https://www.copilot.sim.ai/api/copilot
    LB->>Backend: POST /api/copilot (path preserved)
    Backend-->>Client: 200 OK
Loading

Reviews (1): Last reviewed commit: "fix(copilot): default SIM_AGENT_API_URL ..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit d892165 into staging May 21, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/issue-3891-final-comment branch May 21, 2026 17:50
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