Skip to content

App: connect your own AI before using OpenBot Cloud - #1997

Merged
davidmckayv merged 3 commits into
mainfrom
cloud-connect-your-ai-screens
Nov 22, 2026
Merged

davidmckayv merged 3 commits into
mainfrom
cloud-connect-your-ai-screens

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

OpenBot Cloud provides no AI, so each person connects their own, personal to them and never shared with their organization. Today a new person goes from Welcome straight into chat, and their first message fails with a sentence telling an admin to add a key. This puts the screens in front of that, on the API from #1996.

What a person sees

  • Onboarding: a Connect your AI step right after Welcome, shown only when the server says one is required and the person's runs have none (required && uses === "none"). The step's button stays disabled until they connect, and there is no Not now. If the organization already has an AI, there is no step, and they can add their own later in Settings.
  • The gate: _authed sends anybody in that state to /onboarding?step=ai from any page. That includes people who finished onboarding before the step existed. For them it is the only step, and its button takes them into the app without finishing onboarding again.
  • Settings > General > Your AI: shows the person's own connection, or that Bots use the organization's, and opens the same chooser to add or change it. Removing theirs goes back to the organization's AI, or back to the step if the organization has none. Beside it, the admin's section now reads Organization's AI.
  • Switching organization: once the app works in the new organization, the routes on screen load again and their gates ask it. A switch into an organization with no AI goes to the step at once, not on the next click.
  • A way out that isn't a skip: the step lists the person's other organizations (when they have more than one), using the account menu's own switch, and always offers Sign out. These sit beside the words on a desktop and under the chooser on a phone.
  • Organization's AI on Cloud: its row says the key is the organization's ("Uses your organization's OpenAI API key."). With none set, its dialog reads "Set up your organization's AI". Self-hosted wording is unchanged.
  • Chat: a run refused with Connect your AI to use Bots. An admin can also set one up for everyone in your organization. (matched word for word, exported beside NO_AI_CONNECTION) gets a Connect your AI button that opens the step. The self-hosted NO_AI_CONNECTION path is unchanged.

The chooser

Settings' AI connection chooser (the app's port of Desktop's setup window) moves to components/settings/ai-connection-chooser.tsx, and Settings' organization dialog and the new personal mode both use it. Organization mode works as it did before. In personal mode:

  • Every provider can connect with a key or an address.
  • A provider sign-in is offered only for providers in signIns, and it comes first. The server runs it: start, show the code and "Open the sign-in page", poll every interval seconds, then connect with useSavedKey and the preset address and model.
  • Plans and Desktop-held sign-ins are never offered, even inside OpenBot Desktop, because the server runs the Bots.

On a page, the chooser sits in a card where the other steps put their picture: a real control, so it has the card's fill, like the booking calendar.

Reads and writes go through lib/ai-connection factories: personalAiConnectionQueryOptions, connectPersonalAiMutationOptions, removePersonalAiMutationOptions, and plain functions for the sign-in. An error or a 404 from an older server reads as "not required".

Tests

  • app/tests/connect-your-ai.test.tsx (real browser, added to CI's app-browser job) drives the app's own gate, onboarding route and Settings against the spec's own examples. Every request body is checked with the generated zod schemas. It covers:
    • a new person held at the step until they connect, with a refused key, the gate sending them back, then a good key taking them in;
    • an organization with an AI going straight in;
    • a person who already finished onboarding getting only the step;
    • inside a fake Desktop shell: no plan tab, and the Unbiased AI server sign-in;
    • Settings > Your AI, including Remove;
    • a switch into an organization with no AI reaching the step at once, the step's other organizations and Sign out, and the organization's AI wording on Cloud. Each of these three fails on the first commit and passes after.
  • add-model-key-link.test.tsx: the Cloud sentence gives everybody Connect your AI.
  • Existing onboarding, Settings, AI connection (including the org dialog's browser test) and copy tests pass. Typecheck, lint and format are clean.

Screenshots of the step and Settings in light and dark, at 1440px and 390px, were compared side by side with onboarding's Welcome and Settings' AI connection dialog.

OpenBot Cloud provides no AI, so each person connects their own, personal
to them and never shared with their organization. Until now a new person
went from Welcome into chat, and their first message failed with a
sentence telling an admin to add a key.

- Onboarding: a Connect your AI step right after Welcome, only where the
  server says one is required and the person's runs have none. Its button
  stays disabled until they connect, and there is no way past it. Where
  the organization already has an AI there is no step.
- The signed-in gate sends anybody in that state to the step from
  anywhere, including people who finished onboarding before it existed,
  for whom it is the only step and its button takes them into the app.
- Settings: a Your AI section with their own connection, or that Bots use
  the organization's, to add, change or remove theirs. The admin's
  section reads Organization's AI beside it.
- Chat: a run refused with the Cloud sentence gets a Connect your AI
  button that opens the step.
- The chooser from Settings' AI connection dialog is now shared, with a
  personal mode: a key or an address for every provider, and a provider
  sign-in only where the server runs it itself, polled until approved and
  connected with the key the server kept. Never a plan or a sign-in held
  by OpenBot Desktop, even inside Desktop. The organization dialog
  behaves as before.
- A real-browser test drives the gate, the step, Settings and the
  Desktop case against the spec's own examples, and runs in CI.
Found end to end on a real OpenBot Cloud install.

- A switch from an organization with an AI to one without landed on a
  usable home screen, and only the next click went to Connect your AI.
  A switch takes the person home while the app still works in the
  organization they are leaving, so the gate decided on that one's
  answer. Once the app has changed over, the routes on screen now load
  again and their gates ask the new organization.
- Somebody whose organization has no AI could not leave the step. It now
  lists their other organizations, when they have more than one, to work
  in one of those instead with the account menu's own switch, and it
  always offers Sign out. Beside the words on a desktop, under the
  chooser on a phone.
- On OpenBot Cloud the organization's AI read as the admin's own ("Uses
  your Anthropic API key") and its dialog said "Change AI connection"
  with nothing set. It now says the key is the organization's, and sets
  one up when there is none. Self-hosted wording is unchanged.

Each has a real-browser regression test that fails before and passes
after.
@davidmckayv
davidmckayv force-pushed the cloud-connect-your-ai-screens branch from 61dd693 to 58b2e89 Compare November 22, 2026 01:09
@davidmckayv
davidmckayv merged commit d1538b7 into main Nov 22, 2026
34 checks passed
@davidmckayv
davidmckayv deleted the cloud-connect-your-ai-screens branch November 22, 2026 01:15
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