Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
ModelGo as an AI provider, with a one-time sponsor card (#5309)
Milind Sonie2f5f0cc2b99
diff --git a/apps/docs/content/docs/security/analytics.mdx b/apps/docs/content/docs/security/analytics.mdxindex 58de2b4d36..12148feb3a 100644--- a/apps/docs/content/docs/security/analytics.mdx+++ b/apps/docs/content/docs/security/analytics.mdx@@ -53,8 +53,8 @@ Properties are counts, `true` or `false`, or words from fixed lists in the app's| List | Values || --- | --- |-| Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |-| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro` |+| Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |+| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro` || App | The 24 apps Connected apps lists by default: `slack`, `github`, `gmail`, `googlecalendar`, `googlesheets`, `googledocs`, `googledrive`, `notion`, `linear`, `sentry`, `posthog`, `discord`, `twitter`, `reddit`, `zapier`, `hubspot`, `salesforce`, `jira`, `asana`, `trello`, `dropbox`, `airtable`, `figma`, `stripe`. Every other app is `other`. || Starting role | `assistant`, `inbox`, `research`, `coder`, `community`, `ops` || Cloud plan | `starter`, `personal`, `pro`, `max` |@@ -165,6 +165,7 @@ use their own Boat key, and how many bots run on cloud computers, without sendin| `cloud_welcome_ended` | A new Cloud's welcome ends | `reason`: `done`, `skipped`; `at`: the step it ended on || `product_hunt_card` | You act on the Product Hunt card | `action`: `upvote`, `not_now`, `close` || `boat_offer` | Boat's credit offer: its one-time card is shown or you act on it, or you act on it on the Boat card in Settings → API keys | `action`: `shown` (the card only), `get_boat`, `claim` (the drafted email to Boat opened), `not_now`, `close`; `place`: `card`, `settings` |+| `modelgo_offer` | ModelGo, a sponsor: its one-time popup or its first-run option is shown, or you act on the popup, the first-run option or the ModelGo row in Settings → API keys | `action`: `shown` (the popup and the first-run option), `get_key` (ModelGo's site opened), `add_key` (Settings: a key was saved there; first run: you opened the ModelGo row to add one; never the popup), `not_now`, `close` (the popup only); `place`: `popup`, `onboarding`, `settings` || `simple_mode_prompt` | The Simple mode popup, shown once in each browser after an update when nothing else is on screen, is shown, its Simple mode switch is flipped, or it is closed (Done, the X, Escape or a click outside) | `action`: `shown`, `toggled`, `closed`; `mode`: `simple`, `advanced`, the mode it was shown or closed in, or the one a flip turned on || `new_look_notice` | The notice that Simple is now the only look, shown once in each browser that was on Advanced mode, when nothing else is on screen, is shown or closed (Done, the X, Escape or a click outside) | `action`: `shown`, `closed` || `advanced_back_notice` | The notice that Advanced mode is back, shown once in each browser that was on Advanced mode before Simple became the only look and is put back on it, when nothing else is on screen, is shown or closed (Done, the X, Escape or a click outside) | `action`: `shown`, `closed` |diff --git a/docs/agents-tool-bridge.md b/docs/agents-tool-bridge.mdindex 6aab7cfaa5..e0b0daf98b 100644--- a/docs/agents-tool-bridge.md+++ b/docs/agents-tool-bridge.md@@ -85,7 +85,7 @@ name can be read by OpenMausBot too:| Engine | Bridged | Why ||---|---|---|| Claude Code | Yes, with the exceptions below | The agents server is pre-allowed as a whole (`--allowedTools mcp__agents`, `server/drivers/claude.ts:1673`), and the settings the CLI reads for the turn are checked. |-| API models: OpenAI-compatible, Cerebras, Greenference, Grok API, Groq, Meta, MiniMax, Mistral | Yes | The chat runtime never asks for the agents server (`server/drivers/chat-mcp-tools.ts:371`) and reads no configuration of the person's about a tool. |+| API models: OpenAI-compatible, Cerebras, Greenference, ModelGo, Grok API, Groq, Meta, MiniMax, Mistral | Yes | The chat runtime never asks for the agents server (`server/drivers/chat-mcp-tools.ts:371`) and reads no configuration of the person's about a tool. || Codex, including the ChatGPT plan | No | Codex reads a layered configuration of its own: `config.toml` under `CODEX_HOME` or `~/.codex`, a Company engine's own home under OpenMausBot's data, a trusted project's `.codex/config.toml`, `/etc/codex/config.toml` and `/etc/codex/managed_config.toml`; and it has `PreToolUse` and `PermissionRequest` hooks of its own. Any of these can take a rule about a tool by name, and this version does not examine them. || Pi | No | pi is launched with `-e` for OpenMausBot's extension and nothing that keeps the person's own extensions out (`server/drivers/pi.ts`, `PI_ARGS`), in the person's home. Pi loads the extensions it finds there, and an extension's `tool_call` handler can block a call by the name it sees, as OpenMausBot's own does (`server/drivers/pi-mcp-extension.ts`). This version does not examine them. || ACP agents: Grok, Kimi, Droid, Cursor, Antigravity, OpenCode, Qwen, Hermes, Cline, Gemini, custom | No | They keep their own permissions. "Always allow this session" hands the agent its own remembered approval ([approval levels](approval-levels.md)); given once for a harmless `use_tool` call it would cover every hidden tool. A reviewer would also lose the read-only marks the hidden reads carry, and Grok has native tools named `use_tool` and `search_tool`. |diff --git a/docs/analytics.md b/docs/analytics.mdindex d9ee943ac4..397889a388 100644--- a/docs/analytics.md+++ b/docs/analytics.md@@ -49,8 +49,8 @@ Properties are counts, `true` or `false`, or words from fixed lists in the app's| List | Values || --- | --- |-| Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |-| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro` |+| Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |+| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro` || App | The 24 apps Connected apps lists by default: `slack`, `github`, `gmail`, `googlecalendar`, `googlesheets`, `googledocs`, `googledrive`, `notion`, `linear`, `sentry`, `posthog`, `discord`, `twitter`, `reddit`, `zapier`, `hubspot`, `salesforce`, `jira`, `asana`, `trello`, `dropbox`, `airtable`, `figma`, `stripe`. Every other app is `other`. || Starting role | `assistant`, `inbox`, `research`, `coder`, `community`, `ops` || Cloud plan | `starter`, `personal`, `pro`, `max` |@@ -161,6 +161,7 @@ use their own Boat key, and how many bots run on cloud computers, without sendin| `cloud_welcome_ended` | A new Cloud's welcome ends | `reason`: `done`, `skipped`; `at`: the step it ended on || `product_hunt_card` | You act on the Product Hunt card | `action`: `upvote`, `not_now`, `close` || `boat_offer` | Boat's credit offer: its one-time card is shown or you act on it, or you act on it on the Boat card in Settings → API keys | `action`: `shown` (the card only), `get_boat`, `claim` (the drafted email to Boat opened), `not_now`, `close`; `place`: `card`, `settings` |+| `modelgo_offer` | ModelGo, a sponsor: its one-time popup or its first-run option is shown, or you act on the popup, the first-run option or the ModelGo row in Settings → API keys | `action`: `shown` (the popup and the first-run option), `get_key` (ModelGo's site opened), `add_key` (Settings: a key was saved there; first run: you opened the ModelGo row to add one; never the popup), `not_now`, `close` (the popup only); `place`: `popup`, `onboarding`, `settings` || `simple_mode_prompt` | The Simple mode popup, shown once in each browser after an update when nothing else is on screen, is shown, its Simple mode switch is flipped, or it is closed (Done, the X, Escape or a click outside) | `action`: `shown`, `toggled`, `closed`; `mode`: `simple`, `advanced`, the mode it was shown or closed in, or the one a flip turned on || `new_look_notice` | The notice that Simple is now the only look, shown once in each browser that was on Advanced mode, when nothing else is on screen, is shown or closed (Done, the X, Escape or a click outside) | `action`: `shown`, `closed` || `advanced_back_notice` | The notice that Advanced mode is back, shown once in each browser that was on Advanced mode before Simple became the only look and is put back on it, when nothing else is on screen, is shown or closed (Done, the X, Escape or a click outside) | `action`: `shown`, `closed` |diff --git a/docs/approval-levels.md b/docs/approval-levels.mdindex 820aeb5f2a..e8d6f73f82 100644--- a/docs/approval-levels.md+++ b/docs/approval-levels.md@@ -61,7 +61,7 @@ one, every approval decision OMB makes in that conversation uses it. How farthat reaches depends on who runs the tools:- **API engines** (OpenAI-compatible, Grok API, MiniMax, Mistral, Cerebras,- Groq, Greenference, Meta): OMB's tool gate reads the level before each tool call, so the+ Groq, Greenference, ModelGo, Meta): OMB's tool gate reads the level before each tool call, so thechange applies from the next call, up or down.- **Engines with their own modes** (Codex, Claude, Cursor, Antigravity, GrokBuild, Qwen Code, Gemini CLI, Droid, Pi's custom MCP tools): the engine got@@ -271,7 +271,7 @@ multi-question card renders its structured form on current apps instead.| Droid | Session mode `normal` (reads only) | not offered | Ask (no reviewer) | Session mode `auto-high`, plus automatic approval of remaining ACP permission requests || Kimi, Hermes, custom ACP agents | The agent's own default | not offered | Ask (no reviewer) | Approve individual ACP permission requests, never task questions || Pi | Pi's own tools run; computer control and custom MCP tools ask | not offered | Ask (no reviewer) | Custom MCP tools run without asking; computer-control confirms are approved |-| API engines (OpenAI-compatible, Grok API, MiniMax, Mistral, Cerebras, Groq, Greenference, Meta) | OMB's tool gate asks | not offered | Ask (no reviewer) | OMB's tool gate approves each call |+| API engines (OpenAI-compatible, Grok API, MiniMax, Mistral, Cerebras, Groq, Greenference, ModelGo, Meta) | OMB's tool gate asks | not offered | Ask (no reviewer) | OMB's tool gate approves each call |These settings apply on each turn, including resumed conversations. Switchingto a different provider while on Custom requires leaving Custom first;diff --git a/docs/bot-box.md b/docs/bot-box.mdindex b3003c20c0..8e181ee05e 100644--- a/docs/bot-box.md+++ b/docs/bot-box.md@@ -99,7 +99,7 @@ the 401 starts the engine's own sign-in, which cannot work because the broker drClaude Code then says only "Error dialing <address>", since the address holds a token. Connected apps (Composio) were already behind the harness(`/api/internal/connectors/*` with a per-turn bearer) and stay there.-A key whose CLI takes no base URL from the environment (xAI, Mistral, Groq, Greenference, Cerebras, MiniMax, Kimi, Cursor, Factory,+A key whose CLI takes no base URL from the environment (xAI, Mistral, Groq, Greenference, ModelGo, Cerebras, MiniMax, Kimi, Cursor, Factory,Cline, OpenCode, OpenRouter's own variable) stays raw in that box, and the report names it under `broker.unbrokered`,so the gap is visible. The self-check adds six broker checks (29 in all): the key is nowhere in the box's environmentor files, the base URL is the broker, a call with the token reaches the upstream with the real key, a wrong token isdiff --git a/docs/headless-cli.md b/docs/headless-cli.mdindex 6eac07c11f..66a56959a6 100644--- a/docs/headless-cli.md+++ b/docs/headless-cli.md@@ -267,7 +267,7 @@ openmausbot engine list```KIND is `claude`, `openai`, `openrouter`, `openai-compatible` (needs-`--base-url`), `xai`, `groq`, `greenference`, `mistral` or `cerebras`. The key comes from an+`--base-url`), `xai`, `groq`, `greenference`, `modelgo`, `mistral` or `cerebras`. The key comes from anenvironment variable (`--key-env`) or a file (`--key-file`), is written oncethrough the same setting the Settings screen uses, and is never printed orread back. An engine that already has a key is left alone unless `--rotate`,@@ -326,7 +326,7 @@ is the confirmation.version: 1 # requiredengines: # optional; needs full accessclaude: { key: SECRET, baseUrl: URL | SECRET, everyClaudeBot: true, install: false }- openai | openrouter | xai | groq | greenference | mistral | cerebras: { key: SECRET }+ openai | openrouter | xai | groq | greenference | modelgo | mistral | cerebras: { key: SECRET }openaiCompatible: { key: SECRET, baseUrl: URL | SECRET }# SECRET is { env: NAME } or { file: PATH }. A key written in the file is refused.defaults: BOT FIELDS # every bot gets these unless it sets its owndiff --git a/docs/self-hosting.md b/docs/self-hosting.mdindex 4d795a1a89..a4e73ad49a 100644--- a/docs/self-hosting.md+++ b/docs/self-hosting.md@@ -1404,7 +1404,7 @@ The note needs an engine that accepts a message in the middle of a turnonly the stop, and only if you set it. The note and the stop do not cover botson API models or turns in a room yet.-Bots on API models (xAI, Mistral, Groq, Greenference, Cerebras, Meta, MiniMax or an+Bots on API models (xAI, Mistral, Groq, Greenference, ModelGo, Cerebras, Meta, MiniMax or anOpenAI-compatible endpoint) end a turn as failed when a tool call failed andthe bot then answered. With the loop guard on, set `loopGuard.correctiveRounds`(0-5, default 0) and such a bot is sent back to re-run the failed call up todiff --git a/docs/verification/engines.md b/docs/verification/engines.mdindex e58a100f3d..59cecb4acf 100644--- a/docs/verification/engines.md+++ b/docs/verification/engines.md@@ -87,6 +87,21 @@ Groq model in the bot's picker, send a fixture turn, then clear the key andconfirm the engine is unavailable. Never use the live app or a real key forthis recipe.+## ModelGo API setup++```sh+pnpm exec vitest run server/drivers/modelgo.test.ts server/provider-key-check.test.ts server/credential-request.test.ts src/components/keys/key-catalog.test.ts+```++These use a local stand-in for `https://api.modelgo.ai/v1`. They check the+preset endpoint, that the server's key never goes to another host, the live+model list, streaming and tool calls over chat completions, the plain sentences+for HTTP 402 `billing_insufficient` and 403 `first_recharge_required`, and that+a refused key never shows in events. They never call ModelGo. A chat and a tool+call through this driver against the real API have not been run; use a real key+before relying on them. `/models` has no field for tool support, so the picker+keeps every model whose `output_modalities` includes text.+## Greenference API setup```shdiff --git a/electron/credential-patch.mjs b/electron/credential-patch.mjsindex e12e0a61ce..551dfce683 100644--- a/electron/credential-patch.mjs+++ b/electron/credential-patch.mjs@@ -8,6 +8,7 @@ export const CREDENTIAL_PATCH = {cerebrasApiKey: (value) => ({ cerebras: { key: value } }),groqApiKey: (value) => ({ groq: { key: value } }),greenferenceApiKey: (value) => ({ greenference: { key: value } }),+ modelgoApiKey: (value) => ({ modelgo: { key: value } }),metaApiKey: (value) => ({ meta: { key: value } }),deepseekApiKey: (value) => ({ deepseek: { key: value } }),openaiCompatApiKey: (value) => ({ openaiCompat: { key: value } }),diff --git a/electron/desktop-prefs.mjs b/electron/desktop-prefs.mjsindex c4ed7ad5d3..3ceadf5a20 100644--- a/electron/desktop-prefs.mjs+++ b/electron/desktop-prefs.mjs@@ -12,7 +12,7 @@ import { accountFullName } from "./system-name.mjs";export { DESKTOP_PORTS } from "./desktop-ports.mjs";/** The only notices a page may record, so no page can write anything else into the file. */-export const DESKTOP_NOTICES = Object.freeze(["whats-new-2026-11", "boat-credit-2026-11", "grok-move-2026-11"]);+export const DESKTOP_NOTICES = Object.freeze(["whats-new-2026-11", "boat-credit-2026-11", "grok-move-2026-11", "modelgo-offer-2026-11"]);const WHATS_NEW = DESKTOP_NOTICES[0];/** A locale code such as "de" or "pt-br", or "" for following the system. */const LANGUAGE = /^(?:[a-z]{2,3}(?:-[a-z0-9]{2,8}){0,2})?$/i;diff --git a/electron/desktop-prefs.node-test.mjs b/electron/desktop-prefs.node-test.mjsindex 66eead74b5..c621f3ba26 100644--- a/electron/desktop-prefs.node-test.mjs+++ b/electron/desktop-prefs.node-test.mjs@@ -12,7 +12,7 @@ const require = createRequire(import.meta.url);const environments = require("./environments.cjs");const localOrigin = require("./local-origin.cjs");-const POPUP = "whats-new-2026-11", BOAT = "boat-credit-2026-11", GROK = "grok-move-2026-11";+const POPUP = "whats-new-2026-11", BOAT = "boat-credit-2026-11", GROK = "grok-move-2026-11", MODELGO = "modelgo-offer-2026-11";const NOON = new Date(2026, 9, 16, 12).getTime();const LOCAL = "http://127.0.0.1:18799", CLOUD = "https://omb-u-1.fly.dev", VPS = "https://bots.example.test";@@ -26,7 +26,7 @@ test("a page on an older release keeps working with the longer list: its own ids});test("What's new, Boat's credit offer and the Grok Bot move are the notices a page can record; seen and analytics survive a restart; a broken record never stops the app", () => {- assert.deepEqual([...DESKTOP_NOTICES], [POPUP, BOAT, GROK]);+ assert.deepEqual([...DESKTOP_NOTICES], [POPUP, BOAT, GROK, MODELGO]);let saved = null;const writes = [];const prefs = createDesktopPrefs({ read: () => saved, write: value => { writes.push(value); saved = structuredClone(value); } });diff --git a/electron/diagnostics.mjs b/electron/diagnostics.mjsindex caf2adad71..a3e08d62ed 100644--- a/electron/diagnostics.mjs+++ b/electron/diagnostics.mjs@@ -9,6 +9,7 @@ export const CREDENTIAL_ENV_NAMES = ["CEREBRAS_API_KEY","OMB_GROQ_API_KEY","OMB_GREENFERENCE_API_KEY",+ "OMB_MODELGO_API_KEY","OMB_META_API_KEY","OMB_DEEPSEEK_API_KEY","OMB_ANTHROPIC_API_KEY",diff --git a/electron/workspace-credentials.mjs b/electron/workspace-credentials.mjsindex e1ed91b0d4..2e748ecb8a 100644--- a/electron/workspace-credentials.mjs+++ b/electron/workspace-credentials.mjs@@ -8,6 +8,7 @@ export const WORKSPACE_CREDENTIALS = [{ section: "cerebras", field: "key", name: "cerebrasApiKey", env: "CEREBRAS_API_KEY" },{ section: "groq", field: "key", name: "groqApiKey", env: "OMB_GROQ_API_KEY" },{ section: "greenference", field: "key", name: "greenferenceApiKey", env: "OMB_GREENFERENCE_API_KEY" },+ { section: "modelgo", field: "key", name: "modelgoApiKey", env: "OMB_MODELGO_API_KEY" },{ section: "meta", field: "key", name: "metaApiKey", env: "OMB_META_API_KEY" },{ section: "deepseek", field: "key", name: "deepseekApiKey", env: "OMB_DEEPSEEK_API_KEY" },{ section: "openaiCompat", field: "key", name: "openaiCompatApiKey", env: "OPENAI_COMPAT_API_KEY" },diff --git a/electron/workspace-credentials.test.mjs b/electron/workspace-credentials.test.mjsindex 80e503ed3f..25670e7357 100644--- a/electron/workspace-credentials.test.mjs+++ b/electron/workspace-credentials.test.mjs@@ -170,6 +170,7 @@ const AI_PROVIDER_KEYS = [["cerebras", "cerebrasApiKey", "CEREBRAS_API_KEY"],["groq", "groqApiKey", "OMB_GROQ_API_KEY"],["greenference", "greenferenceApiKey", "OMB_GREENFERENCE_API_KEY"],+ ["modelgo", "modelgoApiKey", "OMB_MODELGO_API_KEY"],["meta", "metaApiKey", "OMB_META_API_KEY"],["deepseek", "deepseekApiKey", "OMB_DEEPSEEK_API_KEY"],["openaiCompat", "openaiCompatApiKey", "OPENAI_COMPAT_API_KEY"],diff --git a/scripts/bench-desktop.ts b/scripts/bench-desktop.tsindex bfdac626eb..011bab2336 100644--- a/scripts/bench-desktop.ts+++ b/scripts/bench-desktop.ts@@ -49,7 +49,7 @@ const { values } = parseArgs({const only = new Set((values.only ?? PHASES.join(",")).split(",").map((phase) => phase.trim()).filter(Boolean));for (const phase of only) if (!(PHASES as readonly string[]).includes(phase)) throw new Error(`unknown phase ${phase}; phases: ${PHASES.join(", ")}`);const IDLE_MS = Number(values["idle-seconds"]) * 1000;-const STORAGE = { "omb-analytics-opt-out": "1", "omb-email-gate": "skipped", "omb-simple-mode-prompt": "1", "grok-move-2026-11": "1", "omb-advanced-mode": values.advanced ? "1" : "0" };+const STORAGE = { "omb-analytics-opt-out": "1", "omb-email-gate": "skipped", "omb-simple-mode-prompt": "1", "grok-move-2026-11": "1", "modelgo-offer-2026-11": "1", "omb-advanced-mode": values.advanced ? "1" : "0" };const log = (line: string) => process.stderr.write(`bench-desktop: ${line}\n`);const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));const round = (value: number, digits = 1) => Math.round(value * 10 ** digits) / 10 ** digits;diff --git a/scripts/testing/key-readback.e2e.test.ts b/scripts/testing/key-readback.e2e.test.tsindex 25e8941148..9cd09fc6f2 100644--- a/scripts/testing/key-readback.e2e.test.ts+++ b/scripts/testing/key-readback.e2e.test.ts@@ -119,7 +119,7 @@ const saveds = KEY_CATALOG.filter((entry) => entry.target || EXTRA_PATCH[entry.iit("saves every kind of credential, reads it back and shows it masked to its last four, then removes it", async () => {setLocale("en");expect(saveds.map((entry) => entry.id)).toEqual([- "openai", "anthropic", "xai", "openrouter", "mistral", "cerebras", "groq", "greenference", "meta", "deepseek", "opencodeGo", "openaiCompat",+ "openai", "anthropic", "xai", "openrouter", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "deepseek", "opencodeGo", "openaiCompat","liveKey", "elevenlabs", "geminiTts", "fishAudio", "box", "composio", "treg", "postiz", "jev", "openrouterHelper", "workersAi", "imageOpenai", "imageCustom",]);for (const storage of ["", "?secretStorage=external"]) {diff --git a/scripts/testing/lend-automatically-preview.tsx b/scripts/testing/lend-automatically-preview.tsxindex 5fedd1d747..070ec1ae82 100644--- a/scripts/testing/lend-automatically-preview.tsx+++ b/scripts/testing/lend-automatically-preview.tsx@@ -4,7 +4,7 @@ import { setAnalyticsEnabled, setEmailGateDone } from "../../src/lib/analytics";import { CLOUD_SETUP_HIDDEN, CLOUD_WELCOME_DONE } from "../../src/lib/cloud-setup";import { withTourFinished } from "../../src/lib/guided-tour";import { setAdvancedMode } from "../../src/lib/interface-mode";-import { GROK_MOVE_NOTICE } from "../../src/lib/notices";+import { GROK_MOVE_NOTICE, MODELGO_OFFER_NOTICE } from "../../src/lib/notices";import { markSimpleModePromptSeen } from "../../src/lib/simple-mode-prompt";import { applySkin, type SkinId } from "../../src/lib/skins";import "../../src/styles.css";@@ -19,6 +19,7 @@ setAnalyticsEnabled(false);setEmailGateDone("skipped");markSimpleModePromptSeen();localStorage.setItem(GROK_MOVE_NOTICE, "1");+localStorage.setItem(MODELGO_OFFER_NOTICE, "1");setAdvancedMode(true);applySkin((params.get("skin") ?? "midnight") as SkinId);diff --git a/scripts/testing/modelgo-links.test.ts b/scripts/testing/modelgo-links.test.tsnew file mode 100644index 0000000000..9d50d2030c--- /dev/null+++ b/scripts/testing/modelgo-links.test.ts@@ -0,0 +1,35 @@+// The sponsor counts its clicks by one tracked address, so nothing clickable in the app may reach its site any other way.+import { execFileSync } from "node:child_process";+import { readFileSync } from "node:fs";+import { describe, expect, it } from "vitest";+import { MODELGO_URL } from "../../shared/modelgo.ts";+import { CREDENTIAL_TARGETS } from "../../shared/credential-request.ts";+import { ModelgoDriver } from "../../server/drivers/modelgo.ts";++const ROOT = new URL("../../", import.meta.url);+const API_BASE = "https://api.modelgo.ai/v1";+const MENTION = /(?:https?:\/\/)?(?:[\w-]+\.)*modelgo\.ai[^\s"'`)\]<>]*/gi;+const lines = (file: string) => readFileSync(new URL(file, ROOT), "utf8").split("\n");+const isComment = (line: string) => /^\s*(?:\/\/|\/?\*)/.test(line) || /^\s*\/\*\*.*\*\/\s*$/.test(line);+const files = (...paths: string[]) => execFileSync("git", ["ls-files", "--cached", "--others", "--exclude-standard", ...paths], { cwd: ROOT, encoding: "utf8" })+ .split("\n").filter((file) => /\.(ts|tsx|mjs|json)$/.test(file) && !file.includes(".test."));+const mentions = (file: string) => lines(file).filter((line) => !isComment(line)).flatMap((line) => line.match(MENTION) ?? []);++describe("links to ModelGo's site", () => {+ it("is the exact address the sponsor asked for", () => {+ expect(MODELGO_URL).toBe("https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app");+ });++ it("is the only ModelGo address anywhere in src/ and shared/", () => {+ const found = files("src", "shared").flatMap((file) => mentions(file).map((mention) => [file, mention]));+ expect(found.filter(([, mention]) => mention !== MODELGO_URL)).toEqual([]);+ expect(found.map(([file]) => file)).toEqual(["shared/modelgo.ts"]);+ });++ it("is the only link the driver and the secret card offer; the server otherwise names only the API base", () => {+ expect(ModelgoDriver.install?.docsUrl).toBe(MODELGO_URL);+ expect(CREDENTIAL_TARGETS.modelgoApiKey.helpUrl).toBe(MODELGO_URL);+ const found = files("server").flatMap((file) => mentions(file).map((mention) => [file, mention]));+ expect(found.filter(([, mention]) => mention !== API_BASE)).toEqual([]);+ });+});diff --git a/scripts/testing/secret-card-descriptions.test.ts b/scripts/testing/secret-card-descriptions.test.tsindex a071344511..9f3f4f17ec 100644--- a/scripts/testing/secret-card-descriptions.test.ts+++ b/scripts/testing/secret-card-descriptions.test.ts@@ -50,6 +50,7 @@ const escapedText = (text: string) => renderToStaticMarkup(createElement("span",const localizedTargets = [["greenferenceApiKey", "Roda modelos do Greenference com sua própria chave."],+ ["modelgoApiKey", "Roda modelos do ModelGo com sua própria chave."],["geminiTtsKey", "Gera respostas faladas, mensagens de voz e a fala das chamadas com o Gemini."],] as const;@@ -95,6 +96,8 @@ describe("credential descriptions from the real producer to the renderer", () =>it.each([["greenferenceApiKey", "en"],["greenferenceApiKey", "pt-br"],+ ["modelgoApiKey", "en"],+ ["modelgoApiKey", "pt-br"],["geminiTtsKey", "en"],["geminiTtsKey", "pt-br"],] as const)("keeps the raw description of an older %s card in %s", async (target, locale) => {diff --git a/scripts/testing/sidebar-groups-preview.tsx b/scripts/testing/sidebar-groups-preview.tsxindex d8485f7824..a6fe139473 100644--- a/scripts/testing/sidebar-groups-preview.tsx+++ b/scripts/testing/sidebar-groups-preview.tsx@@ -2,7 +2,7 @@ import { createRoot } from "react-dom/client";import App from "../../src/App";import { setAnalyticsEnabled, setEmailGateDone } from "../../src/lib/analytics";import { setAdvancedMode } from "../../src/lib/interface-mode";-import { GROK_MOVE_NOTICE } from "../../src/lib/notices";+import { GROK_MOVE_NOTICE, MODELGO_OFFER_NOTICE } from "../../src/lib/notices";import { markSimpleModePromptSeen } from "../../src/lib/simple-mode-prompt";import { applySkin, type SkinId } from "../../src/lib/skins";import "../../src/styles.css";@@ -14,6 +14,7 @@ setAnalyticsEnabled(false);setEmailGateDone("skipped");markSimpleModePromptSeen();localStorage.setItem(GROK_MOVE_NOTICE, "1");+localStorage.setItem(MODELGO_OFFER_NOTICE, "1");setAdvancedMode(params.get("mode") !== "simple");applySkin((params.get("skin") ?? "daylight") as SkinId);createRoot(document.getElementById("root")!).render(<App />);diff --git a/scripts/testing/team-access-preview.tsx b/scripts/testing/team-access-preview.tsxindex c8546e02ea..d0a4a64e95 100644--- a/scripts/testing/team-access-preview.tsx+++ b/scripts/testing/team-access-preview.tsx@@ -4,7 +4,7 @@ import { createRoot } from "react-dom/client";import App from "../../src/App";import { setAnalyticsEnabled, setEmailGateDone } from "../../src/lib/analytics";import { setAdvancedMode } from "../../src/lib/interface-mode";-import { GROK_MOVE_NOTICE } from "../../src/lib/notices";+import { GROK_MOVE_NOTICE, MODELGO_OFFER_NOTICE } from "../../src/lib/notices";import { markSimpleModePromptSeen } from "../../src/lib/simple-mode-prompt";import { applySkinChoice, SKIN_IDS, type SkinId } from "../../src/lib/skins";import "../../src/styles.css";@@ -15,6 +15,7 @@ setAnalyticsEnabled(false);setEmailGateDone("skipped");markSimpleModePromptSeen();localStorage.setItem(GROK_MOVE_NOTICE, "1");+localStorage.setItem(MODELGO_OFFER_NOTICE, "1");setAdvancedMode(params.get("mode") === "advanced");applySkinChoice(SKIN_IDS.includes(skin as SkinId) ? (skin as SkinId) : "daylight");createRoot(document.getElementById("root")!).render(<App />);diff --git a/scripts/testing/threads-preview.tsx b/scripts/testing/threads-preview.tsxindex 3f1496cf3b..bd49bedbae 100644--- a/scripts/testing/threads-preview.tsx+++ b/scripts/testing/threads-preview.tsx@@ -2,7 +2,7 @@ import { createRoot } from "react-dom/client";import App from "../../src/App";import { setAnalyticsEnabled, setEmailGateDone } from "../../src/lib/analytics";import { ADVANCED_MODE_KEY, setAdvancedMode } from "../../src/lib/interface-mode";-import { GROK_MOVE_NOTICE } from "../../src/lib/notices";+import { GROK_MOVE_NOTICE, MODELGO_OFFER_NOTICE } from "../../src/lib/notices";import { markSimpleModePromptSeen } from "../../src/lib/simple-mode-prompt";import { applySkinChoice, readSkinChoice } from "../../src/lib/skins";import "../../src/styles.css";@@ -22,5 +22,7 @@ if (!new URLSearchParams(location.search).has("onboarding")) setEmailGateDone("sif (!new URLSearchParams(location.search).has("simpleModePrompt")) markSimpleModePromptSeen();// The same for the once-per-person Move from Grok Bot popup, with ?grokMovePopup=1.if (!new URLSearchParams(location.search).has("grokMovePopup")) localStorage.setItem(GROK_MOVE_NOTICE, "1");+// And for the once-per-person ModelGo sponsor card, with ?modelgoOffer=1: it sits over the sidebar's foot, where tests click.+if (!new URLSearchParams(location.search).has("modelgoOffer")) localStorage.setItem(MODELGO_OFFER_NOTICE, "1");applySkinChoice(readSkinChoice());createRoot(document.getElementById("root")!).render(<App />);diff --git a/scripts/testing/web-app-ui.e2e.test.ts b/scripts/testing/web-app-ui.e2e.test.tsindex 2f3f898146..dbebe8037c 100644--- a/scripts/testing/web-app-ui.e2e.test.ts+++ b/scripts/testing/web-app-ui.e2e.test.ts@@ -80,7 +80,7 @@ async function connect(url: string) {return value.result.value;};await request("Page.enable");- await request("Page.addScriptToEvaluateOnNewDocument", { source: "localStorage.setItem('omb-analytics-opt-out','1');localStorage.setItem('omb-email-gate','skipped');localStorage.setItem('grok-move-2026-11','1');" });+ await request("Page.addScriptToEvaluateOnNewDocument", { source: "localStorage.setItem('omb-analytics-opt-out','1');localStorage.setItem('omb-email-gate','skipped');localStorage.setItem('grok-move-2026-11','1');localStorage.setItem('modelgo-offer-2026-11','1');" });await request("Runtime.enable");await request("Emulation.setTouchEmulationEnabled", { enabled: true, maxTouchPoints: 1 });await request("Emulation.setDeviceMetricsOverride", { width: 390, height: 844, deviceScaleFactor: 1, mobile: true });diff --git a/server/agents-bridge-switch.test.ts b/server/agents-bridge-switch.test.tsindex 39c7f09012..b032b5bb00 100644--- a/server/agents-bridge-switch.test.ts+++ b/server/agents-bridge-switch.test.ts@@ -97,7 +97,7 @@ describe("which engines a turn is bridged on", () => {// and everything else the engine reads about a tool's name can be read too.it.each([// the chat-completions runtime, by every driver that runs on it- ["openai-compat"], ["cerebras"], ["greenference"], ["grok"], ["groq"], ["meta"], ["minimax"], ["mistral"],+ ["openai-compat"], ["cerebras"], ["greenference"], ["modelgo"], ["grok"], ["groq"], ["meta"], ["minimax"], ["mistral"],])("bridges %s", (driverKind) => {expect(engineBridgeRefusal(ON, { driverKind }, {}, HOST)).toBeNull();expect(agentsToolBridgeEnv(ON, bot, { driverKind }, {})).toEqual(on);@@ -152,10 +152,10 @@ describe("which engines a turn is bridged on", () => {it("sorts the default fleet the same way: its Claude and API-model engines, and none of Codex, Pi or its ACP agents", () => {const fleet = instanceConfigs({});const bridged = new Set(Object.entries(fleet).filter(([, instance]) => engineBridgeRefusal(ON, turnEngine({ instanceId: "any", driverKind: instance.driver }, { any: instance }, { version: "2.1.232 (Claude Code)" }, CLAUDE.cwd), {}, HOST) === null).map(([id]) => id));- for (const id of ["claude", "openaiCompat", "mistral", "cerebras", "groq", "greenference", "meta"]) expect(bridged.has(id), id).toBe(true);+ for (const id of ["claude", "openaiCompat", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta"]) expect(bridged.has(id), id).toBe(true);// the default `grok` is the ACP agent, not the API-key driverfor (const id of ["codex", "chatgpt", "pi", "grok", "kimi", "droid", "cursor", "antigravity", "opencodeGo", "museCode", "qwen", "hermes", "cline"]) expect(bridged.has(id), id).toBe(false);- for (const id of bridged) expect(["claudeAgent", "openai-compat", "cerebras", "greenference", "grok", "groq", "meta", "minimax", "mistral"], id).toContain(fleet[id]!.driver);+ for (const id of bridged) expect(["claudeAgent", "openai-compat", "cerebras", "greenference", "modelgo", "grok", "groq", "meta", "minimax", "mistral"], id).toContain(fleet[id]!.driver);});describe("Claude Code's exceptions", () => {diff --git a/server/agents-bridge-switch.ts b/server/agents-bridge-switch.tsindex d1282665b8..fa70eaa6f5 100644--- a/server/agents-bridge-switch.ts+++ b/server/agents-bridge-switch.ts@@ -80,7 +80,7 @@ export interface EngineHost {managedPolicyFiles: readonly string[];}-const CHAT_RUNTIME_DRIVERS: ReadonlySet<string> = new Set(["cerebras", "greenference", "grok", "groq", "meta", "minimax", "mistral", "openai-compat"]);+const CHAT_RUNTIME_DRIVERS: ReadonlySet<string> = new Set(["cerebras", "greenference", "modelgo", "grok", "groq", "meta", "minimax", "mistral", "openai-compat"]);/** Whether text may name the agents server: it contains `mcp__agents` (a server merely starting so counts* too) or `mcp__` then a wildcard. Security: plain substring tests; no pattern is ever built from config text. */diff --git a/server/bot-box/broker-env.ts b/server/bot-box/broker-env.tsindex 6031b5748d..47fd06a258 100644--- a/server/bot-box/broker-env.ts+++ b/server/bot-box/broker-env.ts@@ -29,7 +29,7 @@ export const BROKERED_PROVIDERS: readonly BrokeredProvider[] = [/** Keys the box would otherwise carry raw: named in the report when present. */export const UNBROKERED_KEY_ENV: readonly string[] = [- "XAI_API_KEY", "MISTRAL_API_KEY", "CEREBRAS_API_KEY", "GROQ_API_KEY", "GREENFERENCE_API_KEY", "META_API_KEY", "MINIMAX_API_KEY", "KIMI_API_KEY", "MOONSHOT_API_KEY",+ "XAI_API_KEY", "MISTRAL_API_KEY", "CEREBRAS_API_KEY", "GROQ_API_KEY", "GREENFERENCE_API_KEY", "MODELGO_API_KEY", "META_API_KEY", "MINIMAX_API_KEY", "KIMI_API_KEY", "MOONSHOT_API_KEY","CURSOR_API_KEY", "CURSOR_AUTH_TOKEN", "FACTORY_API_KEY", "CLINE_API_KEY", "OPENCODE_API_KEY", "OPENROUTER_API_KEY",];diff --git a/server/bot-box/env.ts b/server/bot-box/env.tsindex 6e82b18e14..b0f6f4e35e 100644--- a/server/bot-box/env.ts+++ b/server/bot-box/env.ts@@ -17,7 +17,7 @@ export const BOX_ENV_NAMES: ReadonlySet<string> = new Set([export const BOX_ENV_PREFIXES: readonly string[] = ["LC_", "OMB_", "OPENMAUSBOT_", "NPM_CONFIG_", "npm_config_","ANTHROPIC_", "CLAUDE_", "CODEX_", "OPENAI_", "OPENCODE_", "OPENROUTER_", "GEMINI_", "GOOGLE_", "GROK_", "XAI_",- "MISTRAL_", "CEREBRAS_", "GROQ_", "GREENFERENCE_", "META_", "MINIMAX_", "KIMI_", "MOONSHOT_", "CURSOR_", "FACTORY_", "CLINE_", "HERMES_",+ "MISTRAL_", "CEREBRAS_", "GROQ_", "GREENFERENCE_", "MODELGO_", "META_", "MINIMAX_", "KIMI_", "MOONSHOT_", "CURSOR_", "FACTORY_", "CLINE_", "HERMES_","MUSE_", "PI_", "DWEB_", "UNSLOTH_", "FAKE_CLAUDE_", "MCP_", "ANTIGRAVITY_", "AGY_",];diff --git a/server/cloud-connections.ts b/server/cloud-connections.tsindex e72eb82755..fdc1ad6d50 100644--- a/server/cloud-connections.ts+++ b/server/cloud-connections.ts@@ -46,7 +46,7 @@ export interface ConnectionListing {* goes for "Claude (API key)" alone: there it never takes over Claude bots that sign in with a Claude account. */interface Provider { id: string; label: string; for: string[]; config(cfg: AppConfig): Partial<AppConfig> | null }-const keyed = (name: "openai" | "openrouter" | "mistral" | "cerebras" | "greenference") => (cfg: AppConfig): Partial<AppConfig> | null => {+const keyed = (name: "openai" | "openrouter" | "mistral" | "cerebras" | "greenference" | "modelgo") => (cfg: AppConfig): Partial<AppConfig> | null => {const key = cfg[name]?.key;return key ? { [name]: { key } } : null;};@@ -65,6 +65,7 @@ export const KEY_PROVIDERS: readonly Provider[] = [{ id: "cerebras", label: "Cerebras", for: ["cerebras"], config: keyed("cerebras") },{ id: "groq", label: "Groq", for: ["groq"], config: keyedUrl("groq") },{ id: "greenference", label: "Greenference", for: ["greenference"], config: keyed("greenference") },+ { id: "modelgo", label: "ModelGo", for: ["modelgo"], config: keyed("modelgo") },{ id: "meta", label: "Meta", for: ["meta"], config: keyedUrl("meta") },{ id: "openaiCompat", label: "OpenAI-compatible", for: ["openaiCompat"], config: (cfg) => cfg.openaiCompat?.key? { openaiCompat: Object.fromEntries(Object.entries(cfg.openaiCompat).filter(([, value]) => typeof value === "string" && value)) } : null },diff --git a/server/config.test.ts b/server/config.test.tsindex 55def9d46b..2d7f96757e 100644--- a/server/config.test.ts+++ b/server/config.test.ts@@ -913,6 +913,21 @@ describe("default fleet", () => {expect(instanceConfigs({ instances: { standalone: { driver: "fake" } } })).not.toHaveProperty("groq");});+ it("adds ModelGo to product fleets and sends its workspace key only to ModelGo's own host", () => {+ const cfg: AppConfig = { modelgo: { key: "modelgo-workspace" }, instances: {+ codex: { driver: "codex" },+ modelgoCustomHost: { driver: "modelgo", config: { url: "https://another.example.test/v1" } },+ modelgoSameHost: { driver: "modelgo", config: { url: "https://api.modelgo.ai/v1/" } },+ modelgoOwn: { driver: "modelgo", environment: { MODELGO_API_KEY: "modelgo-own" } },+ } };+ const map = instanceConfigs(cfg);+ expect(map.modelgo.environment).toEqual({ MODELGO_API_KEY: "modelgo-workspace" });+ expect(map.codex.environment).toEqual({});+ expect(map.modelgoCustomHost.environment).toEqual({});+ expect(map.modelgoSameHost.environment).toEqual({ MODELGO_API_KEY: "modelgo-workspace" });+ expect(map.modelgoOwn.environment).toEqual({ MODELGO_API_KEY: "modelgo-own" });+ });+it("preserves an existing compatible account named Groq when adding the built-in provider", () => {const map = instanceConfigs({ groq: { key: "workspace-key" }, instances: {codex: { driver: "codex" },diff --git a/server/config.ts b/server/config.tsindex 18feef8615..9f9add8764 100644--- a/server/config.ts+++ b/server/config.ts@@ -337,7 +337,7 @@ const appConfigSchema = z.object({mistral: z.object({ key: optionalText }).optional(),cerebras: z.object({ key: optionalText }).optional(), treg: z.object({ key: optionalText }).optional(), postiz: z.object({ key: optionalText, url: optionalText }).optional(),groq: z.object({ key: optionalText, url: optionalText }).optional(),- greenference: z.object({ key: optionalText }).optional(),+ greenference: z.object({ key: optionalText }).optional(), modelgo: z.object({ key: optionalText }).optional(),meta: z.object({ key: optionalText, url: optionalText }).optional(),deepseek: z.object({ key: optionalText }).optional(),xai: z.object({ key: optionalText, url: optionalText }).optional(),@@ -467,7 +467,7 @@ export interface AppConfig extends HelperConfig {mistral?: { key?: string };cerebras?: { key?: string }; treg?: { key?: string }; /** Postiz: an organisation API key and the server it belongs to (blank: Postiz Cloud). */ postiz?: { key?: string; url?: string };groq?: { key?: string; url?: string };- greenference?: { key?: string };+ greenference?: { key?: string }; modelgo?: { key?: string };meta?: { key?: string; url?: string };/** DeepSeek API key for the DeepSeek Harness engine (`dsh`). */deepseek?: { key?: string };@@ -746,7 +746,7 @@ export function loadConfig(): AppConfig {}// Env wins over the file for every credential: the desktop shell injects them as env at spawn.for (const [name, env] of [["mistral", "MISTRAL_API_KEY"], ["cerebras", "CEREBRAS_API_KEY"], ["groq", "OMB_GROQ_API_KEY"], ["meta", "OMB_META_API_KEY"],- ["deepseek", "OMB_DEEPSEEK_API_KEY"], ["greenference", "OMB_GREENFERENCE_API_KEY"], ["xai", "XAI_API_KEY"]] as const) {+ ["deepseek", "OMB_DEEPSEEK_API_KEY"], ["greenference", "OMB_GREENFERENCE_API_KEY"], ["modelgo", "OMB_MODELGO_API_KEY"], ["xai", "XAI_API_KEY"]] as const) {cfg[name] = { ...cfg[name], ...(process.env[env] !== undefined ? { key: process.env[env] } : {}) };}if (process.env.OMB_TREG_KEY !== undefined) cfg.treg = { ...cfg.treg, key: process.env.OMB_TREG_KEY }; if (process.env.OMB_POSTIZ_API_KEY !== undefined) cfg.postiz = { ...cfg.postiz, key: process.env.OMB_POSTIZ_API_KEY };@@ -811,7 +811,7 @@ export function syncCredentialEnv(patch: Partial<Omit<AppConfig, "threads" | "ne[patch.mistral?.key, "MISTRAL_API_KEY"],[patch.cerebras?.key, "CEREBRAS_API_KEY"], [patch.treg?.key, "OMB_TREG_KEY"], [patch.postiz?.key, "OMB_POSTIZ_API_KEY"],[patch.groq?.key, "OMB_GROQ_API_KEY"],- [patch.greenference?.key, "OMB_GREENFERENCE_API_KEY"],+ [patch.greenference?.key, "OMB_GREENFERENCE_API_KEY"], [patch.modelgo?.key, "OMB_MODELGO_API_KEY"],[patch.meta?.key, "OMB_META_API_KEY"],[patch.deepseek?.key, "OMB_DEEPSEEK_API_KEY"],[patch.anthropic?.key, "OMB_ANTHROPIC_API_KEY"],@@ -928,7 +928,7 @@ export function saveConfig(const keepImageModels = keepKeysOutOfImageModels(disk, checkedPatch.imageGen);const storedProfiles = storedBrowserProfilesSchema.safeParse(disk.browserProfiles);if (storedProfiles.success) disk.browserProfiles = storedProfiles.data;- for (const key of ["xai", "anthropic", "mistral", "cerebras", "treg", "postiz", "groq", "greenference", "meta", "deepseek", "openai", "openrouter", "openaiCompat", "composio", "box", "opencodeGo", "tts", "decider", "imageGen", "live", "profile", "rooms", "mcp", "threads", "context", "memory", "localVm", "features", "budgets", "billing", "decisions", "loopGuard", "onboarding", "browserEngine", "newBots", "safetyFloor"] as const) {+ for (const key of ["xai", "anthropic", "mistral", "cerebras", "treg", "postiz", "groq", "greenference", "modelgo", "meta", "deepseek", "openai", "openrouter", "openaiCompat", "composio", "box", "opencodeGo", "tts", "decider", "imageGen", "live", "profile", "rooms", "mcp", "threads", "context", "memory", "localVm", "features", "budgets", "billing", "decisions", "loopGuard", "onboarding", "browserEngine", "newBots", "safetyFloor"] as const) {const section = checkedPatch[key];if (!section) continue;const current = jsonObjectSchema.safeParse(disk[key]);@@ -1127,6 +1127,7 @@ export function instanceOwnsRouting(return own(entry.environment?.GROQ_API_KEY) || ownUrl("https://api.groq.com/openai/v1", cfg.groq?.url);case "greenference":return own(entry.environment?.GREENFERENCE_API_KEY) || ownUrl("https://llm.eu.greenference.com/v1");+ case "modelgo": return own(entry.environment?.MODELGO_API_KEY) || ownUrl("https://api.modelgo.ai/v1");case "meta":return own(entry.environment?.META_API_KEY) || ownUrl("https://api.meta.ai/v1", cfg.meta?.url);case "deepseekAgent":@@ -1146,7 +1147,7 @@ function injectedEnvironment(cfg: AppConfig, instanceId: string, driver: string)if (driver === "mistral" && cfg.mistral?.key) environment.set("MISTRAL_API_KEY", cfg.mistral.key);if (driver === "cerebras" && cfg.cerebras?.key) environment.set("CEREBRAS_API_KEY", cfg.cerebras.key);if (driver === "groq" && cfg.groq?.key) environment.set("GROQ_API_KEY", cfg.groq.key);- if (driver === "greenference" && cfg.greenference?.key) environment.set("GREENFERENCE_API_KEY", cfg.greenference.key);+ if (driver === "greenference" && cfg.greenference?.key) environment.set("GREENFERENCE_API_KEY", cfg.greenference.key); if (driver === "modelgo" && cfg.modelgo?.key) environment.set("MODELGO_API_KEY", cfg.modelgo.key);if (driver === "meta" && cfg.meta?.key) environment.set("META_API_KEY", cfg.meta.key);if (driver === "deepseekAgent" && cfg.deepseek?.key) environment.set("DEEPSEEK_API_KEY", cfg.deepseek.key);if (driver === "grok" && cfg.xai?.key) environment.set("XAI_API_KEY", cfg.xai.key);diff --git a/server/credential-env.ts b/server/credential-env.tsindex bd7815a2c9..40b166d4bb 100644--- a/server/credential-env.ts+++ b/server/credential-env.ts@@ -8,6 +8,7 @@ export const WORKSPACE_CREDENTIAL_ENV = ["CEREBRAS_API_KEY","OMB_GROQ_API_KEY","OMB_GREENFERENCE_API_KEY",+ "OMB_MODELGO_API_KEY","OMB_META_API_KEY","OMB_DEEPSEEK_API_KEY","OMB_ANTHROPIC_API_KEY",@@ -82,6 +83,7 @@ export const PROVIDER_CREDENTIAL_ENV = ["CEREBRAS_API_KEY","GROQ_API_KEY","GREENFERENCE_API_KEY",+ "MODELGO_API_KEY","META_API_KEY","DEEPSEEK_API_KEY","CURSOR_API_KEY",diff --git a/server/credential-request.test.ts b/server/credential-request.test.tsindex 691841723d..e4fdceb551 100644--- a/server/credential-request.test.ts+++ b/server/credential-request.test.ts@@ -31,6 +31,7 @@ const MAPPINGS: Array<[ConfigCredentialTargetId, CredentialConfig]> = [["cerebrasApiKey", { cerebras: { key: "secret" } }],["groqApiKey", { groq: { key: "secret" } }],["greenferenceApiKey", { greenference: { key: "secret" } }],+ ["modelgoApiKey", { modelgo: { key: "secret" } }],["metaApiKey", { meta: { key: "secret" } }],["deepseekApiKey", { deepseek: { key: "secret" } }],];@@ -67,7 +68,7 @@ describe("credential request allowlist", () => {expect(credentialIsConfigured({ tts: { key: "" } }, "ttsKey")).toBe(false);expect(credentialIsConfigured({ tts: { fishKey: "secret" } }, "fishAudioKey")).toBe(true);expect(credentialIsConfigured({ tts: { fishKey: "" } }, "fishAudioKey")).toBe(false);- expect(Object.keys(CREDENTIAL_TARGETS)).toHaveLength(18);+ expect(Object.keys(CREDENTIAL_TARGETS)).toHaveLength(19);});it("names the desktop slot a key is saved in, and none for the 1Password token", () => {diff --git a/server/drivers/agents-bridge-wire.test.ts b/server/drivers/agents-bridge-wire.test.tsindex 9878256d62..478ebf39c0 100644--- a/server/drivers/agents-bridge-wire.test.ts+++ b/server/drivers/agents-bridge-wire.test.ts@@ -106,8 +106,8 @@ const BUDGET_BASELINE: Record<string, number> = {"default+mausbot": 17538,"skills+shared+voice+mausbot": 18480,"default+no-computer-pick": 16274,- "default+room": 16213,- "non-chief+room": 16096,+ "default+room": 16544,+ "non-chief+room": 16427,"skills+shared+voice+x+team+images": 18429,"default+images": 17502,};diff --git a/server/drivers/agents-catalog-goldens/bridged.profiles.json b/server/drivers/agents-catalog-goldens/bridged.profiles.jsonindex 18943ac9d3..6fd0fe8a27 100644--- a/server/drivers/agents-catalog-goldens/bridged.profiles.json+++ b/server/drivers/agents-catalog-goldens/bridged.profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 17777,- "sha256": "f63dfaf052292736de01cfcb21b220cecfb49345d95162ec32b6dcbfd7d04142",+ "bytes": 17793,+ "sha256": "c7271988228079942b6ed18b7f93cfc75cbaeabd885a395f527ae825403dd440","tools": ["tool_result_read","list_room_targets",@@ -22,8 +22,8 @@]},"voice": {- "bytes": 18558,- "sha256": "740dd90140c81f4f7849307d217d8091e6d0c8b9c0d74a0ba695bafcba0284ea",+ "bytes": 18574,+ "sha256": "2a0edca3b8b7044f13fc3d0614f43dac7ab9482cf65c82c85b09d7e345410d47","tools": ["tool_result_read","list_room_targets",@@ -45,8 +45,8 @@]},"shared": {- "bytes": 17817,- "sha256": "a18d769058db1d3630417da013b5191496cdf39f187d985d649f1e0ad1210e16",+ "bytes": 17833,+ "sha256": "0eb5fbf08cc128e78371b53fa658977f259f34635547c8bfd16b644486f38ea2","tools": ["tool_result_read","list_room_targets",@@ -67,8 +67,8 @@]},"shared+voice": {- "bytes": 18598,- "sha256": "813ad5bdc113606b923e9a88c6c396853bd5113807c8f283c00ce985dc871b39",+ "bytes": 18614,+ "sha256": "aade9891de5e71e011fa7d1057c4d9f9ed9faa7f3da467d327dc0efb8972cd9f","tools": ["tool_result_read","list_room_targets",@@ -90,8 +90,8 @@]},"skills": {- "bytes": 17804,- "sha256": "cd857027dac6a67005f8eecbff82d11ab3c573c855fb6af3f7745c7119d882ad",+ "bytes": 17820,+ "sha256": "25186b51cd7eab8b0cbc0b0f7efd96dd02f7287c05ea11bdf994698fb9ca41e5","tools": ["tool_result_read","list_room_targets",@@ -112,8 +112,8 @@]},"skills+voice": {- "bytes": 18585,- "sha256": "49244bebb968e65220cb14f32b7d9062175794cdacd2f6a099bcf96e9bdbe226",+ "bytes": 18601,+ "sha256": "9ac52fa85d72e9fbf49d12ad69717b94e59621783c3087b133bd95725ddf78f6","tools": ["tool_result_read","list_room_targets",@@ -135,8 +135,8 @@]},"skills+shared": {- "bytes": 17844,- "sha256": "a8aace8fd2f04b29b1764d4a6426e811f0423c4d8b22920a4ebc35070e52afa3",+ "bytes": 17860,+ "sha256": "ce1daf83feaa2e689f96f8eb3714eca6524b422583f391a4643f39570b1312a3","tools": ["tool_result_read","list_room_targets",@@ -157,8 +157,8 @@]},"skills+shared+voice": {- "bytes": 18625,- "sha256": "28668ba7407aff7b88474c604e81eef47cb543ab507740ed7f0a1617f41d8dd3",+ "bytes": 18641,+ "sha256": "0451477c1f69173c13b084bcd5211b834cea51192764f028a19384d34b088813","tools": ["tool_result_read","list_room_targets",@@ -180,8 +180,8 @@]},"non-chief": {- "bytes": 17660,- "sha256": "d73a93285d5c94a9088dc2069d6f97f03d8dc949845557df15f2ed3ed1c7d2ec",+ "bytes": 17676,+ "sha256": "038222827dfb1abded78913c2aaa7ae215f262e78900a19a4657561d9a55d77d","tools": ["tool_result_read","list_room_targets",@@ -202,8 +202,8 @@]},"voice+non-chief": {- "bytes": 18441,- "sha256": "f6a428842a33ba6b758189f04e7ed32b8df10812840124d03db8a18b804f22d3",+ "bytes": 18457,+ "sha256": "cf703507128c57a2f075a7d492bb99b44ea9a7cfc87ffa484ddc8ed3b7e40650","tools": ["tool_result_read","list_room_targets",@@ -225,8 +225,8 @@]},"shared+non-chief": {- "bytes": 17700,- "sha256": "66769795a599edcd7713ae27622ae79cff49d81c30df63525f7589dd5f6eadd5",+ "bytes": 17716,+ "sha256": "a8d99637922cfc2a42e154bc2164388d0bc57a0db7aafc38c34b26805f35d9ec","tools": ["tool_result_read","list_room_targets",@@ -247,8 +247,8 @@]},"shared+voice+non-chief": {- "bytes": 18481,- "sha256": "4e456e06eb72197fba41705aa697944b6d3a7337a7bf3514402fa2463169ad01",+ "bytes": 18497,+ "sha256": "dfc6fcec6c16ea08b5ed1dfa9f83533f2d1c6cf1385f5737b1cd7c41b9437d60","tools": ["tool_result_read","list_room_targets",@@ -270,8 +270,8 @@]},"skills+non-chief": {- "bytes": 17687,- "sha256": "3f6bbeed88c60b4d30ce95e36e604f2ea25fb36c52455de7694f722bc7be9a4e",+ "bytes": 17703,+ "sha256": "260953330303e9a3bd0f106055e1bf818b583c11df83b7c4ce1316eacd14f8bd","tools": ["tool_result_read","list_room_targets",@@ -292,8 +292,8 @@]},"skills+voice+non-chief": {- "bytes": 18468,- "sha256": "2b4925f489b3c78f358344b8fdbc6254ec396ef104e6e6e81cb13969f387ae84",+ "bytes": 18484,+ "sha256": "1b57688183cb415c98b719e69ffbb160b9df4a358b15f0447a1cccd13ff65ae1","tools": ["tool_result_read","list_room_targets",@@ -315,8 +315,8 @@]},"skills+shared+non-chief": {- "bytes": 17727,- "sha256": "e84b34c91fb71ee9be1a469dc530686c498e1f3a88844a7d6100805d9c9e553e",+ "bytes": 17743,+ "sha256": "01eaa69447bcbe059c44b2fce8cac0f4e94ecf86d3bdaddb9a41006523fc7c64","tools": ["tool_result_read","list_room_targets",@@ -337,8 +337,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 18508,- "sha256": "46308775511dd2cacc013640a6eee4c34ef6ec36f354919072b8ab4c07ac3188",+ "bytes": 18524,+ "sha256": "42d2d04dfd90aa41cb651b2faf8ebe50b4ad173e05dfd8f8b39a3d5b73b732ef","tools": ["tool_result_read","list_room_targets",@@ -360,8 +360,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 18641,- "sha256": "15b132bf6ed7b7ec8dc69e6c5a4806e0aaeaedda6798cbf5e5b298264d998fd5",+ "bytes": 18657,+ "sha256": "36767b65e3e07c6ab9eb0de69025c7ab6bc517bd77ccca320ae4c37f91224f8d","tools": ["tool_result_read","list_room_targets",@@ -383,8 +383,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 18524,- "sha256": "df13c164e48e1d0211ac60a6276f7f90a2605d9f46e5e0c2e2794b6887928ac4",+ "bytes": 18540,+ "sha256": "591929b43eca4e8db028d621fe5d6f23bafa80296c170d9135675019cbea99c8","tools": ["tool_result_read","list_room_targets",@@ -406,8 +406,8 @@]},"skills+shared+voice+x": {- "bytes": 18686,- "sha256": "4fd74b9df745af9ca2f6dd685b886e841cad97cb913b477be6ba13feb70058d5",+ "bytes": 18702,+ "sha256": "cfcf3fe4cf99c10761c48a7e15dc0ece8a831d3fb1824e56daf9b07ac19872bd","tools": ["tool_result_read","list_room_targets",@@ -429,8 +429,8 @@]},"skills+shared+voice+x+team": {- "bytes": 18686,- "sha256": "4fd74b9df745af9ca2f6dd685b886e841cad97cb913b477be6ba13feb70058d5",+ "bytes": 18702,+ "sha256": "cfcf3fe4cf99c10761c48a7e15dc0ece8a831d3fb1824e56daf9b07ac19872bd","tools": ["tool_result_read","list_room_targets",@@ -452,8 +452,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 18702,- "sha256": "defee74893606b3d47dbe65f9ee9322b9771d31cc3e4ce9c8f1ada85ef14d43e",+ "bytes": 18718,+ "sha256": "cfd277871bc44b2635f9c6d6be0f361bfd78679609a4613b14347c0fd8c59e01","tools": ["tool_result_read","list_room_targets",@@ -475,8 +475,8 @@]},"default+legacy-switches": {- "bytes": 17777,- "sha256": "f63dfaf052292736de01cfcb21b220cecfb49345d95162ec32b6dcbfd7d04142",+ "bytes": 17793,+ "sha256": "c7271988228079942b6ed18b7f93cfc75cbaeabd885a395f527ae825403dd440","tools": ["tool_result_read","list_room_targets",@@ -497,8 +497,8 @@]},"default+mausbot": {- "bytes": 17829,- "sha256": "5bfc4911f2f61d0e73da29ec71dac2056879fb374aa386f03d1bad4f44b7240d",+ "bytes": 17845,+ "sha256": "4a3eeb5d61626506c4c911fd03c1a52dacc88d948f832d99c594455efd9aa0b1","tools": ["tool_result_read","list_room_targets",@@ -519,8 +519,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 18677,- "sha256": "90583a3635d74d2ce3d324b3d2620cc0324e952ccf40ea6f2ca9ba553712b47b",+ "bytes": 18693,+ "sha256": "d2b54a3cc6dfe85b9374f75925811427beb8efc45f87354deaabcd8d93314c92","tools": ["tool_result_read","list_room_targets",@@ -542,8 +542,8 @@]},"default+no-computer-pick": {- "bytes": 16565,- "sha256": "d437560538acadddd9bdae63cc2fc842ca5bd39523362c556930e3512e17f075",+ "bytes": 16581,+ "sha256": "493574b97410b83c3e1d4510ea223d778c9bd83ca5cd86236e525cfdfa99a18d","tools": ["tool_result_read","list_room_targets",@@ -563,8 +563,8 @@]},"default+room": {- "bytes": 16528,- "sha256": "2fe8086909148342568535fd87c625090162bbcc14632139ccec5d36b28ad112",+ "bytes": 16544,+ "sha256": "721b7957eac1bedb8fb47df165aeacdd64d7806543e5184467604fbe3b515677","tools": ["tool_result_read","list_room_targets",@@ -584,8 +584,8 @@]},"non-chief+room": {- "bytes": 16411,- "sha256": "d859f830a67ad59c0bc06d6dd1c0beec524a5775d6cf6fa84f0eddc71425b76d",+ "bytes": 16427,+ "sha256": "0ba72ea2e0b5176ad71e7bb8e33e46f2de7cccf3b7ef27dec5760d837ad58d8d","tools": ["tool_result_read","list_room_targets",@@ -605,8 +605,8 @@]},"default+images": {- "bytes": 17793,- "sha256": "928c1effa91e398c4af05fb5ffd9e7ba0149ee13d5b09c07cacfb0f16cfe8e40",+ "bytes": 17809,+ "sha256": "4e1ca71f00ea59fa6c7cea8143ca2338e88e8e835a2594d19b0d30f8e60d2908","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-catalog-goldens/bridged.tools-list.json b/server/drivers/agents-catalog-goldens/bridged.tools-list.jsonindex 809c3f0f19..fcab9dc49e 100644--- a/server/drivers/agents-catalog-goldens/bridged.tools-list.json+++ b/server/drivers/agents-catalog-goldens/bridged.tools-list.json@@ -266,6 +266,7 @@"cerebrasApiKey","groqApiKey","greenferenceApiKey",+ "modelgoApiKey","metaApiKey","deepseekApiKey","email"diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.jsonindex b083d97863..ac66cf3a0c 100644--- a/server/drivers/agents-catalog-goldens/full.tools-list.json+++ b/server/drivers/agents-catalog-goldens/full.tools-list.json@@ -853,6 +853,7 @@"cerebrasApiKey","groqApiKey","greenferenceApiKey",+ "modelgoApiKey","metaApiKey","deepseekApiKey","email"diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex 3d7b25c7af..84f058ea9e 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 60593,- "sha256": "55ced026331f1b75fbbba42600c9265a5c361283d556cdf1e90b6c15b63f7344",+ "bytes": 60609,+ "sha256": "4b2b51fb15d4a22a42e51fc4003c28168dd04c674c35aabb4d3c78e8fb2bb49f","tools": ["tool_result_read","list_room_targets",@@ -52,8 +52,8 @@]},"voice": {- "bytes": 61374,- "sha256": "90a6960ff21502a97074b7765e5a8ed5ae46bd40e2cdcc5503eb14528b68d47c",+ "bytes": 61390,+ "sha256": "a0703fc59b9cbbe42cdca2311f8d5aeb665e7fdd85d3a1c9c8285464735dcf31","tools": ["tool_result_read","list_room_targets",@@ -105,8 +105,8 @@]},"shared": {- "bytes": 62858,- "sha256": "d68681e4be4574fc2af5ceff9b1d72589fef027bd14b1fe216410bd2ba5df437",+ "bytes": 62874,+ "sha256": "32c2e618b9c8c7d3b6fd5ae740d500cec6813b48866be20bfb241eee7d473810","tools": ["tool_result_read","list_shared_computers",@@ -159,8 +159,8 @@]},"shared+voice": {- "bytes": 63639,- "sha256": "7a7e5c55a97f9a3484e7aa452e72f0592f4c19118b78b35546a9d9ccdfd2fc24",+ "bytes": 63655,+ "sha256": "078b8072bcbd45ce7ad1fa9f5faaa13d81779bed6deef4da94c2de7b6b4318ad","tools": ["tool_result_read","list_shared_computers",@@ -214,8 +214,8 @@]},"skills": {- "bytes": 63669,- "sha256": "08223f4f821765723e1412911d22c3b6d8c8a3fb77480064d6a2f9297cba971f",+ "bytes": 63685,+ "sha256": "49f5fa45d796e0535d0ca02882b7be4f779f5cda1de2eaf19970be056f18550e","tools": ["tool_result_read","list_room_targets",@@ -268,8 +268,8 @@]},"skills+voice": {- "bytes": 64450,- "sha256": "b0bdc6325a9fdcb9fa1c968f4be7f0df41ff125dfc770cf9f7511f1f7eb34391",+ "bytes": 64466,+ "sha256": "571f5f69090e2bc3248c81825ea16e9a65844ab6a9a68c050bffa9300a7de88c","tools": ["tool_result_read","list_room_targets",@@ -323,8 +323,8 @@]},"skills+shared": {- "bytes": 65934,- "sha256": "61c4c69356ddb97c25cbd3a4ee4386122c7519b2152d824a9a3b4cd5b7196b25",+ "bytes": 65950,+ "sha256": "43501a7173cf3f7365dc157400d714cee470fa67930b638284b21884225f87d7","tools": ["tool_result_read","list_shared_computers",@@ -379,8 +379,8 @@]},"skills+shared+voice": {- "bytes": 66715,- "sha256": "d6f458d442a4e513312fe886a17a5d9c12871141cdc5afc66ff989e16aaa02e8",+ "bytes": 66731,+ "sha256": "1655cccef029bf29765205915d3e5b8e9590b19947c851e6d7981a10cc81145b","tools": ["tool_result_read","list_shared_computers",@@ -436,8 +436,8 @@]},"non-chief": {- "bytes": 51377,- "sha256": "5f56e88a0db5823f72dd6fb760b83f7a7ee42a5bace969c3475a1f54ee97365a",+ "bytes": 51393,+ "sha256": "35071c47455ac048ddb6042a6c063329c632c8a40fad1564601c1dbf6944f352","tools": ["tool_result_read","list_room_targets",@@ -481,8 +481,8 @@]},"voice+non-chief": {- "bytes": 52158,- "sha256": "a7cd287606e0e420bb7b6773de9ee94e397b4b8e5948e57a3052c2bcd82779df",+ "bytes": 52174,+ "sha256": "bddca52650f5f5b1c59760eda0e74485e8d17d8f14030c7235a69bc9bf445ad6","tools": ["tool_result_read","list_room_targets",@@ -527,8 +527,8 @@]},"shared+non-chief": {- "bytes": 53642,- "sha256": "6b8904c38bf76abe4298abb4ae78fe72f1da9f7bb3e0f91019bfec6d195674cf",+ "bytes": 53658,+ "sha256": "d70e621bb4550eadc7b73c4efd266d9361df30a07a6f5f7c234367c711a8514a","tools": ["tool_result_read","list_shared_computers",@@ -574,8 +574,8 @@]},"shared+voice+non-chief": {- "bytes": 54423,- "sha256": "ce5c212734e8454b9a71c108120faf87b3d5f1b8d5495142b58c1801db2f54be",+ "bytes": 54439,+ "sha256": "53b95d3f5f6838e979d82d38b28deba48ec0adde840ce10095455efc1b9e005e","tools": ["tool_result_read","list_shared_computers",@@ -622,8 +622,8 @@]},"skills+non-chief": {- "bytes": 54453,- "sha256": "c7e062952246a0c2bc4f6760ee557aeb9e108fb55b818c8d041dd61ad37740cb",+ "bytes": 54469,+ "sha256": "49e9a309601075c47a181fc3716303d78786a0efd2a35c06c23048134a6a4854","tools": ["tool_result_read","list_room_targets",@@ -669,8 +669,8 @@]},"skills+voice+non-chief": {- "bytes": 55234,- "sha256": "60d47c6e43b5c6c001058e2d205cbfd732f2528768e5511aced8f88c514ec174",+ "bytes": 55250,+ "sha256": "a7153f1014a5329669ecd6e60a0169de8cb18c7b4f78d0654b8393cf1968d9fa","tools": ["tool_result_read","list_room_targets",@@ -717,8 +717,8 @@]},"skills+shared+non-chief": {- "bytes": 56718,- "sha256": "313d0c5da1c27d6235c390149a724d6b7b34e86ab910c284e6a49b0c6771336e",+ "bytes": 56734,+ "sha256": "c3c6f42c5b3f2d15a15d92557c3a9fdfb89096a5992dd71b8399b507fe7d3ffb","tools": ["tool_result_read","list_shared_computers",@@ -766,8 +766,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 57499,- "sha256": "73c3979e2b9ae64255cda1dbb059bc1d2b9a14b663f37c0adeb0b5fa81b68ba5",+ "bytes": 57515,+ "sha256": "ef8365f5ed2c690af6c588ecdc42cdff34599286ccc385b152e1ac05ac668924","tools": ["tool_result_read","list_shared_computers",@@ -816,8 +816,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 66481,- "sha256": "20a0f7c84bac83382bbdbd1bbd8dd7df7ad172ff4247c89943df640bfbb53217",+ "bytes": 66497,+ "sha256": "8adf03fe1b9055e495b24007db134d8326198aadbce2e4df1d96326d52dfc935","tools": ["tool_result_read","list_shared_computers",@@ -873,8 +873,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 57265,- "sha256": "76c23c7b2cd5b3e01850f594e5eefe6565028b68c356cb9f035762cfe15a744b",+ "bytes": 57281,+ "sha256": "97ae634975ff915b7bca07545886e713bb8d38499aef96f472555557fdf8f13e","tools": ["tool_result_read","list_shared_computers",@@ -923,8 +923,8 @@]},"skills+shared+voice+x": {- "bytes": 70554,- "sha256": "742d4dba241a2c8dd7d5f664f1e90aa81a13db0080388c06beb3fd12a325adf8",+ "bytes": 70570,+ "sha256": "ede3c49afdedd4d70863712738e14a43bdcf520817154f9881bae80a240eabae","tools": ["tool_result_read","list_shared_computers",@@ -984,8 +984,8 @@]},"skills+shared+voice+x+team": {- "bytes": 70554,- "sha256": "742d4dba241a2c8dd7d5f664f1e90aa81a13db0080388c06beb3fd12a325adf8",+ "bytes": 70570,+ "sha256": "ede3c49afdedd4d70863712738e14a43bdcf520817154f9881bae80a240eabae","tools": ["tool_result_read","list_shared_computers",@@ -1045,8 +1045,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 71327,- "sha256": "4dfa65619fec848ba1ed91d10105e6ef69f2c4f06c2747d8f6fad27551933748",+ "bytes": 71343,+ "sha256": "07a111d580f3d8588142aa8567590c88a6d63ebe1c0d24e226d9a614a23dad86","tools": ["tool_result_read","list_shared_computers",@@ -1107,8 +1107,8 @@]},"default+legacy-switches": {- "bytes": 60593,- "sha256": "55ced026331f1b75fbbba42600c9265a5c361283d556cdf1e90b6c15b63f7344",+ "bytes": 60609,+ "sha256": "4b2b51fb15d4a22a42e51fc4003c28168dd04c674c35aabb4d3c78e8fb2bb49f","tools": ["tool_result_read","list_room_targets",@@ -1159,8 +1159,8 @@]},"default+mausbot": {- "bytes": 61244,- "sha256": "a0a415783fb518c1d700b3e18c06a8669e875890eec442d7d24261f175ede714",+ "bytes": 61260,+ "sha256": "94daf6301ac0d6e40f604f90054bb9377f9b31d9a6e74a72269f761ce4ec5c3f","tools": ["tool_result_read","list_room_targets",@@ -1213,8 +1213,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 67366,- "sha256": "975adc0f77ca1ca1678b5986a10132e2d34b46e998ad1fd9be6d5cf6cd1f38a6",+ "bytes": 67382,+ "sha256": "72226dde26f0c0f0da89a59449e1df3f635ffa8a8f1836c5b7a40e1ca21cefc4","tools": ["tool_result_read","list_shared_computers",@@ -1272,8 +1272,8 @@]},"default+no-computer-pick": {- "bytes": 59381,- "sha256": "f5760141459eaf5a8b1464b829825411fb0e2d915ae3bb4a6e69e56dc06cd129",+ "bytes": 59397,+ "sha256": "915314e987e38e7ad24070e1fbcc24408708e5ba9327f3663b5f0a8207a10960","tools": ["tool_result_read","list_room_targets",@@ -1323,8 +1323,8 @@]},"default+room": {- "bytes": 57737,- "sha256": "90f5ea3d1da4d17158f347cbbbc2a115a20aacf4057d25b861580a53b51202fa",+ "bytes": 57753,+ "sha256": "9b8a52de8377f462fc211297f097d65263360d48b4a8c48dbb73dcd936ed590b","tools": ["tool_result_read","list_room_targets",@@ -1371,8 +1371,8 @@]},"non-chief+room": {- "bytes": 48521,- "sha256": "80ae2fc40f3f9ecda1804e5d38429c06bae829a9e3b86ea277b1651cc13930e5",+ "bytes": 48537,+ "sha256": "95365bf65a23a4809ea8475ae9eec262c4ab09fa4d7014f00d4fbbe466f2fe5b","tools": ["tool_result_read","list_room_targets",@@ -1412,8 +1412,8 @@]},"default+images": {- "bytes": 61366,- "sha256": "b0dcf42f3de84a34921166cfad05bce2d5321c3875908ab82b15986629954594",+ "bytes": 61382,+ "sha256": "871889c6b92a2a36e45c79c1b8f987033fb6f8122e013481e80f0920224d46a1","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/builtIn.ts b/server/drivers/builtIn.tsindex a2a3e5c4ac..808f2349eb 100644--- a/server/drivers/builtIn.ts+++ b/server/drivers/builtIn.ts@@ -23,6 +23,7 @@ import { MistralDriver } from "./mistral.ts";import { CerebrasDriver } from "./cerebras.ts";import { GroqDriver } from "./groq.ts";import { GreenferenceDriver } from "./greenference.ts";+import { ModelgoDriver } from "./modelgo.ts";import { MetaDriver } from "./meta.ts";import { MuseCodeDriver } from "./muse-code.ts";import { MinimaxDriver } from "./minimax.ts";@@ -52,6 +53,7 @@ export const BUILT_IN_DRIVERS: readonly AnyProviderDriver[] = [CerebrasDriver,GroqDriver,GreenferenceDriver,+ ModelgoDriver,MetaDriver,MuseCodeDriver,DeepSeekAgentDriver,diff --git a/server/drivers/modelgo.test.ts b/server/drivers/modelgo.test.tsnew file mode 100644index 0000000000..7a8a2446f1--- /dev/null+++ b/server/drivers/modelgo.test.ts@@ -0,0 +1,255 @@+import { createServer, type Server, type ServerResponse } from "node:http";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { MODELGO_URL } from "../../shared/modelgo.ts";+import type { ProviderInstance } from "../contracts.ts";+import { recordEvents } from "../testing/events.ts";+import { classifyError } from "./retry.ts";+import { ModelgoDriver } from "./modelgo.ts";++type ChatBody = { model: string; messages: Array<Record<string, unknown>>; tools?: unknown[]; stream?: boolean };+const fixtureKey = `modelgo-fixture-${"a".repeat(40)}`;+const stream = (res: ServerResponse, chunks: unknown[]) => {+ res.writeHead(200, { "content-type": "text/event-stream" });+ res.end(`: gateway comment\n\n${chunks.map(chunk => `data: ${JSON.stringify(chunk)}\n\n`).join("")}data: [DONE]\n\n`);+};+const refuse = (status: number, code: string, field: "error_class" | "reason" = "error_class") => (_body: ChatBody, res: ServerResponse) => {+ res.writeHead(status, { "content-type": "application/json" });+ res.end(JSON.stringify({ error: { message: "Refused by the gateway.", type: "invalid_request_error", code: status, metadata: { [field]: code, request_id: "r1" } }, trace_id: "t1" }));+};++describe("ModelGo provider", () => {+ let server: Server;+ let base: string;+ let models: unknown;+ let reply: (body: ChatBody, res: ServerResponse) => void;+ let requests: Array<{ path: string; authorization?: string; body?: ChatBody }>;+ let instances: ProviderInstance[];++ beforeEach(async () => {+ vi.stubEnv("MODELGO_API_KEY", "");+ requests = [];+ instances = [];+ models = { object: "list", data: [{ id: "fixture-tool-model", output_modalities: ["text"] }] };+ reply = (_body, res) => stream(res, [{ choices: [{ delta: { content: "Hello." }, finish_reason: "stop" }] }]);+ server = createServer(async (req, res) => {+ const request = { path: req.url ?? "", authorization: req.headers.authorization, body: undefined as ChatBody | undefined };+ requests.push(request);+ if (request.path.endsWith("/models")) {+ res.writeHead(200, { "content-type": "application/json" });+ res.end(JSON.stringify(models));+ return;+ }+ let text = "";+ for await (const chunk of req) text += chunk;+ request.body = JSON.parse(text) as ChatBody;+ reply(request.body, res);+ });+ await new Promise<void>(resolve => server.listen(0, "127.0.0.1", resolve));+ const address = server.address();+ if (!address || typeof address === "string") throw new Error("fixture provider address missing");+ base = `http://127.0.0.1:${address.port}/v1`;+ });++ afterEach(async () => {+ await Promise.all(instances.map(instance => instance.dispose()));+ server.closeAllConnections();+ await new Promise<void>(resolve => server.close(() => resolve()));+ vi.unstubAllEnvs();+ });++ const create = async (config = {}, environment: Record<string, string> = { MODELGO_API_KEY: fixtureKey }) => {+ const instance = await ModelgoDriver.create({ instanceId: "modelgo-fixture", displayName: "ModelGo", enabled: true,+ config: ModelgoDriver.decodeConfig(config), environment });+ instances.push(instance);+ return instance;+ };++ it("presets ModelGo's endpoint and its tracked docs link, rejects unsafe configuration and never sends an unkeyed turn", async () => {+ expect(ModelgoDriver.defaultConfig().url).toBe("https://api.modelgo.ai/v1");+ expect(ModelgoDriver.install?.docsUrl).toBe(MODELGO_URL);+ expect(() => ModelgoDriver.decodeConfig({ url: "http://provider.example.test/v1" })).toThrow("HTTPS");+ const instance = await create({ url: base }, { MODELGO_API_KEY: "" });+ const recorder = recordEvents(instance.adapter);+ try {+ expect(await instance.snapshot()).toMatchObject({ state: "unavailable", reason: expect.stringContaining("ModelGo API key") });+ await expect(instance.adapter.sendTurn({ threadId: "missing", text: "Hello" })).rejects.toThrow("ModelGo API key");+ expect(requests).toHaveLength(0);+ } finally { recorder.stop(); }+ });++ it("has no built-in model ids: the list is only what the key's GET /models returns", () => {+ expect(ModelgoDriver.models).toEqual({ default: "", options: [] });+ });++ it("does not send the server's ModelGo key to a custom instance host", async () => {+ vi.stubEnv("MODELGO_API_KEY", fixtureKey);+ const instance = await create({ url: base }, {});+ await instance.refreshModels?.();+ expect(await instance.snapshot()).toMatchObject({ state: "unavailable" });+ expect(requests).toHaveLength(0);+ });++ it("does send the server's ModelGo key to ModelGo's own host", async () => {+ vi.stubEnv("MODELGO_API_KEY", fixtureKey);+ const sent: Array<{ url: string; authorization: string | null }> = [];+ vi.stubGlobal("fetch", vi.fn(async (url: string | URL, init?: RequestInit) => {+ sent.push({ url: String(url), authorization: new Headers(init?.headers).get("authorization") });+ return Response.json({ data: [{ id: "fixture-tool-model", output_modalities: ["text"] }] });+ }));+ try {+ await create({}, {});+ expect(sent).toEqual([{ url: "https://api.modelgo.ai/v1/models", authorization: `Bearer ${fixtureKey}` }]);+ } finally { vi.unstubAllGlobals(); }+ });++ it("lists the key's live text models with their context windows, leaves out image, video and speech models, and keeps the last list after a bad refresh", async () => {+ models = { object: "list", data: [+ { id: "fixture-b", object: "model", created: 1, context_length: 262144, max_request_bytes: 1048576, input_modalities: ["text"], output_modalities: ["text"] },+ { id: "fixture-a", output_modalities: ["text"] },+ { id: "fixture-vision", input_modalities: ["text", "image"], output_modalities: ["text"] },+ { id: "fixture-painter", input_modalities: ["text"], output_modalities: ["image"] },+ { id: "fixture-film", output_modalities: ["video"] },+ { id: "fixture-voice", output_modalities: ["audio"] },+ { id: "fixture-unknown" },+ { id: "fixture-a", output_modalities: ["text"] },+ null, { id: " ", output_modalities: ["text"] },+ ] };+ const instance = await create({ url: base });+ await instance.refreshModels?.();+ expect(instance.models).toEqual({ default: "fixture-b", options: [+ { id: "fixture-b", label: "fixture-b", contextWindow: 262144 },+ { id: "fixture-a", label: "fixture-a" },+ { id: "fixture-vision", label: "fixture-vision" },+ ] });+ expect(requests.every(request => request.path === "/v1/models" && request.authorization === `Bearer ${fixtureKey}`)).toBe(true);+ const previous = instance.models;+ for (const malformed of [null, { data: "wrong" }, { data: [] }, { data: [{ id: "fixture-painter", output_modalities: ["image"] }] }]) {+ models = malformed;+ await instance.refreshModels?.();+ expect(instance.models).toEqual(previous);+ }+ });++ it("says plainly when the key lists no models", async () => {+ models = { data: [] };+ const instance = await create({ url: base });+ expect(await instance.snapshot()).toMatchObject({ state: "unavailable", reason: expect.stringContaining("listed no models") });+ });++ it("streams over /chat/completions with the key, tools, reasoning and the usage frame that has no choices", async () => {+ reply = (_body, res) => stream(res, [+ { choices: [{ delta: { reasoning_content: "Thinking." } }] },+ { choices: [{ delta: { content: "Hello." }, finish_reason: "stop" }] },+ { choices: [], usage: { prompt_tokens: 14, completion_tokens: 4 } },+ ]);+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "stream", text: "Hello", model: "fixture-tool-model" });+ expect(await recorder.until(event => event.type === "turn.completed")).toMatchObject({ ok: true, usage: { input: 14, output: 4 } });+ expect(recorder.events.some(event => event.type === "content.delta" && event.streamKind === "reasoning_text" && event.delta === "Thinking.")).toBe(true);+ expect(recorder.events.some(event => event.type === "content.delta" && event.streamKind === "assistant_text" && event.delta === "Hello.")).toBe(true);+ expect(instance.adapter.provider).toBe("modelgo");+ const request = requests.find(request => request.path === "/v1/chat/completions")!;+ expect(request.authorization).toBe(`Bearer ${fixtureKey}`);+ expect(request.body).toMatchObject({ model: "fixture-tool-model", stream: true, tools: expect.any(Array) });+ } finally { recorder.stop(); }+ });++ it("runs a tool call round trip: tool_calls parsed from the stream, a role:tool result sent back on the next request", async () => {+ let round = 0;+ reply = (_body, res) => {+ round += 1;+ stream(res, round === 1+ ? [{ choices: [{ index: 0, delta: { tool_calls: [{ index: 0, id: "call-1", type: "function", function: { name: "fixture_missing_tool", arguments: "{}" } }] } }] },+ { choices: [{ index: 0, delta: {}, finish_reason: "tool_calls" }] }]+ : [{ choices: [{ index: 0, delta: { content: "Done." }, finish_reason: "stop" }] }]);+ };+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "tools", text: "Use the tool", model: "fixture-tool-model", approvalMode: "full" });+ await recorder.until(event => event.type === "turn.completed");+ const calls = requests.filter(request => request.path === "/v1/chat/completions");+ expect(calls).toHaveLength(2);+ expect(calls[1]!.body!.messages.some(message => message.role === "assistant" && Array.isArray(message.tool_calls))).toBe(true);+ expect(calls[1]!.body!.messages.some(message => message.role === "tool" && message.tool_call_id === "call-1")).toBe(true);+ } finally { recorder.stop(); }+ });++ const toolDeltas = [{ choices: [{ index: 0, delta: { tool_calls: [{ index: 0, id: "call-1", type: "function", function: { name: "fixture_missing_tool", arguments: "{}" } }] } }] }];+ const toolTurn = async (first: unknown[]) => {+ let round = 0;+ reply = (_body, res) => { round += 1; stream(res, round === 1 ? first : [{ choices: [{ index: 0, delta: { content: "Done." }, finish_reason: "stop" }] }]); };+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "tools", text: "Use the tool", model: "fixture-tool-model", approvalMode: "full" });+ await recorder.until(event => event.type === "turn.completed");+ return { calls: requests.filter(request => request.path === "/v1/chat/completions"), events: recorder.events };+ } finally { recorder.stop(); }+ };++ it("runs tool calls from their deltas when the stream ends with finish_reason stop, as gemini-3.6-flash does", async () => {+ const { calls } = await toolTurn([...toolDeltas, { choices: [{ index: 0, delta: {}, finish_reason: "stop" }] }]);+ expect(calls).toHaveLength(2);+ expect(calls[1]!.body!.messages.some(message => message.role === "tool" && message.tool_call_id === "call-1")).toBe(true);+ });++ it.each(["reasoning_content", "reasoning"])("keeps a tool call that follows %s deltas", async (field) => {+ const { calls, events } = await toolTurn([+ { choices: [{ index: 0, delta: { [field]: "Thinking one." } }] },+ { choices: [{ index: 0, delta: { [field]: " Thinking two." } }] },+ ...toolDeltas,+ { choices: [{ index: 0, delta: {}, finish_reason: "stop" }] },+ { choices: [], usage: { prompt_tokens: 14, completion_tokens: 4 } },+ ]);+ expect(events.filter(event => event.type === "content.delta" && event.streamKind === "reasoning_text").map(event => (event as { delta: string }).delta)).toEqual(["Thinking one.", " Thinking two."]);+ expect(calls).toHaveLength(2);+ expect(calls[1]!.body!.messages.some(message => message.role === "tool" && message.tool_call_id === "call-1")).toBe(true);+ });++ it.each([+ ["an empty balance", 402, "billing_insufficient", "error_class" as const, "balance has run out", "quota"],+ ["a first top-up", 403, "first_recharge_required", "reason" as const, "free models need a first top-up", "unknown"],+ ])("says %s in a plain sentence, wherever the code sits, and never marks the key as rejected", async (_name, status, code, field, words, reason) => {+ reply = refuse(status, code, field);+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "refused", text: "Hello", model: "fixture-tool-model" });+ await recorder.until(event => event.type === "turn.completed");+ const error = recorder.events.find(event => event.type === "runtime.error") as { message: string } | undefined;+ expect(error?.message).toContain(words);+ expect(error?.message).not.toMatch(/HTTP \d{3}|billing_insufficient|first_recharge_required|\{/);+ expect(classifyError(new Error(error!.message))).toEqual({ transient: false, reason });+ expect(await instance.snapshot()).toMatchObject({ state: "available", authenticated: true });+ } finally { recorder.stop(); }+ });++ it("leaves other 402s and 403s to the shared wording", async () => {+ reply = refuse(403, "policy");+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "policy", text: "Hello", model: "fixture-tool-model" });+ await recorder.until(event => event.type === "turn.completed");+ expect((recorder.events.find(event => event.type === "runtime.error") as { message: string }).message).toMatch(/^ModelGo HTTP 403/);+ } finally { recorder.stop(); }+ });++ it("reports a rejected key without exposing it in canonical errors", async () => {+ reply = (_body, res) => {+ res.writeHead(401, { "content-type": "application/json" });+ res.end(JSON.stringify({ error: { code: 401, message: `invalid or expired token ${fixtureKey}` } }));+ };+ const instance = await create({ url: base });+ const recorder = recordEvents(instance.adapter);+ try {+ await instance.adapter.sendTurn({ threadId: "rejected", text: "Hello", model: "fixture-tool-model" });+ expect(await recorder.until(event => event.type === "turn.completed")).toMatchObject({ ok: false });+ expect(JSON.stringify(recorder.events)).not.toContain(fixtureKey);+ expect(await instance.snapshot()).toMatchObject({ authenticated: false });+ } finally { recorder.stop(); }+ });+});diff --git a/server/drivers/modelgo.ts b/server/drivers/modelgo.tsnew file mode 100644index 0000000000..a2fed5e5d8--- /dev/null+++ b/server/drivers/modelgo.ts@@ -0,0 +1,123 @@+import { z } from "zod";+import { MODELGO_URL } from "../../shared/modelgo.ts";+import type { ModelCatalog, ProviderDriver } from "../contracts.ts";+import { createOpenAIChatRuntime } from "./openai-chat.ts";++// POST /v1/chat/completions with a Bearer key, tools and tool_choice in the OpenAI shape, SSE ending in [DONE] with a usage+// frame whose `choices` is empty: https://modelgo.ai/docs/models/text/chat-completions and+// /docs/models/text/model-protocol-parameters, read 2026-11-10.+const DEFAULT_URL = "https://api.modelgo.ai/v1";+// No built-in models: the public catalog (https://modelgo.ai/models) showed no model data when read on 2026-11-10, and every+// id must come from it or from GET /models. Until a key is saved the list is empty.+const NO_MODELS: ModelCatalog = { default: "", options: [] };+const configSchema = z.object({+ url: z.string().trim().url().default(DEFAULT_URL),+ model: z.string().trim().min(1).optional(),+ tools: z.boolean().optional(),+});+type ModelgoConfig = z.output<typeof configSchema>;++function decodeConfig(raw: unknown): ModelgoConfig {+ const config = configSchema.parse(raw ?? {});+ config.url = config.url.replace(/\/+$/, "");+ const url = new URL(config.url);+ if (url.protocol !== "https:" && !(url.protocol === "http:" &&+ ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname))) {+ throw new Error("ModelGo requires HTTPS, except for a local test endpoint.");+ }+ return config;+}++// GET /models, measured 2026-11-10: rows carry id, context_length, input_modalities and output_modalities, with no field for+// tool support, and the list mixes in image, video and speech models.+const modelCard = z.object({+ id: z.string().trim().min(1),+ context_length: z.number().int().positive().optional(),+ input_modalities: z.array(z.string()).optional(),+ output_modalities: z.array(z.string()).optional(),+});+type ModelCard = z.output<typeof modelCard>;++const writesText = (model: ModelCard) => model.output_modalities?.includes("text") === true;++// ModelGo's documented refusals (https://modelgo.ai/docs/quickstart/errors, read 2026-11-10): the code may sit in error.code,+// error.type or error.metadata, so the whole body is searched. "billing" keeps a 402 classified as a quota failure.+const REFUSALS = [+ { status: 402, code: "billing_insufficient", sentence: "Your ModelGo balance has run out, so billing stopped this request. Top up in the ModelGo console, then run it again." },+ { status: 403, code: "first_recharge_required", sentence: "ModelGo's free models need a first top-up on your account. Top up in the ModelGo console, then run it again." },+] as const;+const plainRefusal = (status: number, body: string) =>+ REFUSALS.find((refusal) => refusal.status === status && body.includes(refusal.code))?.sentence;++export const ModelgoDriver: ProviderDriver<ModelgoConfig> = {+ driverKind: "modelgo",+ metadata: { displayName: "ModelGo (API)", supportsMultipleInstances: true, access: "api" },+ models: NO_MODELS,+ install: {+ docsUrl: MODELGO_URL,+ settings: "connections",+ signInCommand: "Save a ModelGo API key in Settings → API keys, or set MODELGO_API_KEY on the server.",+ },+ decodeConfig,+ defaultConfig: () => decodeConfig({}),+ async create(input) {+ const { config } = input;+ // A custom host must bring its own credential; the workspace key goes only to ModelGo.+ const apiKey = (input.environment.MODELGO_API_KEY ??+ (config.url === DEFAULT_URL ? process.env.MODELGO_API_KEY : undefined) ?? "").trim();+ const withConfiguredModel = (options: ModelCatalog["options"]): ModelCatalog => {+ if (config.model && !options.some((option) => option.id === config.model)) {+ options = [{ id: config.model, label: config.model }, ...options];+ }+ return { default: config.model ?? options[0]?.id ?? "", options };+ };+ let catalog = withConfiguredModel(NO_MODELS.options);+ let imageModels = new Set<string>();+ const refreshModels = async () => {+ if (!apiKey) return;+ try {+ const response = await fetch(`${config.url}/models`, {+ headers: { authorization: `Bearer ${apiKey}` }, redirect: "error",+ signal: AbortSignal.timeout(8_000),+ });+ if (!response.ok) return;+ const rows = z.object({ data: z.array(z.unknown()) }).parse(await response.json()).data;+ const options: ModelCatalog["options"] = [];+ const images = new Set<string>();+ for (const row of rows) {+ const parsed = modelCard.safeParse(row);+ if (!parsed.success || !writesText(parsed.data) || options.some((option) => option.id === parsed.data.id)) continue;+ const model = parsed.data;+ options.push({ id: model.id, label: model.id, ...(model.context_length ? { contextWindow: model.context_length } : {}) });+ if (model.input_modalities?.includes("image")) images.add(model.id);+ }+ if (options.length) {+ catalog = withConfiguredModel(options);+ imageModels = images;+ }+ } catch {}+ };+ const firstRefresh = refreshModels();+ return createOpenAIChatRuntime({+ input, driverKind: "modelgo", apiKey, apiUrl: config.url,+ tools: config.tools, models: () => catalog, refreshModels, reasoning: true,+ computerUse: true, imageInput: (model) => imageModels.has(model),+ nudgeAnnouncedAction: true,+ requestBody: (model, messages, stream) => ({ model, messages, stream }),+ httpErrorLabel: "ModelGo",+ plainRefusal,+ missingKeyError: "Save a ModelGo API key in Settings → API keys, or set MODELGO_API_KEY.",+ unavailableReason: "No ModelGo API key — open Settings → API keys.",+ serverUnavailable: async () => {+ await firstRefresh;+ return apiKey && !catalog.options.length ? "ModelGo listed no models for this key. Check the key in the ModelGo console, then check again." : null;+ },+ timeoutMs: 180_000, billing: "metered", includeUsageInCompleted: true,+ nativeLog: {+ source: "modelgo.chat.completions",+ outgoing: (_turn, messages, model) => ({ model, messageCount: messages.length }),+ incoming: ({ text, reasoning, usage }) => ({ textLength: text.length, reasoningLength: reasoning.length, usage }),+ },+ });+ },+};diff --git a/server/drivers/openai-chat.ts b/server/drivers/openai-chat.tsindex 7f831c4889..569ef203a5 100644--- a/server/drivers/openai-chat.ts+++ b/server/drivers/openai-chat.ts@@ -94,6 +94,8 @@ interface RuntimeOptions<Config> {models: () => ModelCatalog;requestBody(model: string, messages: OpenAIChatMessage[], stream: boolean): Record<string, unknown>;httpErrorLabel: string;+ /** A refusal this provider words itself: the sentence the person sees instead of the HTTP line, or undefined. */+ plainRefusal?: (status: number, body: string) => string | undefined;missingKeyError: string;unavailableReason: string;timeoutMs: number;@@ -295,6 +297,7 @@ export function createOpenAIChatRuntime<Config>(options: RuntimeOptions<Config>)signal: activeSignal,});const failure = (status: number, body: string): Error => {+ const plain = options.plainRefusal?.(status, body); if (plain) return new Error(plain);const message = `${options.httpErrorLabel} HTTP ${status}${body ? `: ${httpErrorDetail(body)}` : ""}`;const refused = tools.length ? routeRefusal(route, status, body) : null;if (refused) return new ModelRouteRefused(refused, message);diff --git a/server/headless/engine.test.ts b/server/headless/engine.test.tsindex b8753d03fc..87b9783aea 100644--- a/server/headless/engine.test.ts+++ b/server/headless/engine.test.ts@@ -142,7 +142,7 @@ describe("engine list", () => {it("shows each engine and which keys are set, never their values", async () => {const w = workspace({ configured: { anthropic: true }, available: ["claude"] });const listed = await w.run(["engine", "list", "--json"]);- expect(JSON.parse(listed.out).keys).toEqual({ claude: true, openai: false, openrouter: false, "openai-compatible": false, xai: false, groq: false, greenference: false, mistral: false, cerebras: false });+ expect(JSON.parse(listed.out).keys).toEqual({ claude: true, openai: false, openrouter: false, "openai-compatible": false, xai: false, groq: false, greenference: false, modelgo: false, mistral: false, cerebras: false });const human = await w.run(["engine", "list"]);expect(human.out).toContain("claude · claudeAgent · available");expect(human.out).toContain("Keys set: claude");diff --git a/server/headless/engine.ts b/server/headless/engine.tsindex a4d3f7761e..2239df2436 100644--- a/server/headless/engine.ts+++ b/server/headless/engine.ts@@ -15,6 +15,7 @@ export const ENGINE_KINDS: Record<string, { config: string; instance: string; apxai: { config: "xai", instance: "xaiApi", baseUrl: "allowed" },groq: { config: "groq", instance: "groq", baseUrl: "allowed" },greenference: { config: "greenference", instance: "greenference", baseUrl: "no" },+ modelgo: { config: "modelgo", instance: "modelgo", baseUrl: "no" },mistral: { config: "mistral", instance: "mistral", baseUrl: "no" },cerebras: { config: "cerebras", instance: "cerebras", baseUrl: "no" },};diff --git a/server/headless/main.ts b/server/headless/main.tsindex 30d406a0e7..50b9a089cb 100644--- a/server/headless/main.ts+++ b/server/headless/main.ts@@ -74,7 +74,7 @@ openmausbot doctor --host [--data-dir DIR] [--port 8799] [--domain HOST]"team export": "openmausbot team export [--team NAME]… --out FILE\n Write the workspace (or some teams) as a team file; skills go beside it, keys as placeholders,\n and a key written into a soul, brief or skill is taken out.",engine: "openmausbot engine set KIND … | engine list (see help engine set)","engine set": `openmausbot engine set KIND (--key-env VAR | --key-file FILE) [--base-url URL] [--only-claude-api] [--install] [--rotate] [--dry-run]- Give the workspace an engine key: claude, openai, openrouter, openai-compatible, xai, groq, greenference, mistral or cerebras.+ Give the workspace an engine key: claude, openai, openrouter, openai-compatible, xai, groq, greenference, modelgo, mistral or cerebras.The key is never printed. One already set is kept unless --rotate. --install installs the engine'scommand if it is not running already, so a script can run this on every start.claude: the key runs every Claude bot; --only-claude-api keeps it to "Claude (API key)" bots.`,diff --git a/server/headless/team-file.ts b/server/headless/team-file.tsindex a391ef6914..049121f79b 100644--- a/server/headless/team-file.ts+++ b/server/headless/team-file.ts@@ -29,6 +29,7 @@ const enginesSchema = z.object({xai: keyOnly.optional(),groq: keyOnly.optional(),greenference: keyOnly.optional(),+ modelgo: keyOnly.optional(),mistral: keyOnly.optional(),cerebras: keyOnly.optional(),openaiCompatible: z.object({ key: secret, baseUrl: z.union([url, secret]) }).strict().optional(),@@ -115,7 +116,7 @@ export interface TeamFile {}const ENGINE_KIND: Record<string, string> = {- claude: "claude", openai: "openai", openrouter: "openrouter", xai: "xai", groq: "groq", greenference: "greenference", mistral: "mistral", cerebras: "cerebras",+ claude: "claude", openai: "openai", openrouter: "openrouter", xai: "xai", groq: "groq", greenference: "greenference", modelgo: "modelgo", mistral: "mistral", cerebras: "cerebras",openaiCompatible: "openai-compatible",};diff --git a/server/host/secret-cards.test.ts b/server/host/secret-cards.test.tsindex 9261e4d7c4..d196521c49 100644--- a/server/host/secret-cards.test.ts+++ b/server/host/secret-cards.test.ts@@ -53,6 +53,7 @@ function fixture(language?: string, linked?: (vaultStore: VaultStore) => SecretCdescribe("the card a bot asks for a key or secret with", () => {it.each([["greenferenceApiKey", "secretCard.greenference.description"],+ ["modelgoApiKey", "secretCard.modelgo.description"],["geminiTtsKey", "secretCard.geminiTts.description"],] as const)("keeps the fallback and structured description for %s", async (credentialId, baseCode) => {const { cards, lines, bot } = fixture();diff --git a/server/host/secret-cards.ts b/server/host/secret-cards.tsindex 9743b6bd22..699720d7e5 100644--- a/server/host/secret-cards.ts+++ b/server/host/secret-cards.ts@@ -553,9 +553,9 @@ export function createSecretCards(deps: SecretCardsDeps) {target: credentialId,label: target.label,description: `${reason ? `${target.description} ${reason}` : target.description} ${serverLine(language, "server.connect.secretNeverRead", { bot: from.name })}`,- ...(credentialId === "greenferenceApiKey" || credentialId === "geminiTtsKey" ? {+ ...(credentialId === "greenferenceApiKey" || credentialId === "modelgoApiKey" || credentialId === "geminiTtsKey" ? {descriptionParts: {- baseCode: credentialId === "greenferenceApiKey" ? "secretCard.greenference.description" as const : "secretCard.geminiTts.description" as const,+ baseCode: credentialId === "greenferenceApiKey" ? "secretCard.greenference.description" as const : credentialId === "modelgoApiKey" ? "secretCard.modelgo.description" as const : "secretCard.geminiTts.description" as const,reason,bot: from.name,},diff --git a/server/index.ts b/server/index.tsindex 2b18062d60..67d1f10b8a 100644--- a/server/index.ts+++ b/server/index.ts@@ -11728,7 +11728,7 @@ function configStatus() {cloudStarter: cloudPlanTier.starter(), waitingForRoom: engineMemory.waiting(), planTurns: starterCaps.status(), awakeLimit: starterAwake.limit(), pausedBots: starterAwake.paused(), xai: keyStatus(cfg.xai?.key),mistral: keyStatus(cfg.mistral?.key),cerebras: keyStatus(cfg.cerebras?.key),- groq: keyStatus(cfg.groq?.key), greenference: keyStatus(cfg.greenference?.key),+ groq: keyStatus(cfg.groq?.key), greenference: keyStatus(cfg.greenference?.key), modelgo: keyStatus(cfg.modelgo?.key),meta: keyStatus(cfg.meta?.key), deepseek: keyStatus(cfg.deepseek?.key),xResearch: xResearchStatus(), treg: keyStatus(cfg.treg?.key), postiz: { ...keyStatus(cfg.postiz?.key), ...(cfg.postiz?.url ? { url: cfg.postiz.url } : {}) },anthropic: { ...keyStatus(cfg.anthropic?.key), everyClaudeBot: cfg.anthropic?.everyClaudeBot !== false },diff --git a/server/instance-fleets.ts b/server/instance-fleets.tsindex 3cb7cb81da..e806e580fd 100644--- a/server/instance-fleets.ts+++ b/server/instance-fleets.ts@@ -42,6 +42,7 @@ export const DEFAULT_FLEET: InstanceConfigMap = {cerebras: { driver: "cerebras" },groq: { driver: "groq" },greenference: { driver: "greenference" },+ modelgo: { driver: "modelgo" },meta: { driver: "meta" },deepseek: { driver: "deepseekAgent" },museCode: { driver: "museCode" },@@ -71,6 +72,7 @@ export const PRODUCT_FLEET_ADDITIONS = {cerebras: { driver: "cerebras" },groq: { driver: "groq" },greenference: { driver: "greenference" },+ modelgo: { driver: "modelgo" },meta: { driver: "meta" },deepseek: { driver: "deepseekAgent" },museCode: { driver: "museCode" },diff --git a/server/provider-key-check.test.ts b/server/provider-key-check.test.tsindex f87c0ffd3f..c7602f4189 100644--- a/server/provider-key-check.test.ts+++ b/server/provider-key-check.test.ts@@ -168,6 +168,15 @@ describe("provider key check", () => {});// Its /models answers without a key, but a wrong key gets 401 (checked 2026-10-30), so a key's own list proves it.+ it("checks ModelGo at its preset endpoint and only there", async () => {+ const modelgo: typeof fetch = async (input, init) => {+ expect(String(input)).toBe("https://api.modelgo.ai/v1/models");+ expect(new Headers(init?.headers).get("authorization")).toBe("Bearer fixture-modelgo");+ return Response.json({ object: "list", data: [{ id: "fixture-model" }] });+ };+ expect(await checkProviderKey({ provider: "modelgo", key: "fixture-modelgo" }, modelgo)).toEqual({ ok: true, check: "models", models: ["fixture-model"] });+ });+it("checks Greenference at its preset endpoint", async () => {const greenference: typeof fetch = async (input, init) => {expect(String(input)).toBe("https://llm.eu.greenference.com/v1/models");diff --git a/server/provider-key-check.ts b/server/provider-key-check.tsindex 0cee25772f..17f77dcabf 100644--- a/server/provider-key-check.ts+++ b/server/provider-key-check.ts@@ -1,14 +1,14 @@// OpenRouter's catalog is public, so /key proves the key there; elsewhere /models proves only catalog access. Keys go only over TLS (or loopback).import { isIP } from "node:net";-export type ProviderKeyKind = "anthropic" | "openai" | "openrouter" | "openaiCompat" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "meta";+export type ProviderKeyKind = "anthropic" | "openai" | "openrouter" | "openaiCompat" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta";export type ProviderKeyVerdict =/** `freeTier`: OpenRouter's /key says the account never bought credit, so paid models refuse it. */| { ok: true; check: "authentication" | "models"; models: string[]; freeTier?: boolean }| { ok: false; reason: "rejected" | "unreachable" | "unexpected"; status?: number };-export const PROVIDER_KEY_KINDS: readonly ProviderKeyKind[] = ["anthropic", "openai", "openrouter", "openaiCompat", "xai", "mistral", "cerebras", "groq", "greenference", "meta"];+export const PROVIDER_KEY_KINDS: readonly ProviderKeyKind[] = ["anthropic", "openai", "openrouter", "openaiCompat", "xai", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta"];const DEFAULT_URLS: Record<ProviderKeyKind, string> = {anthropic: "https://api.anthropic.com",@@ -20,6 +20,7 @@ const DEFAULT_URLS: Record<ProviderKeyKind, string> = {cerebras: "https://api.cerebras.ai/v1",groq: "https://api.groq.com/openai/v1",greenference: "https://llm.eu.greenference.com/v1",+ modelgo: "https://api.modelgo.ai/v1",meta: "https://api.meta.ai/v1",};diff --git a/server/routes/config.ts b/server/routes/config.tsindex ddf69df1d0..4c24cec0d3 100644--- a/server/routes/config.ts+++ b/server/routes/config.ts@@ -126,7 +126,7 @@ export function createConfigRoutes(deps: ConfigRouteDeps): RouteHandler {}if ((method === "PUT" || method === "PATCH") && path === "/api/config") {const body = await readBody(req);- if (hostedModels && ["instances", "anthropic", "openai", "openrouter", "openaiCompat", "xai", "mistral", "cerebras", "groq", "greenference", "meta", "opencodeGo"].some(key => Object.hasOwn(body, key))) return json(res, 403, { error: HOSTED_PROVIDER_SETTINGS_ERROR });+ if (hostedModels && ["instances", "anthropic", "openai", "openrouter", "openaiCompat", "xai", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "opencodeGo"].some(key => Object.hasOwn(body, key))) return json(res, 403, { error: HOSTED_PROVIDER_SETTINGS_ERROR });const patch = parseConfigPatchForPerson(body);if (patch.profile && ownProfile) {// The address is the verified claim's; a profile names no other.@@ -547,6 +547,7 @@ export function createConfigRoutes(deps: ConfigRouteDeps): RouteHandler {if (persisted.cerebras?.key !== undefined) persisted.cerebras.key = "";if (persisted.groq?.key !== undefined) persisted.groq.key = "";if (persisted.greenference?.key !== undefined) persisted.greenference.key = "";+ if (persisted.modelgo?.key !== undefined) persisted.modelgo.key = "";if (persisted.meta?.key !== undefined) persisted.meta.key = "";if (persisted.deepseek?.key !== undefined) persisted.deepseek.key = "";if (persisted.openaiCompat?.key !== undefined) persisted.openaiCompat.key = "";diff --git a/server/routes/instances.ts b/server/routes/instances.tsindex f9fca7514e..a78b1faad6 100644--- a/server/routes/instances.ts+++ b/server/routes/instances.ts@@ -416,8 +416,8 @@ export function createInstanceRoutes(deps: InstanceRouteDeps): RouteHandler {else delete entry.hidden;}if (body.tools !== undefined) {- if (!["openai-compat", "grok", "minimax", "mistral", "cerebras", "groq", "greenference", "meta"].includes(entry.driver)) {- return json(res, 400, { error: "The tools setting is available for OpenAI-compatible, Grok API, MiniMax API, Mistral API, Cerebras API, Groq API, Greenference API and Meta API instances only." });+ if (!["openai-compat", "grok", "minimax", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta"].includes(entry.driver)) {+ return json(res, 400, { error: "The tools setting is available for OpenAI-compatible, Grok API, MiniMax API, Mistral API, Cerebras API, Groq API, Greenference API, ModelGo API and Meta API instances only." });}entry.config = { ...entry.config as Record<string, unknown>, tools: body.tools };}diff --git a/server/routes/status.ts b/server/routes/status.tsindex f71ddd37f8..81be779d5b 100644--- a/server/routes/status.ts+++ b/server/routes/status.ts@@ -153,7 +153,7 @@ export function createStatusRoutes(deps: StatusRouteDeps): RouteHandler {return json(res, 400, { error: `provider must be one of ${PROVIDER_KEY_KINDS.join(", ")}` });}const kind = provider as ProviderKeyKind;- const saved = { anthropic: cfg.anthropic, openai: cfg.openai, openrouter: cfg.openrouter, openaiCompat: cfg.openaiCompat, mistral: cfg.mistral, cerebras: cfg.cerebras, groq: cfg.groq, greenference: cfg.greenference, meta: cfg.meta, xai: cfg.xai }[kind];+ const saved = { anthropic: cfg.anthropic, openai: cfg.openai, openrouter: cfg.openrouter, openaiCompat: cfg.openaiCompat, mistral: cfg.mistral, cerebras: cfg.cerebras, groq: cfg.groq, greenference: cfg.greenference, modelgo: cfg.modelgo, meta: cfg.meta, xai: cfg.xai }[kind];if (body?.key !== undefined && typeof body.key !== "string") {return json(res, 400, { error: "key must be a string" });}diff --git a/server/runtime/capabilities.test.ts b/server/runtime/capabilities.test.tsindex 949603d1fd..bf0b494336 100644--- a/server/runtime/capabilities.test.ts+++ b/server/runtime/capabilities.test.ts@@ -37,6 +37,7 @@ const EXPECTED: Record<string, EngineCapabilities> = {cerebras: chat,groq: chat,greenference: chat,+ modelgo: chat,meta: chat,};diff --git a/server/runtime/capabilities.ts b/server/runtime/capabilities.tsindex c4650fdbd0..3972a3bfe7 100644--- a/server/runtime/capabilities.ts+++ b/server/runtime/capabilities.ts@@ -44,6 +44,7 @@ const ENGINES: Readonly<Record<string, EngineRow>> = {cerebras: CHAT_ROW,groq: CHAT_ROW,greenference: CHAT_ROW,+ modelgo: CHAT_ROW,meta: CHAT_ROW,};diff --git a/server/usage-trace/recorder.ts b/server/usage-trace/recorder.tsindex b2f3bec250..6e6d35f32b 100644--- a/server/usage-trace/recorder.ts+++ b/server/usage-trace/recorder.ts@@ -87,7 +87,7 @@ const EXPECT_TTL_MS = 60_000;/** Claude reports each model call; Codex a thread's running total; the OpenAI-style chat engines a turn's running total. */const PER_CALL = new Set(["claude"]);const THREAD_TOTALS = new Set(["codex"]);-const TURN_TOTALS = new Set(["grok", "groq", "greenference", "cerebras", "mistral", "minimax", "meta", "openai-compat"]);+const TURN_TOTALS = new Set(["grok", "groq", "greenference", "modelgo", "cerebras", "mistral", "minimax", "meta", "openai-compat"]);const MAX_LINKS = 5_000;const ENDED_GRACE_MS = 120_000;const RECEIPT_SLACK_MS = 3_000;diff --git a/server/workspace.ts b/server/workspace.tsindex 52d93d5536..f2f3609900 100644--- a/server/workspace.ts+++ b/server/workspace.ts@@ -14,7 +14,7 @@ export const WORKSPACES_DIR = join(DATA_DIR, "workspaces");export const TASK_WORKSPACES_DIR = join(DATA_DIR, "task-workspaces");export function supportsWorkspaceFiles(driverKind: string): boolean {- return !["grok", "openai-compat", "minimax", "mistral", "cerebras", "groq", "greenference", "meta"].includes(driverKind);+ return !["grok", "openai-compat", "minimax", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta"].includes(driverKind);}/** Directory organization, not a shell sandbox. */diff --git a/shared/credential-request.ts b/shared/credential-request.tsindex 471b2a8645..f55e45d75b 100644--- a/shared/credential-request.ts+++ b/shared/credential-request.ts@@ -1,3 +1,4 @@+import { MODELGO_URL } from "./modelgo.ts";/*** Credentials an agent may ask the person to provide through an inline* card. The id is the entire authority surface: agents never choose a@@ -100,6 +101,12 @@ export const CREDENTIAL_TARGETS = {placeholder: "Paste your Greenference API key",helpUrl: "https://greenference.com/dashboard/tokens",},+ modelgoApiKey: {+ label: "ModelGo API key",+ description: "Runs ModelGo models with your own key.",+ placeholder: "Paste your ModelGo API key",+ helpUrl: MODELGO_URL,+ },metaApiKey: {label: "Meta API key",description: "Runs Meta's models with your own key.",@@ -120,7 +127,7 @@ export type LoginCredentialTargetId = "onePasswordToken";export type ConfigCredentialTargetId = Exclude<CredentialTargetId, LoginCredentialTargetId>;/** AI provider keys: refused where Admin manages the models, and typed only in the computer's own app or a desktop paired to it, never on a phone. */export const PROVIDER_CREDENTIAL_TARGETS = [- "openaiApiKey", "anthropicApiKey", "openrouterApiKey", "mistralApiKey", "cerebrasApiKey", "groqApiKey", "greenferenceApiKey", "metaApiKey", "deepseekApiKey",+ "openaiApiKey", "anthropicApiKey", "openrouterApiKey", "mistralApiKey", "cerebrasApiKey", "groqApiKey", "greenferenceApiKey", "modelgoApiKey", "metaApiKey", "deepseekApiKey",] as const satisfies readonly ConfigCredentialTargetId[];export type DesktopCredentialSlot = ConfigCredentialTargetId;export type CredentialConfig = {@@ -137,6 +144,7 @@ export type CredentialConfig = {cerebras?: { key?: string };groq?: { key?: string };greenference?: { key?: string };+ modelgo?: { key?: string };meta?: { key?: string };deepseek?: { key?: string };/** Not in the settings file: the server fills it from its login store. */@@ -207,6 +215,8 @@ export function credentialConfigPatch(id: ConfigCredentialTargetId, value: strinreturn { groq: { key: value } };case "greenferenceApiKey":return { greenference: { key: value } };+ case "modelgoApiKey":+ return { modelgo: { key: value } };case "metaApiKey":return { meta: { key: value } };case "deepseekApiKey":@@ -248,6 +258,8 @@ export function credentialIsConfigured(config: CredentialConfig, id: CredentialTreturn Boolean(config.groq?.key);case "greenferenceApiKey":return Boolean(config.greenference?.key);+ case "modelgoApiKey":+ return Boolean(config.modelgo?.key);case "metaApiKey":return Boolean(config.meta?.key);case "deepseekApiKey":diff --git a/shared/modelgo.ts b/shared/modelgo.tsnew file mode 100644index 0000000000..09c5cbf048--- /dev/null+++ b/shared/modelgo.ts@@ -0,0 +1,2 @@+/** The sponsor asked for this exact address, every parameter included, on every in-app link to its site. */+export const MODELGO_URL = "https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app";diff --git a/shared/tool-scope-support.ts b/shared/tool-scope-support.tsindex 8dc9c42451..5a283e146d 100644--- a/shared/tool-scope-support.ts+++ b/shared/tool-scope-support.ts@@ -3,7 +3,7 @@ import { narrowsNativeTools, parseToolScope, type ToolScope } from "./tool-scope/** Native contracts and app-supplied MCP gates are separate capabilities. */export const TOOL_SCOPE_SUPPORT = {grok: "native-and-mcp", grokAgent: "native-and-mcp", piAgent: "native-and-mcp",- "openai-compat": "native-and-mcp", mistral: "native-and-mcp", minimax: "native-and-mcp", cerebras: "native-and-mcp", groq: "native-and-mcp", greenference: "native-and-mcp", meta: "native-and-mcp",+ "openai-compat": "native-and-mcp", mistral: "native-and-mcp", minimax: "native-and-mcp", cerebras: "native-and-mcp", groq: "native-and-mcp", greenference: "native-and-mcp", modelgo: "native-and-mcp", meta: "native-and-mcp",claudeAgent: "mcp", codex: "mcp", geminiAgent: "mcp", kimiAgent: "mcp", droidAgent: "mcp",cursorAgent: "mcp", opencodeGo: "mcp", qwenAgent: "mcp", hermesAgent: "mcp", clineAgent: "mcp", copilotAgent: "mcp", commandCodeAgent: "mcp", kiroAgent: "mcp", deepseekAgent: "mcp", customAcp: "mcp", antigravityAgent: "mcp", museCode: "mcp",} as const;diff --git a/shared/wire.ts b/shared/wire.tsindex 8482da3bc9..040adb47ea 100644--- a/shared/wire.ts+++ b/shared/wire.ts@@ -725,7 +725,7 @@ export interface SecretRequestCardData {description: string;/** Optional named-key copy for client localization; `description` remains the complete fallback for English and older cards. */descriptionParts?: {- baseCode: "secretCard.greenference.description" | "secretCard.geminiTts.description";+ baseCode: "secretCard.greenference.description" | "secretCard.modelgo.description" | "secretCard.geminiTts.description";reason: string;bot: string;};diff --git a/src/components/AppNotices.test.ts b/src/components/AppNotices.test.tsindex e26281bfff..1b1bc1d829 100644--- a/src/components/AppNotices.test.ts+++ b/src/components/AppNotices.test.ts@@ -16,6 +16,7 @@ import { createUpdatesConsent, registerUpdatesConsent } from "../../electron/updconst f = vi.hoisted(() => ({ values: [] as unknown[], index: 0, effects: [] as EffectCallback[], state: {} as any, updater: null as any, dispatch: null as any, brand: "default",viewerEmail: undefined as string | null | undefined }));vi.mock("react", async original => ({ ...await original<typeof import("react")>(),+ useId: () => "test-id",useState: (initial: unknown) => { const index = f.index++; if (!(index in f.values)) f.values[index] = typeof initial === "function" ? initial() : initial;return [f.values[index], (next: unknown) => { f.values[index] = typeof next === "function" ? (next as (value: unknown) => unknown)(f.values[index]) : next; }]; },useEffect: (effect: EffectCallback) => { f.effects.push(effect); },@@ -36,7 +37,7 @@ vi.mock("@/components/EngineLibrary", () => ({ engineReady: (instance: { snapshoinstance.snapshot.state === "available" && instance.snapshot.authenticated !== false }));import { AppNotices } from "./AppNotices";import { TwoPlacesCard } from "./TwoPlacesCard";-import { BOAT_OFFER_NOTICE, CLOUD_INTRO, GROK_MOVE_NOTICE, launchNotice, localDay, PRODUCT_HUNT_NOTICE, PRODUCT_HUNT_UNTIL, PRODUCT_HUNT_URL, STAR_NOTICE, WHATS_NEW_NOTICE } from "@/lib/notices";+import { BOAT_OFFER_NOTICE, CLOUD_INTRO, GROK_MOVE_NOTICE, launchNotice, localDay, MODELGO_OFFER_NOTICE, PRODUCT_HUNT_NOTICE, PRODUCT_HUNT_UNTIL, PRODUCT_HUNT_URL, STAR_NOTICE, WHATS_NEW_NOTICE } from "@/lib/notices";import { BOAT_OFFER, boatClaimMailto } from "@/lib/boat-offer";import { track } from "@/lib/analytics";import { ADVANCED_MODE_KEY, setAdvancedMode } from "@/lib/interface-mode";@@ -134,7 +135,7 @@ const press = (label: string) => {const FIRST_REPLY = [{ tasks: [{ threadId: "first", usage: { turns: 1 } }] }];let session: Map<string, string>;const returning = () => { f.state.bots = [{ tasks: [{ threadId: "t", createdAt: 1, usage: { turns: 2 } }] }]; };-const launchCardsSeen = () => { desk.saved = { seen: [WHATS_NEW_NOTICE] }; storage.set(GROK_MOVE_NOTICE, "1"); storage.set(PRODUCT_HUNT_NOTICE, "1"); storage.set(SIMPLE_MODE_PROMPT_KEY, "1"); storage.set(BOAT_OFFER_NOTICE, "1"); };+const launchCardsSeen = () => { desk.saved = { seen: [WHATS_NEW_NOTICE] }; storage.set(MODELGO_OFFER_NOTICE, "1"); storage.set(GROK_MOVE_NOTICE, "1"); storage.set(PRODUCT_HUNT_NOTICE, "1"); storage.set(SIMPLE_MODE_PROMPT_KEY, "1"); storage.set(BOAT_OFFER_NOTICE, "1"); };const hints = () => f.state.config.onboarding.hintsSeen as string[];beforeEach(() => {@@ -1345,3 +1346,113 @@ describe("bots in two places", () => {expect(await launch(), "a Cloud's page handed the bridge anyway").not.toContain('data-notice="two-places"');});});++describe("ModelGo's sponsor card", () => {+ const TITLE = "ModelGo is now in MausBot", LINE = "One API key, every model.";+ const URL_EXACT = "https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app";+ const due = () => { storage.delete(MODELGO_OFFER_NOTICE); };+ const events = () => vi.mocked(track).mock.calls.filter(([name]) => name === "modelgo_offer").map(([, props]) => props);+ const escape = () => tree().find(node => node.type === "aside")!.props.onKeyDown({ key: "Escape", preventDefault() {}, stopPropagation() {} });+ const gone = async () => {+ expect(render()).toBe("");+ expect(storage.get(MODELGO_OFFER_NOTICE)).toBe("1"); expect(hints()).toContain(MODELGO_OFFER_NOTICE); expect(desk.saved?.seen).toContain(MODELGO_OFFER_NOTICE);+ expect(await relaunch()).not.toContain(TITLE);+ };+ beforeEach(due);++ it("is one corner card: its mark, the title, the one line, a sponsor label, one primary button, Not now and close, and no key button", async () => {+ const shown = await launch();+ for (const text of [TITLE, LINE, "Sponsor", "Get a ModelGo key", "Not now"]) expect(shown).toContain(text);+ expect(shown).toContain('data-notice="modelgo-offer"'); expect(shown).not.toContain('aria-modal="true"'); expect(shown).toContain("<svg");+ const buttons = tree().filter(node => node.type === "button");+ expect(buttons).toHaveLength(3);+ expect(render()).not.toMatch(/add my key|Settings/i);+ expect(events()).toEqual([{ action: "shown", place: "popup" }]);+ expect(await settle()).toContain(TITLE);+ expect(events()).toHaveLength(1);+ });++ it("opens exactly the sponsor's address, and is gone for good", async () => {+ await launch(); press("Get a ModelGo key"); await flush();+ expect(window.ogb!.openExternal).toHaveBeenCalledWith(URL_EXACT);+ expect(events().at(-1)).toEqual({ action: "get_key", place: "popup" });+ await gone();+ });++ it("Not now records its action and ends it for good, on the desktop too", async () => {+ await launch(); press("Not now"); await flush();+ expect(events().at(-1)).toEqual({ action: "not_now", place: "popup" });+ await gone();+ });++ it("close (the X or Escape) records its action and ends it for good", async () => {+ await launch(); escape(); await flush();+ expect(events().at(-1)).toEqual({ action: "close", place: "popup" });+ await gone();+ });++ it("stays until acted on: no timer ends it", async () => {+ await launch();+ now += 2 * DAY;+ expect(await settle()).toContain(TITLE);+ });++ it("goes to someone who never used a bot, once the welcome and any first chat are out of the way", async () => {+ f.state.bots = [];+ expect(await launch(), "no chat started, no welcome met: no gate on a bot having answered").toContain(TITLE);+ session.clear(); f.values = [];+ f.state.config.onboarding.hintsSeen = [...f.state.config.onboarding.hintsSeen, MET_CHIEF_HINT];+ expect(await relaunch(), "the Chief's first conversation stays quiet until its first reply").not.toContain(TITLE);+ f.state.bots = structuredClone(FIRST_REPLY);+ 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 () => {+ 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);+ });++ it("is on every page: the desktop, My Cloud, a Team Cloud's Member and a browser", async () => {+ expect(await launch()).toContain(TITLE);+ due(); session.clear(); viewer = { hosted: false, canSave: true, cloudHome: true }; f.state.config.cloudHome = true; snapshot = { status: "none" };+ f.state.config.onboarding.hintsSeen = [...withTourFinished(undefined), "cloud-setup-hidden"]; showWindow(MY_CLOUD);+ expect(await relaunch(), "My Cloud").toContain(TITLE);+ due(); session.clear(); viewer = { hosted: true, canSave: false }; f.state.config.cloudHome = false; showWindow(VPS);+ expect(await relaunch(), "a Member").toContain(TITLE);+ expect(render(), "no key button for anyone").not.toMatch(/add my key/i);+ due(); session.clear(); viewer = { hosted: false, canSave: true }; vi.stubGlobal("window", { addEventListener: vi.fn(), removeEventListener: vi.fn() });+ expect(await relaunch(), "a plain browser").toContain(TITLE);+ });++ it("shares seen across desktop and Cloud, as Boat's offer does", async () => {+ desk.saved = { seen: [WHATS_NEW_NOTICE, MODELGO_OFFER_NOTICE] };+ expect(await launch(), "the desktop's record").not.toContain(TITLE);+ desk.saved = { seen: [WHATS_NEW_NOTICE] };+ f.state.config.onboarding.hintsSeen = [...f.state.config.onboarding.hintsSeen, MODELGO_OFFER_NOTICE];+ expect(await relaunch(), "the server's record").not.toContain(TITLE);+ });++ it("the only two exceptions: a white-label build, and a desktop whose organization refuses ModelGo", async () => {+ f.brand = "file";+ expect(await launch(), "white-label").not.toContain(TITLE);+ f.brand = "default";+ f.state.config.managedPolicy = { organizationName: "Acme", companyModelsOnly: false, allowedEngines: ["claudeAgent"] };+ expect(await relaunch(), "a list without ModelGo").not.toContain(TITLE);+ f.state.config.managedPolicy = { organizationName: "Acme", companyModelsOnly: true, allowedEngines: "all" };+ expect(await relaunch(), "company models only").not.toContain(TITLE);+ f.state.config.managedPolicy = { organizationName: "Acme", companyModelsOnly: false, allowedEngines: ["modelgo"] };+ expect(await relaunch(), "listed").toContain(TITLE);+ due(); session.clear();+ f.state.config.managedPolicy = { organizationName: "Acme", companyModelsOnly: false, allowedEngines: "all" };+ expect(await relaunch(), "an organization that allows everything still sees it").toContain(TITLE);+ due(); session.clear();+ f.state.config.managedPolicy = { organizationName: "Team", team: true, companyModelsOnly: false, allowedEngines: ["codex"] };+ expect(await relaunch(), "a Team Cloud's rules are no organization-managed desktop").toContain(TITLE);+ });++});diff --git a/src/components/AppNotices.tsx b/src/components/AppNotices.tsxindex aebbdca42d..879db88cca 100644--- a/src/components/AppNotices.tsx+++ b/src/components/AppNotices.tsx@@ -6,12 +6,13 @@ import { api, useStore } from "@/state/store";import { APP_REPOSITORY } from "@/lib/app-links";import { track } from "@/lib/analytics";import { boatOfferRuns } from "@/lib/boat-offer";+import { modelgoOfferable, reportModelgoOffer } from "@/lib/modelgo-offer";import { brandStatus } from "@/lib/brand";import { buyOfferAllowed, cloudNoticeKind, cloudPlanView, cloudTrialNotice, cloudTrialView, offerTrialDays } from "@/lib/cloud-plan";import { jobRoutine, useCloudIntent } from "@/lib/cloud-intent";import { CLOUD_INTENT_GIVEN, cloudSetupStage } from "@/lib/cloud-setup";import { cornerPopupWaits, firstChatQuiet, firstReplyPending } from "@/lib/corner-popup";-import { BOAT_OFFER_NOTICE, CLOUD_INTRO, CLOUD_NOTICE, CLOUD_TRIAL_NOTICE, dismissNotice, GROK_MOVE_NOTICE, introShown, introStage, launchNotice, markLaunchNotice, nextNotice, noticeSeen, PRODUCT_HUNT_NOTICE, PRODUCT_HUNT_UNTIL, PRODUCT_HUNT_URL, SIMPLE_MODE_NOTICE, STAR_NOTICE, TWO_PLACES_NOTICE, UPDATES_CONSENT_NOTICE, usedBefore, WHATS_NEW_NOTICE } from "@/lib/notices";+import { BOAT_OFFER_NOTICE, CLOUD_INTRO, CLOUD_NOTICE, CLOUD_TRIAL_NOTICE, dismissNotice, GROK_MOVE_NOTICE, introShown, introStage, launchNotice, markLaunchNotice, MODELGO_OFFER_NOTICE, nextNotice, noticeSeen, PRODUCT_HUNT_NOTICE, PRODUCT_HUNT_UNTIL, PRODUCT_HUNT_URL, SIMPLE_MODE_NOTICE, STAR_NOTICE, TWO_PLACES_NOTICE, UPDATES_CONSENT_NOTICE, usedBefore, WHATS_NEW_NOTICE } from "@/lib/notices";import { useTwoPlaces } from "@/lib/two-places";import { SIMPLE_ONLY } from "@/lib/simple-only";import { useAdvancedBackDue, useNewLookDue } from "@/lib/new-look";@@ -24,6 +25,7 @@ import { useUpdaterState } from "@/lib/updater";import { t } from "@/lib/i18n";import { BoatOfferCard, reportBoatOffer, type BoatOfferAction } from "./BoatOffer";import { engineReady } from "./EngineLibrary";+import { ModelgoOfferCard, type ModelgoCardAction } from "./ModelgoOffer";import { CLOUD_NOTICE_CARD, cloudNoticeStep, CloudNoticeCard } from "./CloudNotice";import { CloudTrialIntroCard } from "./CloudTrialIntro";import { useMoveQuiet } from "./CloudSendStrip";@@ -86,6 +88,7 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { qconst [busy, setBusy] = useState(false);const [simpleShown, setSimpleShown] = useState(false);const [boatShown, setBoatShown] = useState(false);+ const [modelgoShown, setModelgoShown] = useState(false);const [grokShown, setGrokShown] = useState(false);const [grokOpen, setGrokOpen] = useState(false);const [grokLanded, setGrokLanded] = useState(false);@@ -154,6 +157,7 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { qconst simpleDue = SIMPLE_ONLY ? newLookDue : advancedBack || !promptSeen;const simpleBlocked = useOtherDialogOpen(simpleDue) || Boolean(state.liveCall && state.liveCall.status !== "ended");const boatHere = boatOfferRuns(now()) && brandStatus().source !== "file";+ const modelgoHere = modelgoOfferable(state.config?.managedPolicy);const trial = plan?.trial;const key = trial ? trialKey(trial) : null;@@ -195,11 +199,15 @@ 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;const launch = launchNotice();// After a closed popup only the product-updates question may follow in this launch; nothing else does.const notice = waits ? null : closed ? (consentNow === true ? UPDATES_CONSENT_NOTICE : null): firstChatQuiet(state) ? (grokNow === true && (launch === null || launch === GROK_MOVE_NOTICE) ? GROK_MOVE_NOTICE : null)- : cards || whatsNewHere || consentHere || simpleDue || boatHere || twoFact !== false || grokNow !== false ? nextNotice({+ : cards || whatsNewHere || consentHere || simpleDue || boatHere || modelgoHere || twoFact !== false || grokNow !== false ? nextNotice({[GROK_MOVE_NOTICE]: grokNow,// As the What's new popup: never in the launch whose welcome just finished, nor over MausBot's first-launch card.[SIMPLE_MODE_NOTICE]: !simpleDue || afterWelcome === true ? false : afterWelcome === null || mausBotFirst || simpleBlocked ? null : true,@@ -213,11 +221,12 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { q[CLOUD_TRIAL_NOTICE]: planBridge && plan === null ? null : Boolean(key && (trialDue || trialOpen === key)),[CLOUD_NOTICE]: !view ? false : view.kind === "unknown" ? null: Boolean(kind && !noticeSeen(record, CLOUD_NOTICE_CARD[kind].dismissed)),+ [MODELGO_OFFER_NOTICE]: modelgoNow,[BOAT_OFFER_NOTICE]: !boatHere || moving || afterWelcome === true || !usedBefore(state.bots) || desktopState?.seen.includes(BOAT_OFFER_NOTICE) ? false: organization === null || moving === null || afterWelcome === null || mausBotFirst || (desktop && !desktopState) ? null : !organization,[STAR_NOTICE]: !bridge || moving || brandStatus().source === "file" || !usedBefore(state.bots) ? false : moving === null ? null : true,}, id => id === CLOUD_INTRO ? stage === "done" && !introOpen- : id === STAR_NOTICE || id === PRODUCT_HUNT_NOTICE || id === BOAT_OFFER_NOTICE ? noticeSeen(record, id) : false, launch) : null;+ : id === STAR_NOTICE || id === PRODUCT_HUNT_NOTICE || id === BOAT_OFFER_NOTICE || id === MODELGO_OFFER_NOTICE ? noticeSeen(record, id) : false, launch) : null;const shownKey = notice === CLOUD_TRIAL_NOTICE ? key : notice;useEffect(() => {@@ -240,6 +249,9 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { q} else if (shownKey === BOAT_OFFER_NOTICE && !boatShown) {setBoatShown(true);reportBoatOffer("shown", "card");+ } else if (shownKey === MODELGO_OFFER_NOTICE && !modelgoShown) {+ setModelgoShown(true);+ reportModelgoOffer("shown", "popup");} else if (shownKey === GROK_MOVE_NOTICE && !grokShown) {setGrokShown(true);reportGrokMovePopup("shown");@@ -319,6 +331,13 @@ export function AppNotices({ quiet = false, viewer = null, now = Date.now }: { q};return <BoatOfferCard onDone={done} />;}+ if (notice === MODELGO_OFFER_NOTICE) {+ const done = (action: ModelgoCardAction) => {+ reportModelgoOffer(action, "popup"); close(); save(MODELGO_OFFER_NOTICE);+ void desktop?.seen(MODELGO_OFFER_NOTICE).catch(() => {});+ };+ return <ModelgoOfferCard onDone={done} />;+ }if (notice === STAR_NOTICE) return <StarCard onDismiss={() => { close(); save(STAR_NOTICE); }} />;return null;}diff --git a/src/components/EngineLibrary.tsx b/src/components/EngineLibrary.tsxindex 20af709a4d..7042a86150 100644--- a/src/components/EngineLibrary.tsx+++ b/src/components/EngineLibrary.tsx@@ -18,7 +18,7 @@ const providers: Record<string, string> = {claudeAgent: "Anthropic", codex: "OpenAI", grok: "xAI", grokAgent: "xAI",kimiAgent: "Moonshot AI", droidAgent: "Factory", cursorAgent: "Cursor",antigravityAgent: "Google", opencodeGo: "OpenCode", qwenAgent: "Qwen",- hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", piAgent: "pi.dev", mistral: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",+ hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", piAgent: "pi.dev", mistral: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", modelgo: "ModelGo", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",};export function providerName(instance: InstanceInfo): string {diff --git a/src/components/ModelgoOffer.tsx b/src/components/ModelgoOffer.tsxnew file mode 100644index 0000000000..2460cb1e7f--- /dev/null+++ b/src/components/ModelgoOffer.tsx@@ -0,0 +1,51 @@+import { useEffect, type ReactNode } from "react";+import { ChevronDown } from "lucide-react";+import { cn } from "@/lib/cn";+import { t } from "@/lib/i18n";+import { reportModelgoOffer } from "@/lib/modelgo-offer";+import { MODELGO_URL } from "../../shared/modelgo";+import { LinkButton, NoticeCard, NotNowButton, PRIMARY_BUTTON } from "./NoticeCard";+import { ModelgoMark, type IconProps } from "./ProviderIcons";++export type ModelgoCardAction = "get_key" | "not_now" | "close";++const CardMark = ({ className }: IconProps) => <ModelgoMark size={22} className={className} />;++export function ModelgoOfferCard({ onDone }: { onDone: (action: ModelgoCardAction) => void }) {+ return <NoticeCard titleId="modelgo-offer-title" notice="modelgo-offer" icon={CardMark} title={t("modelgoOffer.title")} onDismiss={() => onDone("close")}>+ <p className="mt-1 text-[13px] leading-[18px] text-ink-secondary">{t("modelgoOffer.line")}</p>+ <p data-modelgo-sponsor className="mt-1 text-[11px] leading-4 text-ink-tertiary">{t("modelgoOffer.sponsor")}</p>+ <div className="mt-3 flex flex-col gap-2">+ <LinkButton url={MODELGO_URL} label={t("modelgoOffer.getKey")} className={cn(PRIMARY_BUTTON, "w-full")} onOpened={() => onDone("get_key")} />+ <NotNowButton onClick={() => onDone("not_now")} />+ </div>+ </NoticeCard>;+}++const GET_KEY_LINK = "inline-flex shrink-0 items-center gap-1 text-[12px] font-medium text-accent-text hover:underline";++/** The first run's row for ModelGo, among the other ways to connect an AI; `children` is its key field, when the server has the provider. */+export function ModelgoOption({ open, onToggle, children }: { open: boolean; onToggle: () => void; children?: ReactNode }) {+ useEffect(() => { reportModelgoOffer("shown", "onboarding"); }, []);+ const name = <>+ <span className="flex size-[18px] shrink-0 items-center justify-center"><ModelgoMark size={18} /></span>+ <span className="min-w-0 flex-1">+ <span className="flex items-center gap-1.5">+ <span className="truncate text-[14px] text-ink">{t("modelgoOffer.name")}</span>+ <span data-modelgo-sponsor className="shrink-0 text-[11px] leading-4 text-ink-tertiary">{t("modelgoOffer.sponsor")}</span>+ </span>+ <span className="block truncate text-[12px] leading-4 text-ink-secondary">{t("modelgoOffer.line")}</span>+ </span>+ </>;+ return <div data-modelgo-option="">+ <div className="flex items-center gap-2 pr-4 transition-colors hover:bg-ink/[0.04]">+ {children ? <button type="button" aria-expanded={open} onClick={() => { if (!open) reportModelgoOffer("add_key", "onboarding"); onToggle(); }}+ className="flex min-w-0 flex-1 items-center gap-3 py-2.5 pl-4 text-left focus-visible:outline-offset-[-2px]">+ {name}+ <ChevronDown size={14} className={cn("shrink-0 text-ink-secondary transition-transform duration-200", open && "rotate-180")} />+ </button> : <div className="flex min-w-0 flex-1 items-center gap-3 py-2.5 pl-4">{name}</div>}+ <LinkButton url={MODELGO_URL} label={t("modelgoOffer.link")} className={GET_KEY_LINK} onOpened={() => reportModelgoOffer("get_key", "onboarding")} />+ </div>+ {open && children}+ </div>;+}diff --git a/src/components/NoticeCard.tsx b/src/components/NoticeCard.tsxindex 2978420206..d323888688 100644--- a/src/components/NoticeCard.tsx+++ b/src/components/NoticeCard.tsx@@ -1,10 +1,10 @@-import { useEffect, useState, type ReactNode } from "react";-import { ArrowUpRight, X, type LucideIcon } from "lucide-react";+import { useEffect, useState, type ComponentType, type ReactNode } from "react";+import { ArrowUpRight, X } from "lucide-react";import { openExternalLink } from "@/lib/app-links";import { t } from "@/lib/i18n";export function NoticeCard({ titleId, icon: Icon, title, onDismiss, dismissLabel = t("notice.dismiss"), notice, children }: {- titleId: string; icon: LucideIcon; title: string; onDismiss: () => void;+ titleId: string; icon: ComponentType<{ size?: number; className?: string }>; title: string; onDismiss: () => void;dismissLabel?: string;notice?: string;children: ReactNode;diff --git a/src/components/ProviderIcons.tsx b/src/components/ProviderIcons.tsxindex a4d1d490a2..e000f43e34 100644--- a/src/components/ProviderIcons.tsx+++ b/src/components/ProviderIcons.tsx@@ -1,4 +1,4 @@-import { useState } from "react";+import { useId, useState } from "react";import { cn } from "@/lib/cn";import { HermesMark } from "./HermesMark";import { CursorMark } from "./CursorMark";@@ -153,6 +153,23 @@ export function GreenferenceMark({ size = 16, className }: IconProps) {</svg>;}+export function ModelgoMark({ size = 16, className }: IconProps) {+ const id = useId().replace(/\W/gu, "");+ // The icon from ModelGo's supplied logo, without its wordmark, whose dark text is unreadable in the dark themes.+ return <svg width={size} height={size} viewBox="0 18.09 31 31" fill="none" className={className} aria-hidden="true">+ <defs>+ <linearGradient id={`${id}a`} x1="10.5179" y1="25.8892" x2="2.29751" y2="41.3335" gradientUnits="userSpaceOnUse"><stop stopColor="#5071FF" /><stop offset="1" stopColor="#0410FF" /></linearGradient>+ <linearGradient id={`${id}b`} x1="14" y1="29.5894" x2="17" y2="32.5894" gradientUnits="userSpaceOnUse"><stop stopColor="#2563EB" /><stop offset="1" stopColor="#16C784" /></linearGradient>+ <linearGradient id={`${id}c`} x1="24.9101" y1="35.7894" x2="12.7635" y2="41.9022" gradientUnits="userSpaceOnUse"><stop stopColor="#13DA74" /><stop offset="1" stopColor="#1F83CD" /></linearGradient>+ </defs>+ <path fill={`url(#${id}a)`} d="M6.31271 27.713C7.94898 25.3277 11.1777 24.7425 13.5241 26.4059C15.8703 28.0693 16.446 31.3509 14.8099 33.7361L9.42862 41.5814C7.79234 43.9665 4.56361 44.5517 2.21725 42.8885C-0.129169 41.2252 -0.704765 37.9429 0.931485 35.5577L6.31271 27.713ZM13.0071 29.9972C12.0826 28.0346 9.41394 27.8263 8.2057 29.6228L2.7953 37.6672C2.1197 38.6719 2.36677 40.0427 3.34879 40.7389L3.51215 40.8544C4.49397 41.5504 5.84429 41.3127 6.53837 40.3214L13.2065 30.7957C13.2716 30.7027 13.2818 30.581 13.2334 30.478L13.0071 29.9972Z" />+ <path fill="#16C784" d="M23.7889 27.7173C22.1526 25.3321 18.924 24.7469 16.5775 26.4103C14.2313 28.0737 13.6556 31.3559 15.2917 33.7411L21.1882 42.336C22.8245 44.7212 26.0526 45.3064 28.399 43.6431C30.7454 41.9798 31.3214 38.6981 29.6853 36.3128L23.7889 27.7173ZM17.2344 30.2879C18.159 28.3251 20.8276 28.1169 22.0359 29.9134L27.4463 37.9578C28.1218 38.9625 27.8752 40.3328 26.8934 41.0289L26.73 41.1451C25.7482 41.8411 24.3979 41.6029 23.7038 40.6115L17.0351 31.0858C16.9701 30.9928 16.9597 30.871 17.0082 30.7681L17.2344 30.2879Z" />+ <path fill={`url(#${id}b)`} d="M15.6385 34.2402L15.1611 33.5552L16.944 30.958L17.3932 31.6002L15.6385 34.2402Z" />+ <path fill="#16C784" d="M19.9475 40.5176L19.5264 39.8753L21.3513 37.1641L21.7724 37.7348L19.9475 40.5176Z" />+ <path fill={`url(#${id}c)`} d="M18.0466 25.5876C20.1674 24.8708 22.585 25.6165 23.9285 27.5749L29.824 36.1696C31.2186 38.2028 31.0051 40.8864 29.4587 42.6647C29.1679 43.0226 28.827 43.3488 28.4353 43.6286C26.0801 45.3106 22.8295 44.7337 21.1746 42.3395L19.8152 40.3727C19.7017 40.2086 19.5993 40.0397 19.5066 39.8678L17.9372 42.2028C16.2924 44.5816 13.0617 45.1548 10.7214 43.4831C8.38107 41.8111 7.81697 38.5263 9.46166 36.1471L15.3884 27.5739C16.064 26.5967 17.0076 25.925 18.0466 25.5876ZM26.0671 36.6413C25.269 35.4872 23.7017 35.2084 22.5662 36.0192L21.6599 36.6667L21.3845 37.0749C21.382 37.1637 21.4066 37.2543 21.4607 37.3327L23.7488 40.6422C24.4093 41.5977 25.7063 41.8282 26.6462 41.1569C27.5862 40.4854 27.8125 39.1661 27.1521 38.2106L26.0671 36.6413ZM19.7917 28.9792C18.9257 28.944 18.0396 29.3246 17.4734 30.1579L12.0144 38.196C11.3768 39.1348 11.603 40.4208 12.5212 41.0768C13.4392 41.7324 14.706 41.5139 15.3591 40.5866L19.5124 34.7692C19.8833 34.0834 20.4104 33.4711 21.0828 32.9909C21.7305 32.5282 22.446 32.2362 23.1775 32.1061L21.8943 30.1989C21.3772 29.4303 20.5925 29.0301 19.7917 28.9762V28.9792Z" />+ </svg>;+}+export function ProviderMark({ driverKind, size, className }: IconProps & { driverKind: string }) {switch (driverKind) {case "grok":@@ -193,6 +210,8 @@ export function ProviderMark({ driverKind, size, className }: IconProps & { drivreturn <KiroMark size={size} className={className} />;case "greenference":return <GreenferenceMark size={size} className={className} />;+ case "modelgo":+ return <ModelgoMark size={size} className={className} />;default:return (<span className={cn("flex size-full items-center justify-center text-[10px] font-semibold tracking-tight text-ink-secondary", className)}>diff --git a/src/components/SecretRequestCard.tsx b/src/components/SecretRequestCard.tsxindex a6816aec6f..0a288c7da7 100644--- a/src/components/SecretRequestCard.tsx+++ b/src/components/SecretRequestCard.tsx@@ -34,9 +34,10 @@ export function SecretRequestCard({const secret = message.secret!;const localize = activeLocale() !== "en";const greenference = localize && secret.target === "greenferenceApiKey";+ const modelgo = localize && secret.target === "modelgoApiKey";const gemini = localize && secret.target === "geminiTtsKey";- const label = greenference ? t("keys.greenference.label") : gemini ? t("keys.label.geminiTts") : secret.label;- const placeholder = greenference ? t("keys.greenference.placeholder") : gemini ? t("voice.gemini.keyPlaceholder") : secret.placeholder;+ const label = greenference ? t("keys.greenference.label") : modelgo ? t("keys.modelgo.label") : gemini ? t("keys.label.geminiTts") : secret.label;+ const placeholder = greenference ? t("keys.greenference.placeholder") : modelgo ? t("keys.modelgo.placeholder") : gemini ? t("voice.gemini.keyPlaceholder") : secret.placeholder;const parts = secret.descriptionParts;const suppliedDescription = localize && parts? [t(parts.baseCode), parts.reason, t("server.connect.secretNeverRead", { bot: parts.bot })].filter(Boolean).join(" ")diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsxindex 41f56bcd1a..4c649672be 100644--- a/src/components/SettingsModal.tsx+++ b/src/components/SettingsModal.tsx@@ -94,7 +94,7 @@ export const SECTIONS: Array<{{ id: "appearance", group: "you", labelKey: "settings.section.appearance", icon: Palette, keywords: ["skin", "theme", "appearance", "font", "typeface", "chat width", "width", "wide", "full width", "bubble", "bubbles", "tools", "tool calls", "threads", "show threads", "hide threads", "sidebar", "display", "run", "this run", "run card", "commands", "notifications", "sound", "sounds", "mute", "silent", "chime", "pinned", "circles", "universal", "groups", "top", "send", "enter", "return", "shift+enter", "ctrl+enter", "cmd+enter", "⌘+enter", "new line", "keyboard", "ime", "japanese", "message color", "my messages", "toolbar", "tools layout", "footer", "routines", "triggers", "team map", "color", "colour", "cloud color", "server color", "tint", "sidebar color", "sidebar picture", "picture", "image", "banner", "background", "computers", "your computers", "rail", "strip", "frame", "window frame", "title bar"] },{ id: "companion", group: "you", labelKey: "settings.section.companion", icon: TabletSmartphone, keywords: ["companion", "device", "phone", "desktop", "client", "host", "pair", "pairing", "mobile", "https", "secure", "tailscale", "wifi", "remote", "advanced", "domain", "dns", "self-hosted", "server", "caddy"] },{ id: "engines", group: "ai", labelKey: "settings.section.engines", icon: Terminal, keywords: ["models", "model providers", "engines", "claude", "codex", "grok", "providers", "cli", "sign in", "subscription"] },- { id: "connections", group: "ai", labelKey: "settings.section.connections", icon: KeyRound, keywords: ["keys", "api", "api key", "api keys", "connections", "composio", "box", "xai", "mistral", "cerebras", "meta", "muse", "vps", "router", "openrouter", "base url", "openai", "anthropic", "groq", "greenference", "opencode", "deepseek", "provider", "lm studio", "lmstudio", "llm studio", "llmstudio", "bionic"] },+ { id: "connections", group: "ai", labelKey: "settings.section.connections", icon: KeyRound, keywords: ["keys", "api", "api key", "api keys", "connections", "composio", "box", "xai", "mistral", "cerebras", "meta", "muse", "vps", "router", "openrouter", "base url", "openai", "anthropic", "groq", "greenference", "modelgo", "opencode", "deepseek", "provider", "lm studio", "lmstudio", "llm studio", "llmstudio", "bionic"] },{ id: "decisionModel", group: "ai", labelKey: "settings.section.decisionModel", icon: Zap, keywords: ["decision", "extraction", "jev", "typesafe", "cloudflare", "workers ai", "clef", "clairic", "email", "routing", "auto", "rooms", "who answers"] },{ id: "imageGeneration", group: "ai", labelKey: "settings.section.imageGeneration", icon: ImagePlus, keywords: ["image", "images", "picture", "generate", "avatar", "gpt image", "grok imagine", "gemini", "nano banana", "openrouter", "flux", "backup"] },{ id: "skills", group: "ai", labelKey: "settings.section.skills", icon: BookOpen, keywords: ["skills", "library", "assign", "agent skills", "skill md"] },diff --git a/src/components/keys/KeyRow.analytics.test.ts b/src/components/keys/KeyRow.analytics.test.tsindex e41137f582..92e16ebe29 100644--- a/src/components/keys/KeyRow.analytics.test.ts+++ b/src/components/keys/KeyRow.analytics.test.ts@@ -65,6 +65,29 @@ beforeEach(() => {});afterEach(() => vi.unstubAllGlobals());+describe("the ModelGo row", () => {+ const URL_EXACT = "https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app";+ const offers = () => fixture.track.mock.calls.filter(([name]) => name === "modelgo_offer").map(([, props]) => props);+ const link = (props: Parameters<typeof KeyRow>[0]) => render(props).find((node) => node.type === "a")! as ReactElement<Props & { href?: string }>;++ it("counts a key saved in Settings and its Get a key link, and points that link at exactly the sponsor's address", async () => {+ fixture.api.mockResolvedValueOnce({ modelgo: { configured: true, last4: KEY.slice(-4) } }).mockResolvedValueOnce({ ok: true });+ expect(link({ id: "modelgo" }).props.href).toBe(URL_EXACT);+ link({ id: "modelgo" }).props.onClick!();+ expect(offers()).toEqual([{ action: "get_key", place: "settings" }]);+ await enterKey({ id: "modelgo" });+ expect(offers()).toEqual([{ action: "get_key", place: "settings" }, { action: "add_key", place: "settings" }]);+ expectNoKeyIn(fixture.track.mock.calls);+ });++ it("does not count Settings for the model picker's copy of the row", async () => {+ fixture.api.mockResolvedValueOnce({ modelgo: { configured: true } }).mockResolvedValueOnce({ ok: true });+ link({ id: "modelgo", via: "model_picker" }).props.onClick!();+ await enterKey({ id: "modelgo", via: "model_picker" });+ expect(offers()).toEqual([]);+ });+});+describe("a key saved in Settings → API keys", () => {it.each([["ok", { ok: true, check: "authentication" }],diff --git a/src/components/keys/KeyRow.tsx b/src/components/keys/KeyRow.tsxindex 253470ad27..23ba835800 100644--- a/src/components/keys/KeyRow.tsx+++ b/src/components/keys/KeyRow.tsx@@ -199,6 +199,7 @@ export function KeyRow({if (hadFocus) focusAfter.current = now.configured ? "replace" : "input";if (!now.configured) setProblem(t("keys.row.notKept"));onSaved?.(now.configured);+ if (now.configured && via === "settings") target.settingsEvent?.("add_key");keySaved(target.analytics, via, now.configured && target.test ? await runCheck() : savedKeyResult(target.analytics));} catch (cause) {setProblem(errorText(cause));@@ -394,7 +395,7 @@ export function KeyRow({{(fieldShown && target.href) || (!fieldShown && saved.configured && target.test) ? (<div className="flex flex-wrap items-center gap-x-4 gap-y-1">{fieldShown && target.href && (- <a href={target.href} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-1 font-medium text-accent-text hover:underline">+ <a href={target.href} target="_blank" rel="noopener noreferrer" onClick={() => { if (via === "settings") target.settingsEvent?.("get_key"); }} className="inline-flex items-center gap-1 font-medium text-accent-text hover:underline">{t("keys.row.getKey")}<ExternalLink size={11} aria-hidden="true" /></a>diff --git a/src/components/keys/key-catalog.test.ts b/src/components/keys/key-catalog.test.tsindex da28b7ae64..37fd9c5535 100644--- a/src/components/keys/key-catalog.test.ts+++ b/src/components/keys/key-catalog.test.ts@@ -57,7 +57,7 @@ describe("every credential has one home on the keys page", () => {xaiApiKey: "xai", boxToken: "box", opencodeGoApiKey: "opencodeGo", ttsKey: "elevenlabs", fishAudioKey: "fishAudio", geminiTtsKey: "geminiTts",openaiImageApiKey: "imageOpenai", onePasswordToken: "onePassword", composioApiKey: "composio", openaiApiKey: "openai",anthropicApiKey: "anthropic", openrouterApiKey: "openrouter", mistralApiKey: "mistral", cerebrasApiKey: "cerebras", groqApiKey: "groq",- greenferenceApiKey: "greenference", metaApiKey: "meta", deepseekApiKey: "deepseek",+ greenferenceApiKey: "greenference", modelgoApiKey: "modelgo", metaApiKey: "meta", deepseekApiKey: "deepseek",};expect(Object.keys(homes).sort()).toEqual(Object.keys(CREDENTIAL_TARGETS).sort());for (const [name, id] of Object.entries(homes) as Array<[keyof typeof CREDENTIAL_TARGETS, KeyId]>) {diff --git a/src/components/keys/key-catalog.ts b/src/components/keys/key-catalog.tsindex 7c6127c125..10cfdfc255 100644--- a/src/components/keys/key-catalog.ts+++ b/src/components/keys/key-catalog.ts@@ -4,7 +4,9 @@ import type { SavedKey } from "@/state/config-status";import type { KeyProvider } from "@/lib/analytics-allowlist";import { t } from "@/lib/i18n";import type { LocaleKey } from "@/locales";+import { reportModelgoOffer } from "@/lib/modelgo-offer";import type { ProviderIconPreset } from "../../../shared/provider-icon";+import { MODELGO_URL } from "../../../shared/modelgo";export type KeySectionId = "ai" | "servers" | "voice" | "computers" | "apps" | "helpers";@@ -17,7 +19,7 @@ export const KEY_SECTIONS: ReadonlyArray<{ id: KeySectionId; titleKey: LocaleKey{ id: "helpers", titleKey: "keys.section.helpers", purposeKey: "keys.section.helpers.purpose" },];-export type TestableProvider = "anthropic" | "openai" | "openrouter" | "openaiCompat" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "meta" | "treg";+export type TestableProvider = "anthropic" | "openai" | "openrouter" | "openaiCompat" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "treg";export type DesktopSlot = Parameters<NonNullable<NonNullable<Window["ogb"]>["setCredential"]>>[0];export type DesktopSlotOptions = NonNullable<Parameters<NonNullable<NonNullable<Window["ogb"]>["setCredential"]>>[2]>;@@ -38,10 +40,12 @@ export interface KeyTarget {shape?: RegExp;warningKey?: LocaleKey;noteKey?: LocaleKey;+ /** A sponsor's row: the Settings page's own uses of it, for its product event. */+ settingsEvent?: (action: "get_key" | "add_key") => void;}export type KeyId =- | "openai" | "anthropic" | "xai" | "openrouter" | "mistral" | "cerebras" | "groq" | "greenference" | "meta" | "deepseek" | "opencodeGo" | "opencodeProviders"+ | "openai" | "anthropic" | "xai" | "openrouter" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "deepseek" | "opencodeGo" | "opencodeProviders"| "lmStudio" | "openaiCompat" | "liveCalls" | "liveKey" | "elevenlabs" | "fishAudio" | "geminiTts" | "box" | "vps" | "onePassword" | "composio" | "treg" | "postiz"| "jev" | "openrouterHelper" | "workersAi" | "imageOpenai" | "imageGemini" | "imageCustom";@@ -68,7 +72,7 @@ function flag(saved: SavedKey | undefined): SavedState {return { configured: saved?.configured === true, ...(saved?.configured && saved.last4 ? { last4: saved.last4 } : {}) };}-type TopLevelKey = "openai" | "openrouter" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "meta" | "deepseek" | "treg";+type TopLevelKey = "openai" | "openrouter" | "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "deepseek" | "treg";function providerKey(name: TopLevelKey, rest: Omit<KeyTarget, "patch" | "saved">): KeyTarget {return { patch: (value) => ({ [name]: { key: value } }), saved: (config) => flag(config[name]), ...rest };@@ -104,6 +108,10 @@ export const KEY_CATALOG: readonly KeyEntry[] = [{ id: "greenference", section: "ai", labelKey: "keys.greenference.label", purposeKey: "keys.purpose.greenference", name: "Greenference", env: ["OMB_GREENFERENCE_API_KEY"],words: ["greenference", "green", "open models"], mark: provider("greenference"), kind: "key",target: providerKey("greenference", { slot: "greenferenceApiKey", placeholder: "…", placeholderKey: "keys.greenference.placeholder", href: "https://greenference.com/dashboard/tokens", test: "greenference", analytics: "greenference" }) },+ { id: "modelgo", section: "ai", labelKey: "keys.modelgo.label", purposeKey: "keys.purpose.modelgo", name: "ModelGo", env: ["OMB_MODELGO_API_KEY"],+ words: ["modelgo", "model go", "one key", "sponsor"], mark: provider("modelgo"), kind: "key",+ target: providerKey("modelgo", { slot: "modelgoApiKey", placeholder: "…", placeholderKey: "keys.modelgo.placeholder", href: MODELGO_URL, test: "modelgo", analytics: "modelgo", noteKey: "keys.modelgo.note",+ settingsEvent: (action) => reportModelgoOffer(action, "settings") }) },{ id: "meta", section: "ai", labelKey: "keys.meta.label", purposeKey: "keys.purpose.meta", name: "Meta", env: ["OMB_META_API_KEY"],words: ["meta", "muse", "llama"], mark: provider("meta", "meta"), kind: "key",target: providerKey("meta", { slot: "metaApiKey", placeholder: "LLM|…", href: "https://dev.meta.ai/docs/authentication", test: "meta", analytics: "meta", shape: /^LLM\|/ }) },@@ -239,7 +247,7 @@ export function looksLikeOtherKey(entry: KeyEntry, value: string): KeyEntry | nuconst INSTANCE_KEYS: Readonly<Record<string, KeyId>> = {openai: "openai", claudeApi: "anthropic", xaiApi: "xai", grok: "xai", openrouter: "openrouter", mistral: "mistral", cerebras: "cerebras",- groq: "groq", greenference: "greenference", meta: "meta", deepseek: "deepseek", opencodeGo: "opencodeGo", openaiCompat: "openaiCompat",+ groq: "groq", greenference: "greenference", modelgo: "modelgo", meta: "meta", deepseek: "deepseek", opencodeGo: "opencodeGo", openaiCompat: "openaiCompat",};export function keyForInstance(instanceId: string | undefined): KeyId | undefined {diff --git a/src/components/keys/key-save.test.ts b/src/components/keys/key-save.test.tsindex ea44abae79..031dec5335 100644--- a/src/components/keys/key-save.test.ts+++ b/src/components/keys/key-save.test.ts@@ -8,7 +8,7 @@ import { saveKey } from "./key-save";const SLOTS: Array<[KeyId, string]> = [["openai", "openaiApiKey"], ["anthropic", "anthropicApiKey"], ["openrouter", "openrouterApiKey"], ["mistral", "mistralApiKey"], ["cerebras", "cerebrasApiKey"],- ["groq", "groqApiKey"], ["greenference", "greenferenceApiKey"], ["meta", "metaApiKey"], ["deepseek", "deepseekApiKey"], ["openaiCompat", "openaiCompatApiKey"],+ ["groq", "groqApiKey"], ["greenference", "greenferenceApiKey"], ["modelgo", "modelgoApiKey"], ["meta", "metaApiKey"], ["deepseek", "deepseekApiKey"], ["openaiCompat", "openaiCompatApiKey"],];beforeEach(() => fixture.api.mockReset().mockResolvedValue({}));diff --git a/src/components/onboarding/ConnectAi.test.ts b/src/components/onboarding/ConnectAi.test.tsindex c886cfc81a..cd19ebdaf4 100644--- a/src/components/onboarding/ConnectAi.test.ts+++ b/src/components/onboarding/ConnectAi.test.ts@@ -8,7 +8,7 @@ import type { InstanceInfo } from "@/state/store";const f = vi.hoisted(() => ({instances: [] as InstanceInfo[], dispatch: vi.fn(), row: null as null | { bridge: unknown; onOpenSettings: () => void },- check: (): Promise<object> => Promise.resolve({ ok: true }), checks: [] as string[], fail: false,+ check: (): Promise<object> => Promise.resolve({ ok: true }), checks: [] as string[], fail: false, config: {} as Record<string, unknown>, brand: "default", opened: [] as string[],}));vi.mock("@/state/store", () => ({api: async (path: string) => {@@ -17,8 +17,11 @@ vi.mock("@/state/store", () => ({f.checks.push(path);return f.check();},- useStore: () => ({ state: { instances: f.instances }, dispatch: f.dispatch }),+ useStore: () => ({ state: { instances: f.instances, config: f.config }, dispatch: f.dispatch }),}));+vi.mock("@/lib/analytics", () => ({ track: vi.fn(), emailGateDone: () => false }));+vi.mock("@/lib/brand", () => ({ brandStatus: () => ({ source: f.brand }), productName: () => "MausBot" }));+vi.mock("@/lib/app-links", async (original) => ({ ...await original<typeof import("@/lib/app-links")>(), openExternalLink: async (url: string) => { f.opened.push(url); } }));vi.mock("@/components/EngineSetup", async () => {const { createElement: h } = await import("react");return { EngineSetup: ({ instance, intent, description }: { instance: InstanceInfo; intent: string; description?: string }) =>@@ -29,6 +32,7 @@ vi.mock("./beats/OrganisationRow", () => ({ OrganisationRow: (props: NonNullableconst { ConnectAi, ConnectAiDialog } = await import("./ConnectAi");const { useWelcomeAi } = await import("./welcome-ai");const { useStore } = await import("@/state/store");+const { track } = await import("@/lib/analytics");/** As the first screen has it: the AI it stands on, tested once, handed to the block. */function FirstScreenAi({ hosted = false }: { hosted?: boolean }) {@@ -57,7 +61,8 @@ beforeEach(() => {f.check = () => Promise.resolve({ ok: true });f.checks = [];f.instances = [engine("grok", "grokAgent", "Grok", false), engine("claude", "claudeAgent", "Claude", false), engine("codex", "codex", "Codex", false)];- f.dispatch.mockReset();+ f.dispatch.mockReset(); f.config = {}; f.brand = "default"; f.opened = [];+ vi.mocked(track).mockClear();f.row = null;f.fail = false;vi.stubGlobal("ogb", undefined);@@ -241,3 +246,38 @@ describe("connecting an AI on the first screen", () => {expect(onClose, "a click inside stays").toHaveBeenCalledTimes(2);});});++describe("the ModelGo option", () => {+ const URL_EXACT = "https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app";+ const option = () => host.querySelector("[data-modelgo-option]");+ const events = () => vi.mocked(track).mock.calls.filter(([name]) => name === "modelgo_offer").map(([, props]) => props);+ const provider = (ready = false) => engine("modelgo", "modelgo", "ModelGo (API)", ready);++ it("sits among the other ways, labelled a sponsor, and its link opens exactly the sponsor's address", async () => {+ f.instances.push(provider());+ await show();+ expect(option()?.textContent).toContain("ModelGo"); expect(option()?.textContent).toContain("Sponsor");+ expect(option()?.textContent).toContain("One API key, every model.");+ expect(host.querySelectorAll("[data-modelgo-option]")).toHaveLength(1);+ expect(events()).toEqual([{ action: "shown", place: "onboarding" }]);+ const link = [...option()!.querySelectorAll("button")].find(button => button.textContent?.includes("Get a key"))!;+ await act(async () => { link.click(); });+ expect(f.opened).toEqual([URL_EXACT]);+ expect(events().at(-1)).toEqual({ action: "get_key", place: "onboarding" });+ });++ it("opens to its key field, and counts that as starting to add a key", async () => {+ f.instances.push(provider());+ await show();+ await act(async () => { option()!.querySelector<HTMLButtonElement>("button[aria-expanded]")!.click(); });+ expect(option()!.querySelector('[data-engine-setup="modelgo"]')).toBeTruthy();+ expect(events().at(-1)).toEqual({ action: "add_key", place: "onboarding" });+ });++ it("is not added on a white-label build, a desktop whose organization refuses it, or a hosted workspace; nor once connected", async () => {+ f.brand = "file"; await show(); expect(option()).toBeNull();+ f.brand = "default"; f.config = { managedPolicy: { companyModelsOnly: false, allowedEngines: ["codex"] } }; await show(); expect(option()).toBeNull();+ f.config = {}; await show({ hosted: true }); expect(option()).toBeNull();+ f.instances.push(provider(true)); await show(); expect(option()).toBeNull();+ });+});diff --git a/src/components/onboarding/ConnectAi.tsx b/src/components/onboarding/ConnectAi.tsxindex 65d94e9272..b850c9ffa4 100644--- a/src/components/onboarding/ConnectAi.tsx+++ b/src/components/onboarding/ConnectAi.tsx@@ -3,9 +3,11 @@ import { Check, ChevronDown, LoaderCircle, RefreshCw, X } from "lucide-react";import { EngineSetup } from "@/components/EngineSetup";import { engineReady } from "@/components/EngineLibrary";import { InstanceProviderMark } from "@/components/ProviderIcons";+import { ModelgoOption } from "@/components/ModelgoOffer";import { cn } from "@/lib/cn";import { t } from "@/lib/i18n";import { engineDisplayName } from "@/lib/engine-name";+import { modelgoOfferable } from "@/lib/modelgo-offer";import { aiChoices, aiWorks, organisationSignIn, plainSignIn } from "@/lib/onboarding";import { api, useStore, type InstanceInfo } from "@/state/store";import { freeFallback } from "../../../shared/ai-ranking";@@ -77,6 +79,11 @@ export function ConnectAi({ hosted = false, tested }: { hosted?: boolean; testedconst connected = tested && aiWorks(tested) ? tested.instance : undefined;const backup = state.instances.find((instance) => engineReady(instance) && freeFallback(instance));const { recommended, others } = aiChoices(state.instances.filter((instance) => instance.install && !engineReady(instance)));+ const modelgoReady = state.instances.some((instance) => instance.driverKind === "modelgo" && engineReady(instance));+ // Hosted: the organization provides the AI and refuses a key of the person's own.+ const showModelgo = !hosted && !modelgoReady && modelgoOfferable(state.config?.managedPolicy);+ const modelgo = others.find((instance) => instance.driverKind === "modelgo");+ const otherRows = others.filter((instance) => !(showModelgo && instance === modelgo));return (<div className="flex w-full flex-col">@@ -124,7 +131,7 @@ export function ConnectAi({ hosted = false, tested }: { hosted?: boolean; tested)}{failed && <p role="alert" className="mt-2 text-[13px] text-danger">{t("onboarding.engines.error")}</p>}- {(organisation || others.length > 0) && (+ {(organisation || otherRows.length > 0 || showModelgo) && (<div className="mt-3 w-full divide-y divide-hairline/40 overflow-hidden rounded-2xl bg-card text-left">{organisation && (<OrganisationRow@@ -133,7 +140,10 @@ export function ConnectAi({ hosted = false, tested }: { hosted?: boolean; testedonConnected={() => void refresh()}/>)}- {others.map((instance) => (+ {showModelgo && <ModelgoOption open={open === "modelgo"} onToggle={() => setOpen(open === "modelgo" ? null : "modelgo")}>+ {modelgo && <EngineSetup instance={modelgo} {...setupFor(modelgo)} className="mx-4 mb-3.5 border-0 bg-inset" />}+ </ModelgoOption>}+ {otherRows.map((instance) => (<OtherWay key={instance.instanceId} instance={instance} open={open === instance.instanceId}onToggle={() => setOpen(open === instance.instanceId ? null : instance.instanceId)} />))}diff --git a/src/components/provider-mark-fade.ts b/src/components/provider-mark-fade.tsindex 8d1603f317..9978772828 100644--- a/src/components/provider-mark-fade.ts+++ b/src/components/provider-mark-fade.ts@@ -2,7 +2,7 @@ import type { InstanceInfo } from "@/state/store";export type ProviderMarkTone = "brand" | "mono";-const BRAND_DRIVERS: ReadonlySet<string> = new Set(["claudeAgent", "mistral", "meta", "museCode", "kimiAgent", "qwenAgent", "deepseekAgent", "greenference", "kiroAgent"]);+const BRAND_DRIVERS: ReadonlySet<string> = new Set(["claudeAgent", "mistral", "meta", "museCode", "kimiAgent", "qwenAgent", "deepseekAgent", "greenference", "modelgo", "kiroAgent"]);const MONO_PRESETS: ReadonlySet<string> = new Set(["openai", "xai", "ollama"]);export function providerMarkTone(instance: Pick<InstanceInfo, "driverKind" | "icon">): ProviderMarkTone {diff --git a/src/lib/analytics-allowlist.test.ts b/src/lib/analytics-allowlist.test.tsindex caf9b704f2..8cdae304f4 100644--- a/src/lib/analytics-allowlist.test.ts+++ b/src/lib/analytics-allowlist.test.ts@@ -76,7 +76,7 @@ describe("app, role and key lists", () => {const rows = Object.fromEntries(KEY_CATALOG.flatMap((entry) => entry.target ? [[entry.id, entry.target.analytics]] : []));expect(rows).toEqual({openai: "openai", anthropic: "anthropic", xai: "xai", openrouter: "openrouter", mistral: "mistral", cerebras: "cerebras", groq: "groq",- greenference: "greenference", meta: "meta", deepseek: "deepseek", opencodeGo: "opencode_go", openaiCompat: "openai_compat", liveKey: "openai_live",+ greenference: "greenference", modelgo: "modelgo", meta: "meta", deepseek: "deepseek", opencodeGo: "opencode_go", openaiCompat: "openai_compat", liveKey: "openai_live",elevenlabs: "elevenlabs", fishAudio: "fish_audio", geminiTts: "gemini_tts", box: "boat", composio: "composio", treg: "treg", jev: "jev",openrouterHelper: "openrouter_decider", imageOpenai: "openai_image", postiz: "postiz",});@@ -88,7 +88,7 @@ describe("app, role and key lists", () => {boxToken: "boat", xaiApiKey: "xai", opencodeGoApiKey: "opencode_go", ttsKey: "elevenlabs", fishAudioKey: "fish_audio", geminiTtsKey: "gemini_tts",openaiImageApiKey: "openai_image",onePasswordToken: "onepassword", composioApiKey: "composio", openaiApiKey: "openai", anthropicApiKey: "anthropic",- openrouterApiKey: "openrouter", mistralApiKey: "mistral", cerebrasApiKey: "cerebras", groqApiKey: "groq", greenferenceApiKey: "greenference", metaApiKey: "meta",+ openrouterApiKey: "openrouter", mistralApiKey: "mistral", cerebrasApiKey: "cerebras", groqApiKey: "groq", greenferenceApiKey: "greenference", modelgoApiKey: "modelgo", metaApiKey: "meta",deepseekApiKey: "deepseek",};expect(Object.keys(expected).sort()).toEqual(Object.keys(CREDENTIAL_TARGETS).sort());diff --git a/src/lib/analytics-allowlist.ts b/src/lib/analytics-allowlist.tsindex 8136b11c40..2150090b1b 100644--- a/src/lib/analytics-allowlist.ts+++ b/src/lib/analytics-allowlist.ts@@ -13,7 +13,7 @@ export function allow<const T extends string>(value: unknown, list: readonly T[]}export const KEY_PROVIDER = [- "anthropic", "openai", "openrouter", "openai_compat", "xai", "mistral", "cerebras", "groq", "greenference", "meta", "boat", "composio",+ "anthropic", "openai", "openrouter", "openai_compat", "xai", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "boat", "composio","opencode_go", "custom_endpoint", "elevenlabs", "fish_audio", "gemini_tts", "jev", "openrouter_decider", "openai_image", "custom_image","openai_live", "onepassword", "treg", "deepseek", "postiz",] as const;@@ -23,7 +23,7 @@ const CREDENTIAL_PROVIDER = new Map<string, KeyProvider>(Object.entries({boxToken: "boat", xaiApiKey: "xai", opencodeGoApiKey: "opencode_go", ttsKey: "elevenlabs", fishAudioKey: "fish_audio", geminiTtsKey: "gemini_tts",openaiImageApiKey: "openai_image", onePasswordToken: "onepassword", composioApiKey: "composio", openaiApiKey: "openai",anthropicApiKey: "anthropic", openrouterApiKey: "openrouter", mistralApiKey: "mistral", cerebrasApiKey: "cerebras", groqApiKey: "groq",- greenferenceApiKey: "greenference", metaApiKey: "meta", deepseekApiKey: "deepseek",+ greenferenceApiKey: "greenference", modelgoApiKey: "modelgo", metaApiKey: "meta", deepseekApiKey: "deepseek",} satisfies Record<CredentialTargetId, KeyProvider>));export function credentialProvider(target: unknown): KeyProvider | "other" {@@ -32,7 +32,7 @@ export function credentialProvider(target: unknown): KeyProvider | "other" {export const ENGINE = ["claude", "codex", "gemini", "cursor", "opencode", "qwen", "hermes", "cline", "custom_acp", "pi", "openai_compat", "grok",- "grok_api", "kimi", "droid", "antigravity", "minimax", "mistral", "cerebras", "groq", "greenference", "meta", "muse_code", "deepseek", "copilot", "command_code", "kiro",+ "grok_api", "kimi", "droid", "antigravity", "minimax", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "muse_code", "deepseek", "copilot", "command_code", "kiro",] as const;export type Engine = (typeof ENGINE)[number];@@ -40,7 +40,7 @@ const ENGINE_BY_DRIVER = new Map<string, Engine>(Object.entries({claudeAgent: "claude", codex: "codex", geminiAgent: "gemini", cursorAgent: "cursor", opencodeGo: "opencode",qwenAgent: "qwen", hermesAgent: "hermes", clineAgent: "cline", customAcp: "custom_acp", piAgent: "pi","openai-compat": "openai_compat", grokAgent: "grok", grok: "grok_api", kimiAgent: "kimi", droidAgent: "droid",- antigravityAgent: "antigravity", minimax: "minimax", mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference",+ antigravityAgent: "antigravity", minimax: "minimax", mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference", modelgo: "modelgo",meta: "meta", museCode: "muse_code", deepseekAgent: "deepseek", copilotAgent: "copilot", commandCodeAgent: "command_code", kiroAgent: "kiro",} satisfies Record<string, Engine>));diff --git a/src/lib/built-in-instances.ts b/src/lib/built-in-instances.tsindex 500c6ef0ec..8ae79b940f 100644--- a/src/lib/built-in-instances.ts+++ b/src/lib/built-in-instances.ts@@ -2,7 +2,7 @@export const BUILT_IN_INSTANCE_DRIVERS: Readonly<Record<string, string>> = {grok: "grokAgent", kimi: "kimiAgent", droid: "droidAgent", cursor: "cursorAgent", githubCopilot: "copilotAgent", commandCode: "commandCodeAgent", kiro: "kiroAgent", claude: "claudeAgent", codex: "codex",chatgpt: "codex", antigravity: "antigravityAgent", opencodeGo: "opencodeGo", openaiCompat: "openai-compat",- mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference", meta: "meta", museCode: "museCode", deepseek: "deepseekAgent", openai: "openai-compat",+ mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference", modelgo: "modelgo", meta: "meta", museCode: "museCode", deepseek: "deepseekAgent", openai: "openai-compat",claudeApi: "claudeAgent", xaiApi: "grok", openrouter: "openai-compat", qwen: "qwenAgent", hermes: "hermesAgent",cline: "clineAgent", pi: "piAgent", gemini: "geminiAgent",};diff --git a/src/lib/modelgo-offer.ts b/src/lib/modelgo-offer.tsnew file mode 100644index 0000000000..aace42dbcf--- /dev/null+++ b/src/lib/modelgo-offer.ts@@ -0,0 +1,18 @@+import { track } from "@/lib/analytics";+import { brandStatus } from "@/lib/brand";+import type { ManagedPolicySummary } from "@/state/config-status";++export type ModelgoOfferAction = "shown" | "get_key" | "add_key" | "not_now" | "close";+export type ModelgoOfferPlace = "popup" | "onboarding" | "settings";++export function reportModelgoOffer(action: ModelgoOfferAction, place: ModelgoOfferPlace) {+ track("modelgo_offer", { action, place });+}++/** Everywhere but a branded build and a desktop whose organization refuses the provider. A Team Cloud's own rules are not that+ * organization's: its people still see the sponsor's card. */+export function modelgoOfferable(policy: ManagedPolicySummary | null | undefined): boolean {+ if (brandStatus().source === "file") return false;+ if (!policy || policy.team) return true;+ return !policy.companyModelsOnly && (policy.allowedEngines === "all" || policy.allowedEngines.includes("modelgo"));+}diff --git a/src/lib/notices.test.ts b/src/lib/notices.test.tsindex dd03177309..ac811670f3 100644--- a/src/lib/notices.test.ts+++ b/src/lib/notices.test.ts@@ -2,7 +2,7 @@ import { afterEach, beforeEach, expect, it, vi } from "vitest";import { EMPTY_ONBOARDING, type OnboardingStatus } from "@/lib/onboarding";import { withTourReset } from "@/lib/guided-tour";import { DESKTOP_NOTICES } from "../../electron/desktop-prefs.mjs";-import { BOAT_OFFER_NOTICE, CLOUD_INTRO, CLOUD_NOTICE, CLOUD_TRIAL_NOTICE, dismissNotice, GROK_MOVE_NOTICE, introShown, introStage, launchNotice, localDay, markLaunchNotice, nextNotice, noticeSeen,+import { BOAT_OFFER_NOTICE, CLOUD_INTRO, CLOUD_NOTICE, CLOUD_TRIAL_NOTICE, dismissNotice, GROK_MOVE_NOTICE, introShown, introStage, launchNotice, localDay, markLaunchNotice, MODELGO_OFFER_NOTICE, nextNotice, noticeSeen,NOTICES, OLD_PRO_DISMISSALS, PRODUCT_HUNT_NOTICE, SIMPLE_MODE_NOTICE, STAR_NOTICE, TWO_PLACES_NOTICE, UPDATES_CONSENT_NOTICE, usedBefore, WHATS_NEW_NOTICE, type NoticeFacts } from "./notices";let storage: Map<string, string>, session: Map<string, string>;@@ -15,9 +15,9 @@ afterEach(() => vi.unstubAllGlobals());const record = (hintsSeen: string[] = []): OnboardingStatus => ({ ...EMPTY_ONBOARDING, completedAt: "2026-09-01", version: 1, hintsSeen });const facts = (intro: boolean | null, trial: boolean | null, cloud: boolean | null, star: boolean | null, launch: boolean | null = false, popup: boolean | null = false,- consent: boolean | null = false, simple: boolean | null = false, boat: boolean | null = false, two: boolean | null = false, grok: boolean | null = false): NoticeFacts =>+ consent: boolean | null = false, simple: boolean | null = false, boat: boolean | null = false, two: boolean | null = false, grok: boolean | null = false, modelgo: boolean | null = false): NoticeFacts =>({ [GROK_MOVE_NOTICE]: grok, [SIMPLE_MODE_NOTICE]: simple, [WHATS_NEW_NOTICE]: popup, [UPDATES_CONSENT_NOTICE]: consent, [TWO_PLACES_NOTICE]: two, [PRODUCT_HUNT_NOTICE]: launch, [CLOUD_INTRO]: intro, [CLOUD_TRIAL_NOTICE]: trial, [CLOUD_NOTICE]: cloud,- [BOAT_OFFER_NOTICE]: boat, [STAR_NOTICE]: star });+ [MODELGO_OFFER_NOTICE]: modelgo, [BOAT_OFFER_NOTICE]: boat, [STAR_NOTICE]: star });const none = () => false;const DAY = 86_400_000, NOON = new Date(2026, 9, 9, 12).getTime();@@ -35,7 +35,7 @@ it("is one queue: the Simple mode popup first, then What's new, the product-updaexpect(nextNotice(facts(true, true, true, true, true, true, true, true), none)).toBe(SIMPLE_MODE_NOTICE);expect(nextNotice(facts(true, true, true, true, true, true, true, null), none), "nothing shows while the Simple mode popup waits").toBeNull();expect(nextNotice(facts(true, true, true, true, true, true, true, true), id => id === SIMPLE_MODE_NOTICE)).toBe(WHATS_NEW_NOTICE);- expect(NOTICES).toEqual([GROK_MOVE_NOTICE, SIMPLE_MODE_NOTICE, WHATS_NEW_NOTICE, UPDATES_CONSENT_NOTICE, TWO_PLACES_NOTICE, PRODUCT_HUNT_NOTICE, CLOUD_INTRO, CLOUD_TRIAL_NOTICE, CLOUD_NOTICE, BOAT_OFFER_NOTICE, STAR_NOTICE]);+ expect(NOTICES).toEqual([GROK_MOVE_NOTICE, SIMPLE_MODE_NOTICE, WHATS_NEW_NOTICE, UPDATES_CONSENT_NOTICE, TWO_PLACES_NOTICE, PRODUCT_HUNT_NOTICE, CLOUD_INTRO, CLOUD_TRIAL_NOTICE, CLOUD_NOTICE, MODELGO_OFFER_NOTICE, BOAT_OFFER_NOTICE, STAR_NOTICE]);expect(nextNotice(facts(true, true, true, true, true, false, false, false, false, true), none), "bots in two places come before any promotion").toBe(TWO_PLACES_NOTICE);expect(nextNotice(facts(true, true, true, true, true, false, true, false, false, true), none), "after the product-updates question").toBe(UPDATES_CONSENT_NOTICE);expect(nextNotice(facts(true, true, true, true, true, false, false, false, false, null), none), "nothing lower shows while main hasn't answered").toBeNull();@@ -67,7 +67,7 @@ it("is one queue: the Simple mode popup first, then What's new, the product-upda});it("Boat's credit offer and the Grok Bot move are ones the desktop keeps for its every page, as What's new is", () => {- expect(DESKTOP_NOTICES).toEqual([WHATS_NEW_NOTICE, BOAT_OFFER_NOTICE, GROK_MOVE_NOTICE]);+ expect(DESKTOP_NOTICES).toEqual([WHATS_NEW_NOTICE, BOAT_OFFER_NOTICE, GROK_MOVE_NOTICE, MODELGO_OFFER_NOTICE]);});it("one notice a launch: What's new goes first and Boat's credit offer waits for a later launch; only the product-updates question may follow", () => {@@ -172,3 +172,16 @@ it("someone has used the app before when a conversation from before this launchexpect(usedBefore([{ tasks: [task(launch - 1, 0), task(launch - 1)] }, {}], launch)).toBe(false);expect(usedBefore([{}, { tasks: [task(launch + 5, 2), task(launch - 9, 2)] }], launch)).toBe(true);});++it("ModelGo's card follows update consent and the account's notices, and goes before every other promotion after them", () => {+ const modelgo = ({ consent = false, trial = false, cloud = false, offer = true, boat = true }: { consent?: boolean | null; trial?: boolean | null; cloud?: boolean | null; offer?: boolean | null; boat?: boolean | null }) =>+ facts(false, trial, cloud, true, false, false, consent, false, boat, false, false, offer);+ expect(nextNotice(modelgo({}), none)).toBe(MODELGO_OFFER_NOTICE);+ expect(nextNotice(modelgo({ consent: true }), none), "the product-updates question goes first").toBe(UPDATES_CONSENT_NOTICE);+ expect(nextNotice(modelgo({ consent: null }), none), "and holds it while main hasn't answered").toBeNull();+ expect(nextNotice(modelgo({ trial: true }), none), "a trial's notice goes first").toBe(CLOUD_TRIAL_NOTICE);+ expect(nextNotice(modelgo({ cloud: true }), none), "so does the account's card").toBe(CLOUD_NOTICE);+ expect(nextNotice(modelgo({ offer: null }), none), "Boat and the star wait for it").toBeNull();+ expect(nextNotice(modelgo({}), id => id === MODELGO_OFFER_NOTICE), "seen once, then Boat").toBe(BOAT_OFFER_NOTICE);+ expect(MODELGO_OFFER_NOTICE).toBe("modelgo-offer-2026-11");+});diff --git a/src/lib/notices.ts b/src/lib/notices.tsindex e9278dd94d..17072de0c0 100644--- a/src/lib/notices.ts+++ b/src/lib/notices.ts@@ -17,6 +17,8 @@ export const PRODUCT_HUNT_UNTIL = Date.UTC(2026, 10, 1);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. */+export const MODELGO_OFFER_NOTICE = "modelgo-offer-2026-11";/*** Every notice, in the order a launch asks them: one launch shows one notice, the first one due, and only the product-updates@@ -32,6 +34,7 @@ export const NOTICES = [CLOUD_INTRO,CLOUD_TRIAL_NOTICE,CLOUD_NOTICE,+ MODELGO_OFFER_NOTICE,BOAT_OFFER_NOTICE,STAR_NOTICE,] as const;diff --git a/src/lib/usage-snapshot.ts b/src/lib/usage-snapshot.tsindex c42db24d74..76da6661b8 100644--- a/src/lib/usage-snapshot.ts+++ b/src/lib/usage-snapshot.ts@@ -54,6 +54,7 @@ function keyProviders(config: ConfigStatus): KeyProvider[] {[config.cerebras?.configured, "cerebras"],[config.groq?.configured, "groq"],[config.greenference?.configured, "greenference"],+ [config.modelgo?.configured, "modelgo"],[config.meta?.configured, "meta"],[config.box?.configured && config.box.included !== true, "boat"],[config.composio?.configured && config.composio.mode === "self-hosted", "composio"],diff --git a/src/locales/en.json b/src/locales/en.jsonindex 74ec718645..7a30e60407 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -462,6 +462,12 @@"boatOffer.get": "Get Boat","boatOffer.claim": "I bought it: claim my $50","boatOffer.mailFailed": "Couldn't open your email app. Write to {address} instead.",+ "modelgoOffer.title": "ModelGo is now in MausBot",+ "modelgoOffer.line": "One API key, every model.",+ "modelgoOffer.sponsor": "Sponsor",+ "modelgoOffer.getKey": "Get a ModelGo key",+ "modelgoOffer.name": "ModelGo",+ "modelgoOffer.link": "Get a key","cloudIntro.badge.one": "Free for 1 day","cloudIntro.badge.many": "Free for {days} days","cloudIntro.title": "Keep your bots working when this computer is off",@@ -3916,6 +3922,9 @@"keys.groq.link": "Groq docs","keys.greenference.label": "Greenference API key","keys.greenference.placeholder": "Paste your Greenference API key",+ "keys.modelgo.label": "ModelGo API key",+ "keys.modelgo.placeholder": "Paste your ModelGo API key",+ "keys.modelgo.note": "Make a key in the ModelGo console, under API Keys.","keys.meta.label": "Meta Model API key","keys.meta.desc": "For Meta's Muse models, including Muse Wonder. Adds Meta Muse to your AI choices; new Muse models appear on their own.","keys.meta.link": "Meta Model API",@@ -7702,6 +7711,7 @@"keys.purpose.cerebras": "Open models on very fast chips","keys.purpose.groq": "Open models served fast by Groq","keys.purpose.greenference": "Open models run on solar power in Europe",+ "keys.purpose.modelgo": "One API key, every model","keys.purpose.meta": "Meta's Muse models","keys.purpose.deepseek": "DeepSeek Harness","keys.purpose.opencodeGo": "OpenCode Zen and Go",@@ -9748,6 +9758,7 @@"mcp.request.change": "Change","mcp.request.remove": "Remove","secretCard.greenference.description": "Runs Greenference models with your own key.",+ "secretCard.modelgo.description": "Runs ModelGo models with your own key.","secretCard.geminiTts.description": "Generates spoken replies, voice notes and call speech with Gemini.","chat.notice.elicitationUrlDeclined": "{server} asked you to open a link to continue. OpenMausBot can't open it from here, so the request was declined. Open the link yourself, then ask the bot to try again.","chat.notice.elicitationUrlDeclinedWithUrl": "{server} asked you to open a link to continue: {url}. OpenMausBot can't open it from here, so the request was declined. Open the link yourself, then ask the bot to try again.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 453b60d48a..94fc501eed 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -442,6 +442,12 @@"boatOffer.get": "Contratar o Boat","boatOffer.claim": "Resgatar meus US$ 50 (já comprei)","boatOffer.mailFailed": "Não foi possível abrir seu app de e-mail. Escreva para {address}.",+ "modelgoOffer.title": "O ModelGo já está no MausBot",+ "modelgoOffer.line": "Uma chave de API, todos os modelos.",+ "modelgoOffer.sponsor": "Patrocinador",+ "modelgoOffer.getKey": "Obter uma chave do ModelGo",+ "modelgoOffer.name": "ModelGo",+ "modelgoOffer.link": "Obter uma chave","productHunt.title": "Estamos no ar no Product Hunt","productHunt.body": "O MausBot acabou de ser lançado. Seu voto significaria muito para nós.","productHunt.button": "Votar no Product Hunt",@@ -3778,6 +3784,9 @@"keys.groq.link": "Documentação da Groq","keys.greenference.label": "Chave de API do Greenference","keys.greenference.placeholder": "Cole sua chave de API do Greenference",+ "keys.modelgo.label": "Chave de API do ModelGo",+ "keys.modelgo.placeholder": "Cole sua chave de API do ModelGo",+ "keys.modelgo.note": "Crie uma chave no console do ModelGo, em API Keys.","keys.meta.label": "Chave da Meta Model API","keys.meta.desc": "Para os modelos Muse da Meta, incluindo o Muse Wonder. Adiciona o Meta Muse às suas opções de IA. Novos modelos Muse aparecem automaticamente.","keys.meta.link": "Meta Model API",@@ -7612,6 +7621,7 @@"keys.purpose.cerebras": "Modelos abertos em chips muito rápidos","keys.purpose.groq": "Modelos abertos com a velocidade da Groq","keys.purpose.greenference": "Modelos abertos que rodam com energia solar na Europa",+ "keys.purpose.modelgo": "Uma chave de API, todos os modelos","keys.purpose.meta": "Modelos Muse da Meta","keys.purpose.deepseek": "DeepSeek Harness","keys.purpose.opencodeGo": "OpenCode Zen e Go",@@ -9701,6 +9711,7 @@"mcp.request.change": "Alterar","mcp.request.remove": "Remover","secretCard.greenference.description": "Roda modelos do Greenference com sua própria chave.",+ "secretCard.modelgo.description": "Roda modelos do ModelGo com sua própria chave.","secretCard.geminiTts.description": "Gera respostas faladas, mensagens de voz e a fala das chamadas com o Gemini.","chat.notice.elicitationUrlDeclined": "{server} pediu que você abrisse um link para continuar. O OpenMausBot não pode abri-lo por aqui, então o pedido foi recusado. Abra o link e peça ao bot para tentar novamente.","chat.notice.elicitationUrlDeclinedWithUrl": "{server} pediu que você abrisse um link para continuar: {url}. O OpenMausBot não pode abri-lo por aqui, então o pedido foi recusado. Abra o link e peça ao bot para tentar novamente.",diff --git a/src/state/config-status.ts b/src/state/config-status.tsindex 5ab7aaffa6..4ce7c1ea18 100644--- a/src/state/config-status.ts+++ b/src/state/config-status.ts@@ -20,6 +20,7 @@ export interface ConfigStatus {cerebras?: SavedKey;groq?: SavedKey;greenference?: SavedKey;+ modelgo?: SavedKey;deepseek?: SavedKey;meta?: SavedKey;/** X research comes with MausBot Cloud plans: `included` while this server holds the plan's relay credential;diff --git a/src/state/store.tsx b/src/state/store.tsxindex 81462941e0..90b09a9b2f 100644--- a/src/state/store.tsx+++ b/src/state/store.tsx@@ -407,7 +407,7 @@ export type { BrowserEngineSummary, BrowserProfile, ConfigStatus, ManagedPolicyS// A section left out here is wiped from state.config whenever a config frame lands.export type ConfigStatusFrame = Pick<ConfigStatus,- "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "meta" | "deepseek" | "xResearch" | "treg" | "postiz" | "anthropic" | "openai" | "openrouter" | "openaiCompat" | "fleet" | "composio" | "box" | "vps" | "rooms" | "mcp" | "threads" | "automaticRecovery" | "cacheKeepWarm" | "localVm" | "opencodeGo" | "tts" | "decider" | "helpers" | "imageGen" | "live" | "savedKeys" | "profile" | "everyBotRules" | "language" | "features" | "onboarding" | "browserEngine" | "browserProfiles" | "edition" | "budgets" | "billing" | "managedPolicy" | "cloudHome" | "team" | "workspaceBanner"+ "xai" | "mistral" | "cerebras" | "groq" | "greenference" | "modelgo" | "meta" | "deepseek" | "xResearch" | "treg" | "postiz" | "anthropic" | "openai" | "openrouter" | "openaiCompat" | "fleet" | "composio" | "box" | "vps" | "rooms" | "mcp" | "threads" | "automaticRecovery" | "cacheKeepWarm" | "localVm" | "opencodeGo" | "tts" | "decider" | "helpers" | "imageGen" | "live" | "savedKeys" | "profile" | "everyBotRules" | "language" | "features" | "onboarding" | "browserEngine" | "browserProfiles" | "edition" | "budgets" | "billing" | "managedPolicy" | "cloudHome" | "team" | "workspaceBanner">;export function configStatusFromFrame(frame: ConfigStatusFrame): ConfigStatus {@@ -415,7 +415,7 @@ export function configStatusFromFrame(frame: ConfigStatusFrame): ConfigStatus {xai: frame.xai,mistral: frame.mistral,cerebras: frame.cerebras,- groq: frame.groq, greenference: frame.greenference, deepseek: frame.deepseek,+ groq: frame.groq, greenference: frame.greenference, modelgo: frame.modelgo, deepseek: frame.deepseek,meta: frame.meta, xResearch: frame.xResearch, treg: frame.treg, postiz: frame.postiz,anthropic: frame.anthropic,openai: frame.openai,diff --git a/src/types/ogb.d.ts b/src/types/ogb.d.tsindex 01fc4beb51..ee4832ee86 100644--- a/src/types/ogb.d.ts+++ b/src/types/ogb.d.ts@@ -455,7 +455,7 @@ const __APP_VERSION__: string;credentialStore?: { unreadable(): Promise<boolean>; reset(): Promise<"reset" | "cancelled" | "quitting" | "failed" | "readable"> };/** Save a provider credential through Electron's OS-backed store. */setCredential?(- name: "openaiApiKey" | "anthropicApiKey" | "openrouterApiKey" | "mistralApiKey" | "cerebrasApiKey" | "groqApiKey" | "greenferenceApiKey" | "metaApiKey" | "deepseekApiKey" | "openaiCompatApiKey" | "composioApiKey" | "xaiApiKey" | "boxToken" | "opencodeGoApiKey" | "ttsKey" | "fishAudioKey" | "geminiTtsKey" | "jevApiKey" | "openrouterDeciderKey" | "workersAiToken" | "openaiImageApiKey" | "customImageApiKey" | "openaiLiveKey" | "tregApiKey" | "postizApiKey" | "geminiImageApiKey",+ name: "openaiApiKey" | "anthropicApiKey" | "openrouterApiKey" | "mistralApiKey" | "cerebrasApiKey" | "groqApiKey" | "greenferenceApiKey" | "modelgoApiKey" | "metaApiKey" | "deepseekApiKey" | "openaiCompatApiKey" | "composioApiKey" | "xaiApiKey" | "boxToken" | "opencodeGoApiKey" | "ttsKey" | "fishAudioKey" | "geminiTtsKey" | "jevApiKey" | "openrouterDeciderKey" | "workersAiToken" | "openaiImageApiKey" | "customImageApiKey" | "openaiLiveKey" | "tregApiKey" | "postizApiKey" | "geminiImageApiKey",value: string,options?: { everyClaudeBot?: false },): Promise<ConfigStatus>;