Repository navigation
Free usage-based trial: progress in Settings and a dialog once it's used up - #2112
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 24, 2026 01:50
davidmckayv
force-pushed
the
free-runs-screens
branch
from
November 24, 2026 03:13
49de886 to
d91d68f
Compare
…and say the trial tidily
Fixes from the end-to-end run:
- The dialog opened by itself again on every full page load (a reload, a link opened afresh,
Back from the payment page), because only the page remembered it had. This browser now
remembers it per person and organization, so it opens by itself once and then only on an AI try.
- Opened by a PLAN_REQUIRED refusal while the plan as last read still said runs were left, an
admin read the member's "Ask an admin" until the plan read again. The refusal carries the
payment page only for an owner or an admin, so it decides who the dialog is talking to at once.
- On OpenBot Cloud's sign-in, the trial added to the line under the heading took it to three
lines and split "usage-" from "based". That line is back to its two lines, and the trial is a
short line of its own under the button, with "usage-based" kept whole.
- The bar, the dialog's title and the server's refusal now begin the same way ("You've used your
free trial."), and the price reads "$5 a month for each member of this organization".
davidmckayv
force-pushed
the
free-runs-screens
branch
from
November 24, 2026 06:10
d91d68f to
3d77382
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenBot Cloud's free trial is now counted in runs, not days. This is the app side of it: people see how much of the trial they've used, and once it's gone they're told plainly, every time they try something that needs a Bot to run.
This branch is built on
free-runs-spec(theOrganizationPlanfieldsstatus: free,freeRunsUsedPercentandfreeRunsAllowance, and the regenerated client). Its two commits are in this branch, so merge that PR first and this one rebases clean.What changes
Settings > Organization, Plan row. On the free trial it shows "Free trial" with a progress bar and "N% used". No count or limit is shown. Once paid it shows the plan and its renewal date. When a card is needed, admins get Add a card as before.
Trial-used-up dialog. One dialog for the whole app, mounted once in the signed-in layout next to the other app-wide dialogs, so every skin and the Desktop window get it. It names the size of the trial (the server only sends
freeRunsAllowanceonce it's used up), says OpenBot is $5 a month for each member from here, and shows the same bar at 100%. Admins get one button to the payment page (addCardUrl). Members are told to ask an admin, with no button. It opens by itself once, for a person in an organization, when the plan read first says the trial is used up. The browser remembers this (localStorage, never throws), so a reload or Back from the payment page doesn't reopen it. After that it opens every time the person tries something that uses the AI. Closing it lasts until the next try. When it opens it reads the plan again, and closes by itself if a card has been added in the meantime. When a refusal opens it before that fresh read lands, the refusal'saddCardUrldecides admin or member, so an admin never sees the member's line. The bar, the dialog's title and the server's refusal all begin "You've used your free trial."How AI actions are caught
stopIfNeedsCard()), so the dialog opens and nothing is sent:PLAN_REQUIREDrefusal from the server opens the same dialog: a RESTClientError(inlib/client.ts, so every generated operation is covered) and a refused Bot run on the AG-UI stream (stoppedReasoninlib/copilot/stopped-turn.ts). An action that skips the check still shows the dialog.Banner and words. The bar over every page shows nothing while runs are left. Once the trial is used up it says so, with Add a card for admins.
lib/plan/words.tsno longer counts days or mentions a 30-day trial.needsCardstays true fornoneandpast_due, and is false forfree.Sign-up wording. "Free usage-based trial" (no number) appears on the web Cloud sign-in (a short line of its own under the button, "New accounts start on a free usage-based trial.", with "usage-based" never split), on Desktop's OpenBot Cloud row ("Your Bots run in our cloud. Free usage-based trial.", kept to one line as the setup window's layout test requires), and on the OpenBot Cloud choice in Move to OpenBot Cloud. Desktop's Cloud sign-in sits directly under that row, so it doesn't repeat it.
Progress primitive. shadcn's Progress in
components/ui/progress.tsx, built on the Base UI already used by every other primitive incomponents/ui(@base-ui/react1.7.0, already a dependency). No new package.Tests
app/tests/plan-free-trial.test.tsxuses the app's own screens and query client against a server answering at the API's addresses. It covers:addCardUrlPLAN_REQUIREDfromrunRoutine, and a refused Bot run, each open itapp/tests/plan-notices.test.tsxcovers the new banner wording, and that nothing shows onfree.app/tests/plan-notices-layout.test.tsx(headless Chromium,OPENBOT_APP_BROWSER=1) adds the free, used-up and active states. It also checks the Settings bar and the dialog in light and dark, at 1440px and 390px, for overflow, with one of the app's existing dialogs drawn for comparison.App.test.tsxcovers the new Cloud row and sign-in wording.