Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
ModelGo: its card shows on a new install's first launch, and it sits in the Providers list after Google Gemini (#7508)
Milind Soni96ff844559a1
diff --git a/docs/announcements.md b/docs/announcements.mdindex 9e3ad257b8..205135aeb4 100644--- a/docs/announcements.md+++ b/docs/announcements.md@@ -165,7 +165,8 @@ that use it.- **At most one remote card a launch**, and **at most one `sponsor` card in any 7 days** per person (counted from the dayone was shown).- **Never** in the launch whose welcome just finished, over MausBot's first-launch card, during a live call, or while a- move to My Cloud is under way (the built-in sponsor card's exclusions).+ move to My Cloud is under way (the built-in sponsor card's exclusions, except that the built-in card may show in a new+ install's first launch once its first chat has a reply, and may follow MausBot's card).- **Never on a branded build** (`brandStatus().source === "file"`), any kind, as the What's new popup.- **Sponsor cards** also skip a desktop whose organization's policy limits the AI providers (company models only, or alist of allowed engines), and a Team Cloud's members who are not its owner or an admindiff --git a/src/components/AppNotices.test.ts b/src/components/AppNotices.test.tsindex 65ddc06d72..814314b2b1 100644--- a/src/components/AppNotices.test.ts+++ b/src/components/AppNotices.test.ts@@ -1434,14 +1434,63 @@ describe("ModelGo's sponsor card", () => {expect(await relaunch(), "then it comes").toContain(TITLE);});- it("never in the launch the welcome took or over a live call, and waits for the bots to load", async () => {+ it("never over a live call, and waits for the bots to load", async () => {f.state.liveCall = { status: "active" };expect(await launch(), "a live call").not.toContain(TITLE);f.state.liveCall = undefined; f.state.hydrated = false;expect(await relaunch(), "until the bots load").not.toContain(TITLE);- f.state.hydrated = true; session.clear(); markWelcomeFinished();- expect(await launch(), "the welcome's own launch").not.toContain(TITLE);- expect(launchNotice()).not.toBe(MODELGO_OFFER_NOTICE);+ f.state.hydrated = true;+ expect(await relaunch()).toContain(TITLE);+ });++ for (const metChief of [false, true]) {+ it(`a new install sees it in the launch its welcome finished, once its first chat has a reply, and only once${metChief ? " (after meeting the Chief)" : ""}`, async () => {+ f.state.bots = [];+ f.state.config.onboarding = { ...EMPTY_ONBOARDING };+ expect(await launch(), "the welcome is due").not.toContain(TITLE);+ f.state.welcomeOpen = true;+ f.state.config.onboarding = { ...EMPTY_ONBOARDING, completedAt: "2026-11-01", version: 1, hintsSeen: [...withTourFinished(undefined), ...(metChief ? [MET_CHIEF_HINT] : [])] };+ expect(await settle(), "the welcome is open").not.toContain(TITLE);+ f.state.welcomeOpen = false; markWelcomeFinished();+ expect(await settle(), "the welcome just finished, nothing said yet").not.toContain(TITLE);+ f.state.bots = [{ tasks: [{ threadId: "first" }] }];+ expect(await settle(), "the first chat, before its first reply").not.toContain(TITLE);+ expect(launchNotice()).toBeNull();+ f.state.bots = structuredClone(FIRST_REPLY);+ expect(await settle(), "the first reply came: the card, in this same launch").toContain(TITLE);+ expect(launchNotice()).toBe(MODELGO_OFFER_NOTICE);+ press("Not now"); await flush();+ expect(render()).toBe("");+ expect(await launch(), "a reload").not.toContain(TITLE);+ expect(await relaunch(), "a later launch").not.toContain(TITLE);+ });+ }++ it("on a new install's first launch it follows the move popup once that closes and the first reply has come", async () => {+ vi.useFakeTimers({ toFake: ["setInterval", "clearInterval", "setTimeout", "clearTimeout"] });+ storage.delete(GROK_MOVE_NOTICE);+ vi.stubGlobal("document", { activeElement: null, body: null, documentElement: { dataset: {} }, getElementById: () => null,+ querySelector: (selector: string) => selector === "[data-grok-move-popup]" ? { querySelectorAll: () => [] } : null, querySelectorAll: () => [] });+ f.state.bots = [{ tasks: [{ threadId: "first" }] }];+ f.state.config.onboarding = { ...EMPTY_ONBOARDING, completedAt: "2026-11-01", version: 1, hintsSeen: [...withTourFinished(undefined), MET_CHIEF_HINT] };+ markWelcomeFinished();+ expect(await launch(), "its first messages are still arriving").toBe("");+ vi.advanceTimersByTime(6_000);+ const grok = await settle();+ expect(grok).toContain("data-grok-move-popup"); expect(grok).not.toContain(TITLE);+ press("Not now"); await flush();+ expect(await settle(), "the first chat has no reply yet").not.toContain(TITLE);+ f.state.bots = structuredClone(FIRST_REPLY);+ expect(await settle(), "then the card, in the same launch").toContain(TITLE);+ });++ it("follows MausBot's first-launch card in the same launch once it closes", async () => {+ f.viewerEmail = null;+ f.state.bots = [{ ...structuredClone(FIRST_REPLY[0]), id: "maus", defaultBot: {} }];+ expect(await launch(), "the card is due: the sponsor's card waits for it").not.toContain(TITLE);+ markLaunchDialog("mausbot"); f.state.bots[0].welcomed = true;+ expect(await settle(), "the card closed in this launch").toContain(TITLE);+ expect(launchNotice()).toBe(MODELGO_OFFER_NOTICE);});it("is on every page: the desktop, My Cloud, a Team Cloud's Member and a browser", async () => {diff --git a/src/components/AppNotices.tsx b/src/components/AppNotices.tsxindex 37ded1e705..0902418248 100644--- a/src/components/AppNotices.tsx+++ b/src/components/AppNotices.tsx@@ -213,12 +213,13 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { q}, [grokDue, grokLanding, waits]);const grokNow = !grokDue ? false: !viewer || (desktop && !desktopState) || organization === null || firstChat === null || mausBotFirst || moving === null || grokLanding || grokBlocked ? null : true;- // Everyone, whether or not a bot has answered yet (so not `afterWelcome`, which holds until one has), but never in the launch- // the welcome or MausBot's card took, or during a live call.- const modelgoNow = !modelgoHere || moving || welcomeFinishedThisLaunch() || launchDialogShown() === "mausbot" || desktopState?.seen.includes(MODELGO_OFFER_NOTICE) ? false- : organization === null || moving === null || firstChat === null || mausBotFirst || (state.liveCall && state.liveCall.status !== "ended") || (desktop && !desktopState) ? null : true;- // A card from the project's announcements file: the built-in sponsor card's exclusions, and src/lib/announcements.ts's rules for- // which card and for whom (once per person, one sponsor card a week, none on a branded build).+ // Everyone, whether or not a bot has answered yet (so not `afterWelcome`), never during a live call; in the launch a new+ // install's welcome finished, only once its first chat has had a reply. It follows MausBot's card once that closes.+ const modelgoNow = !modelgoHere || moving || desktopState?.seen.includes(MODELGO_OFFER_NOTICE) ? false+ : organization === null || moving === null || firstChat === null || (welcomeFinishedThisLaunch() && firstChat) || mausBotFirst || (state.liveCall && state.liveCall.status !== "ended") || (desktop && !desktopState) ? null : true;+ // A card from the project's announcements file: never in the launch a welcome or MausBot's card took, else the built-in+ // sponsor card's exclusions, and src/lib/announcements.ts's rules for which card and for whom (once per person, one+ // sponsor card a week, none on a branded build).const branded = brandStatus().source === "file", team = Boolean(state.config?.team);const remoteCards = useAnnouncementCards(!branded);const surface = announcementSurface(local, Boolean(state.config?.cloudHome || viewer?.cloudHome));diff --git a/src/components/EnginesSettings.gemini.dom.test.ts b/src/components/EnginesSettings.gemini.dom.test.tsindex 5ab1ac1a3d..10e4743d97 100644--- a/src/components/EnginesSettings.gemini.dom.test.ts+++ b/src/components/EnginesSettings.gemini.dom.test.ts@@ -116,3 +116,46 @@ describe("Settings → AI → Providers: Google AI Studio (#6352)", () => {expect(studio()).toBeNull();});});++describe("Settings → AI → Providers: ModelGo sits in the main list, after Google's row", () => {+ const provider = (instanceId: string, driverKind: string, snapshot: InstanceInfo["snapshot"] = { state: "unavailable", reason: "No API key" }) => ({+ instanceId, driverKind, displayName: instanceId === "modelgo" ? "ModelGo" : instanceId, access: "api", snapshot, models: { default: "model", options: [] },+ } as unknown as InstanceInfo);+ const closed = async () => { await act(async () => { root.render(createElement(EnginesSettings, { simple: true, more: { id: "more", open: false, onToggle: () => {} } })); }); };+ const order = () => [...container.querySelectorAll("[data-simple-engine]")].map((row) => row.getAttribute("data-simple-engine"));+ const moreCount = () => [...container.querySelectorAll("button")].find((button) => button.textContent?.includes("More providers"))?.textContent;++ it("follows Google AI Studio, outside More providers, which no longer counts it", async () => {+ fixture.state = { ...fixture.state, instances: [provider("groq", "groq"), provider("modelgo", "modelgo"), provider("mistral", "mistral")] };+ await closed();+ expect(order()).toEqual(["google-ai-studio", "modelgo"]);+ expect(container.querySelector("[data-simple-engine=\"modelgo\"]")?.textContent).toContain("ModelGo");+ expect(container.querySelector("[data-simple-engine=\"modelgo\"]")?.textContent).toContain("Not set up");+ expect(moreCount()).toContain("More providers"); expect(moreCount()).toContain("2");+ await render();+ expect(order().filter((id) => id === "modelgo"), "listed once, the fold open too").toHaveLength(1);+ });++ it("follows the ready rows where Google's row is not offered, and stays among them, once, when it is ready itself", async () => {+ const ready = { state: "available", authenticated: true } as const;+ fixture.state = { ...fixture.state, instances: [provider("modelgo", "modelgo"), provider("groq", "groq", ready), gemini(GEMINI_URL)] };+ await closed();+ expect(order()).toEqual(["groq", "openai-compat-gemini", "modelgo"]);+ expect(container.textContent).not.toContain("More providers");+ fixture.state = { ...fixture.state, instances: [provider("groq", "groq", ready), provider("modelgo", "modelgo", ready), provider("mistral", "mistral")] };+ await closed();+ expect(order()).toEqual(["groq", "modelgo", "google-ai-studio"]);+ });++ it("stays folded where it may not be offered, and hidden once the person hid it", async () => {+ fixture.state = { ...fixture.state, instances: [provider("modelgo", "modelgo")], config: { managedPolicy: { organizationName: "Acme", companyModelsOnly: false, allowedEngines: ["groq"] } } };+ await closed();+ expect(order()).toEqual(["google-ai-studio"]);+ expect(moreCount()).toContain("1");+ fixture.state = { ...fixture.state, instances: [], config: {} };+ fixture.hidden = [{ instanceId: "modelgo", driverKind: "modelgo", displayName: "ModelGo" }];+ await closed();+ expect(order()).toEqual(["google-ai-studio"]);+ expect(moreCount()).toContain("1");+ });+});diff --git a/src/components/EnginesSettings.tsx b/src/components/EnginesSettings.tsxindex a47e64fef6..61d1235c46 100644--- a/src/components/EnginesSettings.tsx+++ b/src/components/EnginesSettings.tsx@@ -27,6 +27,7 @@ import { InstanceProviderMark } from "./ProviderIcons";import { GEMINI_PRESET, GeminiServer, hasGeminiServer } from "./OpenAiCompatServers";import { HiddenEngines, HiddenProviderRows, useHiddenProviders } from "./HiddenProviders";import { AdminOnly } from "./AdminOnly";+import { modelgoOfferable } from "@/lib/modelgo-offer";import { sameFields, useStoreActions, useStoreSelector } from "@/state/store-select";export { HiddenEngines };@@ -490,7 +491,7 @@ function GeminiProviderRow({ open, onToggle }: { open: boolean; onToggle: () =></>;}-function SimpleEngines({ rows, isReady, renderEngine, more, accountsOnly = false, offerGemini = false }: {+function SimpleEngines({ rows, isReady, renderEngine, more, accountsOnly = false, offerGemini = false, offerModelgo = false }: {rows: InstanceInfo[];isReady: (instance: InstanceInfo) => boolean;renderEngine: (instance: InstanceInfo, bare?: boolean) => ReactNode;@@ -499,12 +500,16 @@ function SimpleEngines({ rows, isReady, renderEngine, more, accountsOnly = falseaccountsOnly?: boolean;/** Offer the Google AI Studio row: no Gemini server is added yet and this workspace can add one. */offerGemini?: boolean;+ /** The sponsor's provider sits in the main list, after the Google AI Studio row, where it may be offered (modelgoOfferable). */+ offerModelgo?: boolean;}) {const [opened, setOpened] = useState<string | null>(null);// A hidden provider is gone from the instance list, so without these rows nothing in Settings brings it back.const allHidden = useHiddenProviders(), hidden = accountsOnly ? [] : allHidden;const featured = rows.filter((instance) => accountsOnly || isReady(instance) || instance.authentication !== undefined || hasGeminiServer([instance]));- const others = rows.filter((instance) => !featured.includes(instance));+ const modelgo = offerModelgo && !accountsOnly && !featured.some((instance) => instance.driverKind === "modelgo")+ ? rows.find((instance) => instance.driverKind === "modelgo") : undefined;+ const others = rows.filter((instance) => !featured.includes(instance) && instance !== modelgo);// A hidden Gemini server comes back through its own hidden row; adding another would only make a second one.const gemini = offerGemini && !hidden.some((provider) => provider.driverKind === "openai-compat" && provider.displayName === GEMINI_PRESET.name);const folded = others.length + hidden.length;@@ -518,6 +523,7 @@ function SimpleEngines({ rows, isReady, renderEngine, more, accountsOnly = false<SettingsRows icons>{featured.map((instance) => row(instance, false))}{gemini && <GeminiProviderRow open={opened === "google-ai-studio"} onToggle={() => setOpened(opened === "google-ai-studio" ? null : "google-ai-studio")} />}+ {modelgo && row(modelgo, false)}{folded > 0 && (<SettingsFoldRow id={more.id} title={t("settings.ai.moreProviders")} value={String(folded)} open={more.open} onToggle={more.onToggle}leading={<span aria-hidden="true" />}>@@ -560,7 +566,7 @@ export function AiSignInSettings() {}export function EnginesSettings({ simple = false, more }: { simple?: boolean; more?: { id: string; open: boolean; onToggle: () => void } }) {- const state = useStoreSelector((s) => ({ instances: s.instances }), sameFields);+ const state = useStoreSelector((s) => ({ instances: s.instances, policy: s.config?.managedPolicy }), sameFields);// Leaving Settings ends the "now uses the copy OpenMausBot installed" lines.useEffect(() => forgetAppCopySwitches, []);const listed = state.instances.filter((i) => i.readOnly || i.cli !== undefined || i.cliDefault !== undefined || i.snapshot.state === "unavailable" || isApiKeyEngine(i) || i.claudeEndpoint !== undefined || i.claudeBedrock !== undefined || i.codexEndpoint !== undefined);@@ -580,7 +586,8 @@ export function EnginesSettings({ simple = false, more }: { simple?: boolean; mo};if (simple && more) return <>- <SimpleEngines rows={rows} isReady={isReady} renderEngine={renderEngine} more={more} offerGemini={!hostedWorkspace && !hasGeminiServer(state.instances)} />+ <SimpleEngines rows={rows} isReady={isReady} renderEngine={renderEngine} more={more} offerGemini={!hostedWorkspace && !hasGeminiServer(state.instances)}+ offerModelgo={modelgoOfferable(state.policy)} />{orphanEndpoints && <div className="px-4"><ClaudeEndpoints /><ClaudeBedrockEndpoints /></div>}{orphanCodexEndpoints && <div className="px-4"><CodexEndpoints /></div>}</>;diff --git a/src/lib/notices.test.ts b/src/lib/notices.test.tsindex 9963fa55e9..9b26e7d3ce 100644--- a/src/lib/notices.test.ts+++ b/src/lib/notices.test.ts@@ -200,6 +200,18 @@ it("ModelGo's card follows update consent and the account's notices, and goes beexpect(MODELGO_OFFER_NOTICE).toBe("modelgo-offer-2026-11");});+it("a new install's first launch: once its first reply has come, ModelGo's card is its one notice, or follows the move popup", () => {+ // The welcome's own launch rules out the popups, the question, Boat and the announcements; a new install has no star yet.+ const first = (modelgo: boolean | null, grok: boolean | null = false) => facts(false, false, false, false, false, false, false, false, false, false, grok, modelgo);+ expect(nextNotice(first(null), none), "before the first reply").toBeNull();+ expect(nextNotice(first(true), none)).toBe(MODELGO_OFFER_NOTICE);+ expect(nextNotice(first(true, true), none), "the move popup still goes first").toBe(GROK_MOVE_NOTICE);+ const grokSeen = (id: NoticeId) => id === GROK_MOVE_NOTICE;+ expect(nextNotice(first(null, true), grokSeen, GROK_MOVE_NOTICE, true), "closed before the reply: the card still waits").toBeNull();+ expect(nextNotice(first(true, true), grokSeen, GROK_MOVE_NOTICE, true), "then follows it").toBe(MODELGO_OFFER_NOTICE);+ expect(nextNotice(first(true), id => id === MODELGO_OFFER_NOTICE), "seen: never again").toBeNull();+});+it("Update MausBot on your phone goes right after the Grok Bot popup, ahead of every promotion, and holds the sponsor's card", () => {const all = (phone: boolean | null, grok: boolean | null = false) => facts(true, true, true, true, true, true, true, true, true, true, grok, true, phone);expect(nextNotice(all(true), none)).toBe(PHONE_UPDATE_NOTICE);diff --git a/src/lib/notices.ts b/src/lib/notices.tsindex 619b890be2..1a5f3fc01e 100644--- a/src/lib/notices.ts+++ b/src/lib/notices.ts@@ -21,7 +21,8 @@ export const BOAT_OFFER_NOTICE = "boat-credit-2026-11";/** The Move from Grok Bot popup: each person sees it once, first of all, after their welcome. */export const GROK_MOVE_NOTICE = "grok-move-2026-11";/** The sponsor's card for ModelGo: each person sees it once, on every page but a branded build or a desktop whose organization- * refuses it, and on the first launch it may show in: first when nothing else is due, else right after the launch's notice. */+ * refuses it, and on the first launch it may show in (a new install's first, once its first chat has a reply): first when+ * nothing else is due, else right after the launch's notice. */export const MODELGO_OFFER_NOTICE = "modelgo-offer-2026-11";/** Update MausBot on your phone: once per phone with an older app after this computer's secure link ended. */export const PHONE_UPDATE_NOTICE = "phone-app-update";