Files
sim/apps
Theodore Li b4f027eece fix(billing): point self-hosted upgrade CTAs at the hosted app (#6003)
* fix(billing): point self-hosted upgrade CTAs at the hosted app

Self-hosted Chat bills against the sim.ai account behind COPILOT_API_KEY, but
its 402 upgrade card linked to local billing settings that a self-hosted
deployment does not have. Point those CTAs at the hosted app instead, and drop
the local workspace-role gate that could hide the CTA from the only person able
to act on it.

Adds /upgrade, an account-scoped entry for callers that cannot know a workspace
id. It delegates to /workspace?redirect=upgrade rather than re-deriving workspace
resolution, inheriting local recency, stale-session recovery, and the
no-workspace creation policy.

* fix(billing): keep the upgrade intent through workspace creation

A first-time visitor to /upgrade has no workspace to resolve, so /workspace
creates one — and then hardcoded a redirect to home, silently dropping the
upgrade intent. Route both exits through one destination helper so the created
workspace lands on the plan picker with its reason intact.
2026-07-31 16:08:02 -04:00
..