Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Simple Bot settings: a bot's backup AIs, working with no switch (#3905)
Milind Soni5b4311b50cf0
diff --git a/docs/verification/automatic-recovery.md b/docs/verification/automatic-recovery.mdindex 18cfbeb5a2..a0cebde0cf 100644--- a/docs/verification/automatic-recovery.md+++ b/docs/verification/automatic-recovery.md@@ -1,7 +1,14 @@# Automatic recovery-Settings → General → Automatic recovery is off by default. Choose one backup-engine/model and save. When an ACP engine fails during startup, before sending+A bot's own backups (Model → Backup models for this bot in Advanced, Bot+settings → Backup AIs in Simple) are used in order with no switch: choosing one+turns it on for that bot. Settings → General → Automatic recovery is off by+default; turned on with one backup engine/model, it covers every bot that has+no backups of its own. The same lists also feed the usage-limit takeover+(`server/host/limit-takeover.ts`), which never needed the switch: at a usage+limit a conversation moves to the first of them that can take over (for one+model's own limit, that AI's default model goes first) and goes back once the+limit resets. When an ACP engine fails during startup, before sendingthe prompt or receiving any tool, permission, file or assistant activity, thedriver can report a recoverable failure **only after its process has stopped**.Claude can also report a refused sign-in before any model or tool activity.@@ -39,9 +46,10 @@ pnpm i18n:checkThe recovery integration suite launches `launchVerificationServer` in atemporary home, then configures only fake ACP and Claude engines there. It-checks one backup dispatch, retained history, one user message, unchanged-permissions/defaults/siblings, bounded failure, no replay after prompt/output,-Stop/new-message precedence and settings validation. A signed-out fake Claude+checks one backup dispatch, a bot's own list with Automatic recovery on and+off, no dispatch to the app-wide backup while it is off, retained history, one+user message, unchanged permissions/defaults/siblings, bounded failure, no+replay after prompt/output, Stop/new-message precedence and settings validation. A signed-out fake Clauderecovers through fake Codex with one user message and unchanged bot defaultsand permissions. Driver checks refuse recovery after activity or failed cleanup.A coordinated specialist@@ -54,3 +62,30 @@ used. Driver tests also cover failed cleanup and pre-prompt file/tool activity.Settings tests cover the real component's controls, drafts, validation andsave errors. These are not an Electron visual walkthrough or proof of a realprovider's availability, model quality, or a general cure for idle timeouts.++## Simple mode++Simple's Bot settings (the gear on the bot panel) shows the same list as+**Backup AIs**: Add and change open the Simple model menu without the bot's own+AI or ones already listed, the bin removes one, and the list keeps its order (up+to five). There is no switch; the card says when a backup is used.++```sh+pnpm exec vitest run src/components/bot-panel/BackupAis.dom.test.ts src/components/BotSettingsDialog.simple.test.ts src/components/bot-settings/ModelSection.test.ts+```++The pictures come from `control-omb ui launch --engine codex` (fake Claude and+fake Codex in a disposable home): adding Codex in Simple saved+`fallback: [{ instanceId: "codex", model: "gpt-fake-default" }]` on the bot and+left `automaticRecovery` at `{ enabled: false }`.++| Before | After |+| --- | --- |+|  |  |++| Adding | Changing | At 390px |+| --- | --- | --- |+|  |  |  |++Advanced shows the same list under Model, with words that no longer depend on+the switch: diff --git a/docs/verification/evidence/simple-backup-models/after-add-menu.png b/docs/verification/evidence/simple-backup-models/after-add-menu.pngnew file mode 100644index 0000000000..aca634362dBinary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-add-menu.png differdiff --git a/docs/verification/evidence/simple-backup-models/after-advanced-model.png b/docs/verification/evidence/simple-backup-models/after-advanced-model.pngnew file mode 100644index 0000000000..2d6e8c2526Binary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-advanced-model.png differdiff --git a/docs/verification/evidence/simple-backup-models/after-bot-settings-empty.png b/docs/verification/evidence/simple-backup-models/after-bot-settings-empty.pngnew file mode 100644index 0000000000..854765d9d3Binary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-bot-settings-empty.png differdiff --git a/docs/verification/evidence/simple-backup-models/after-bot-settings.png b/docs/verification/evidence/simple-backup-models/after-bot-settings.pngnew file mode 100644index 0000000000..1e9fb8ea4dBinary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-bot-settings.png differdiff --git a/docs/verification/evidence/simple-backup-models/after-change-menu.png b/docs/verification/evidence/simple-backup-models/after-change-menu.pngnew file mode 100644index 0000000000..81b236a96eBinary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-change-menu.png differdiff --git a/docs/verification/evidence/simple-backup-models/after-phone-390.png b/docs/verification/evidence/simple-backup-models/after-phone-390.pngnew file mode 100644index 0000000000..fe00ef0d71Binary files /dev/null and b/docs/verification/evidence/simple-backup-models/after-phone-390.png differdiff --git a/docs/verification/evidence/simple-backup-models/before-bot-settings.png b/docs/verification/evidence/simple-backup-models/before-bot-settings.pngnew file mode 100644index 0000000000..d51026b4a6Binary files /dev/null and b/docs/verification/evidence/simple-backup-models/before-bot-settings.png differdiff --git a/server/automatic-recovery.e2e.test.ts b/server/automatic-recovery.e2e.test.tsindex daa00e690b..453825caf3 100644--- a/server/automatic-recovery.e2e.test.ts+++ b/server/automatic-recovery.e2e.test.ts@@ -262,8 +262,8 @@ it("recovers a coordinated specialist and returns its result to the Chief exactl});}, 90_000);-it("uses the ordered bot list only for proven pre-prompt failures and leaves defaults and siblings unchanged", async () => {- await withRecoveryFixture({}, async ({ api, control, calls, backupPrompts, evidence }) => {+it.each([true, false])("uses the ordered bot list only for proven pre-prompt failures and leaves defaults and siblings unchanged (Automatic recovery on: %s)", async (enabled) => {+ await withRecoveryFixture({ enabled }, async ({ api, control, calls, backupPrompts, evidence }) => {const { bot } = await control("new-bot", "--name", "Ordered startup fallback");const threadId = bot.activeTaskId;await api("PATCH", `/api/bots/${bot.id}/tasks/${threadId}`, { modelSelection: primary, updateBotDefault: true });@@ -287,16 +287,16 @@ it("uses the ordered bot list only for proven pre-prompt failures and leaves def}, 90_000);it.each([- { name: "disabled", enabled: false },+ { name: "disabled and the bot has no backups of its own", enabled: false, ownBackups: false },{ name: "prompt already accepted", method: "session/prompt" },{ name: "partial output", method: "session/prompt", afterOutput: true },{ name: "authentication failure", error: { code: -32603, message: "Authentication required: invalid API key" } },-])("does not automatically replay when $name", async ({ name: _name, ...options }) => {+])("does not automatically replay when $name", async ({ name: _name, ownBackups = true, ...options }) => {await withRecoveryFixture(options, async ({ api, control, calls, backupPrompts }) => {const { bot } = await control("new-bot", "--name", "No replay");const threadId = bot.activeTaskId;await api("PATCH", `/api/bots/${bot.id}/tasks/${threadId}`, { modelSelection: primary, updateBotDefault: true });- await api("PATCH", `/api/bots/${bot.id}`, { fallback: [{ instanceId: "secondary", model: primary.model }, backup] });+ if (ownBackups) await api("PATCH", `/api/bots/${bot.id}`, { fallback: [{ instanceId: "secondary", model: primary.model }, backup] });await control("send", "--bot", bot.id, "--task", threadId, "--text", "DO_NOT_REPLAY_THIS_9S");expect((await control("wait", "--bot", bot.id, "--task", threadId, "--timeout", "30")).status).toBe(options.afterOutput ? "settled" : "failed");diff --git a/server/automatic-recovery.test.ts b/server/automatic-recovery.test.tsindex b982517f2d..b380abb254 100644--- a/server/automatic-recovery.test.ts+++ b/server/automatic-recovery.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { recoveryCapabilityError } from "./automatic-recovery.ts";+import { recoveryCapabilityError, startupBackups } from "./automatic-recovery.ts";describe("automatic recovery capabilities", () => {const engine = { driverKind: "qwenAgent", capabilities: {@@ -16,3 +16,21 @@ describe("automatic recovery capabilities", () => {expect(recoveryCapabilityError(engine, { ...engine, driverKind: "openai-compat" })).toMatch(/same workspace/);});});++describe("startup backups", () => {+ const own = [{ instanceId: "codex", model: "gpt-5.5" }, { instanceId: "gemini", model: "gemini-3-pro" }];+ const app = { instanceId: "qwen", model: "qwen3-coder" };+ it("tries a bot's own backups in order whether or not Automatic recovery is on", () => {+ expect(startupBackups({ fallback: own }, { enabled: false })).toEqual(own);+ expect(startupBackups({ fallback: own }, { enabled: false, backup: app })).toEqual(own);+ expect(startupBackups({ fallback: own }, { enabled: true, backup: app })).toEqual(own);+ expect(startupBackups({ fallback: own })).toEqual(own);+ });+ it("uses the installation's backup only while Automatic recovery is on, for a bot with none of its own", () => {+ expect(startupBackups({ fallback: [] }, { enabled: true, backup: app })).toEqual([app]);+ expect(startupBackups({}, { enabled: true, backup: app })).toEqual([app]);+ expect(startupBackups({}, { enabled: false, backup: app })).toEqual([]);+ expect(startupBackups({}, { enabled: false })).toEqual([]);+ expect(startupBackups({})).toEqual([]);+ });+});diff --git a/server/automatic-recovery.ts b/server/automatic-recovery.tsindex 5a38840849..0de8798e5b 100644--- a/server/automatic-recovery.ts+++ b/server/automatic-recovery.ts@@ -1,7 +1,16 @@import type { ProviderAdapter } from "./contracts.ts";import { supportsWorkspaceFiles } from "./workspace.ts";+import type { ModelSelection } from "../shared/wire.ts";type Engine = { driverKind: string; capabilities: ProviderAdapter["capabilities"] };+type Backup = Pick<ModelSelection, "instanceId" | "model">;++/** The backups a bot's turn tries, in order, when its AI provably never started it: the bot's own list, which needs no+ * switch, or else the installation's one backup while Automatic recovery is on. */+export function startupBackups(bot: { fallback?: Backup[] }, recovery?: { enabled: boolean; backup?: Backup }): Backup[] {+ if (bot.fallback?.length) return bot.fallback;+ return recovery?.enabled && recovery.backup ? [recovery.backup] : [];+}/** An automatic switch must not strand the task without its tools or move its filesystem to another machine. */export function recoveryCapabilityError(from: Engine, to: Engine): string | undefined {diff --git a/server/index.ts b/server/index.tsindex cc688257b9..aff5598ae4 100644--- a/server/index.ts+++ b/server/index.ts@@ -209,7 +209,7 @@ import {newId,} from "./contracts.ts";import { RETRY_MAX_ATTEMPTS } from "./drivers/retry.ts";-import { recoveryCapabilityError } from "./automatic-recovery.ts";+import { recoveryCapabilityError, startupBackups } from "./automatic-recovery.ts";import { createQuotaSwitchHost } from "./host/quota-switch.ts"; import { quotaSwitchEnabled } from "./quota-switch.ts";import { decodeGeneratedImage } from "./generated-image.ts";import { createMcpServersHost } from "./host/mcp-servers-host.ts"; import { createLimitTakeover } from "./host/limit-takeover.ts";@@ -8534,7 +8534,7 @@ async function startTurn(handoffs.dispatching(threadId, dispatchClaimId, dispatchContext.handoff);const clock = takesTurnClock(userTurnText) ? turnClockLine(Date.now(), hostTimeZone()) + nearLimitNote(limitClock.limit(instanceId), engineName(instanceId), hostTimeZone()) : "";const shareNote = skillsHost.shareNote(bot, threadId, Boolean(privateWorkspace));- const startupRecovery = cfg.automaticRecovery?.enabled === true && (opts?.automaticRecoveryIndex ?? 0) < ((liveBot ?? bot).fallback?.length || (cfg.automaticRecovery.backup ? 1 : 0));+ const startupRecovery = (opts?.automaticRecoveryIndex ?? 0) < startupBackups(liveBot ?? bot, cfg.automaticRecovery).length;const engineHeld = limitClock.blockedUntil(instanceId), modelHeld = engineHeld ? null : limitTakeover.modelHeld({ instanceId, model }), limitScope = engineHeld ? "engine" as const : modelHeld?.scope ?? "engine", limitResets = engineHeld ? limitClock.resetAt(instanceId) ?? undefined : modelHeld?.resetsAt;// A limit already known: the turn goes straight to an AI that can carry on, with the reset only when one was named.if ((engineHeld || modelHeld) && (startupRecovery || (quotaSwitchEnabled() && limitTakeover.backups(bot.id, { instanceId, model }, limitScope).length))) throw new TurnUsageLimitRefusedError(`limit-${randomUUID()}`, `${engineName(instanceId)} is at its usage limit.`, limitResets && limitResets > Date.now() ? limitResets : undefined, limitScope, true);@@ -8663,9 +8663,8 @@ async function startTurn(if (e instanceof PlaceUnavailableError) clearFailedAutoPin(bot.id, threadId, e.place);let message = e instanceof Error ? e.message : String(e);const current = store.projectBotForTask(bot.id, threadId);- const backups = e instanceof TurnUsageLimitRefusedError && current && quotaSwitchEnabled() ? limitTakeover.backups(bot.id, current.modelSelection, e.scope) : cfg.automaticRecovery?.enabled- ? current?.fallback?.length ? current.fallback : cfg.automaticRecovery.backup ? [cfg.automaticRecovery.backup] : []- : [];+ const backups = e instanceof TurnUsageLimitRefusedError && current && quotaSwitchEnabled() ? limitTakeover.backups(bot.id, current.modelSelection, e.scope)+ : current ? startupBackups(current, cfg.automaticRecovery) : [];const nextIndex = backups.findIndex((candidate, index) => index >= (opts?.automaticRecoveryIndex ?? 0) &®istry.get(candidate.instanceId)?.enabled && (e instanceof TurnUsageLimitRefusedError ? (candidate.instanceId === instanceId ? e.scope !== "engine" : limitBackupAllowed(instance, registry.get(candidate.instanceId)!, instanceConfigs(cfg)[candidate.instanceId])): !(e instanceof TurnAuthenticationRefusedError) || candidate.instanceId !== instanceId) &&@@ -8882,7 +8881,7 @@ const automationDestinations = createAutomationDestinations({ store, mainThread:cloud: CLOUD_HOME ? { owner: CLOUD_OWNER_KEY!, opener: routineOpener, reportFromOthers: cloudReportFromOthers, opened: (threadId, person) => threadStarters.set(threadId, person) } : null });routines = new RoutineManager({emit: broadcast, limitResetAt: (engine) => limitClock.resetAt(engine), checks: proactive.checks,- limitBackup: (botId, scope) => { const bot = store.bot(botId); return quotaSwitchEnabled() ? Boolean(bot && limitTakeover.backups(botId, bot.modelSelection, scope).length) : cfg.automaticRecovery?.enabled === true && Boolean(bot?.fallback?.length || cfg.automaticRecovery.backup); },+ limitBackup: (botId, scope) => { const bot = store.bot(botId); return quotaSwitchEnabled() ? Boolean(bot && limitTakeover.backups(botId, bot.modelSelection, scope).length) : Boolean(bot && startupBackups(bot, cfg.automaticRecovery).length); },launchId: DESKTOP_MANAGED && /^[\w-]{1,100}$/.test(process.env.OMB_DESKTOP_LAUNCH_ID ?? "")? process.env.OMB_DESKTOP_LAUNCH_ID : undefined,skipStartupRuns: Boolean(CLOUD_HOME) && wokeFromSleep(DATA_DIR), // a Cloud home waking from a sleep it was stopped fordiff --git a/src/components/AutomaticRecoverySettings.test.ts b/src/components/AutomaticRecoverySettings.test.tsindex 2ceea11432..a9262ad1ca 100644--- a/src/components/AutomaticRecoverySettings.test.ts+++ b/src/components/AutomaticRecoverySettings.test.ts@@ -63,7 +63,7 @@ beforeEach(() => {});describe("AutomaticRecoverySettings", () => {- it("starts off and explains scope, bounded recovery, no replay and provider charges", () => {+ it("starts off and explains scope, bounded recovery, no replay, provider charges and that a bot's own backups need no switch", () => {const view = render();expect(view.toggle.props.checked).toBe(false);expect(view.engine.props.disabled).toBe(true);@@ -76,7 +76,8 @@ describe("AutomaticRecoverySettings", () => {expect(view.html).toContain("can incur charges from its provider");expect(view.html).toContain('for="automatic-recovery-engine"');expect(view.html).toContain('for="automatic-recovery-model"');- expect(view.html).toContain('aria-describedby="automatic-recovery-help automatic-recovery-scope"');+ expect(view.html).toContain("Bots with backups of their own (Model → Backup models for this bot) use those instead, whether or not this is on.");+ expect(view.html).toContain('aria-describedby="automatic-recovery-help automatic-recovery-scope automatic-recovery-own"');});it("requires a ready backup, preserves drafts through broadcasts and failed saves, and saves only once", async () => {diff --git a/src/components/AutomaticRecoverySettings.tsx b/src/components/AutomaticRecoverySettings.tsxindex 5810525a9c..349f83c797 100644--- a/src/components/AutomaticRecoverySettings.tsx+++ b/src/components/AutomaticRecoverySettings.tsx@@ -42,11 +42,12 @@ export function AutomaticRecoverySettings() {<div className="flex items-center justify-between gap-4"><label htmlFor="automatic-recovery-enabled" className="text-[13px] font-medium text-ink">{t("settings.recovery.enable")}</label><Switch id="automatic-recovery-enabled" checked={value.enabled} disabled={saving || !state.config}- aria-describedby="automatic-recovery-help automatic-recovery-scope"+ aria-describedby="automatic-recovery-help automatic-recovery-scope automatic-recovery-own"onClick={() => change({ ...value, enabled: !value.enabled })} /></div><p id="automatic-recovery-help" className="mt-2 text-[12px] leading-relaxed text-ink-secondary">{t("settings.recovery.help")}</p><p id="automatic-recovery-scope" className="mt-2 text-[12px] leading-relaxed text-ink-secondary">{t("settings.recovery.scope")}</p>+ <p id="automatic-recovery-own" className="mt-2 text-[12px] leading-relaxed text-ink-secondary">{t("settings.recovery.ownBackups")}</p><div className="mt-4 grid gap-3 sm:grid-cols-2"><div className="min-w-0"><label htmlFor="automatic-recovery-engine" className="block text-[13px] font-medium text-ink">{t("settings.recovery.engine")}</label>diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.tsindex 0d70d24dc8..ee96b6bca5 100644--- a/src/components/BotSettingsDialog.simple.test.ts+++ b/src/components/BotSettingsDialog.simple.test.ts@@ -645,14 +645,14 @@ describe("the Details tab", () => {});describe("the Bot settings page", () => {- it("holds Instructions, Before it acts, Call mode, Apps, Job and Hide, with every title on one edge", () => {+ it("holds Instructions, Before it acts, Backup AIs, Call mode, Apps, Job and Hide, with every title on one edge", () => {const rendered = settingsPage(makeBot({ defaultBot: {} }));- const order = ['data-panel-edit="soul"', 'data-panel-row="approval"', 'data-panel-row="call-mode"', 'data-panel-page="apps"', 'data-panel-row="job"', 'data-panel-row="default-bot-hide"']+ const order = ['data-panel-edit="soul"', 'data-panel-row="approval"', 'data-panel-row="backups"', 'data-panel-row="call-mode"', 'data-panel-page="apps"', 'data-panel-row="job"', 'data-panel-row="default-bot-hide"'].map((marker) => rendered.html.indexOf(marker));expect(order.every((index) => index > -1)).toBe(true);expect([...order].sort((a, b) => a - b)).toEqual(order);expect(switches(rendered.html)).toBe(0);- expect(rendered.html.match(/pl-\[38px\]/g)).toHaveLength(2);+ expect(rendered.html.match(/pl-\[38px\]/g)).toHaveLength(4);});it("shows the first line of the instructions, or how to start, and edits them in place with Done", () => {diff --git a/src/components/ModelPicker.tsx b/src/components/ModelPicker.tsxindex 335ec17590..c654e8fb51 100644--- a/src/components/ModelPicker.tsx+++ b/src/components/ModelPicker.tsx@@ -1,4 +1,4 @@-import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from "react";+import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from "react";import { createPortal } from "react-dom";import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, KeyRound, Loader2, RefreshCw, X } from "lucide-react";import { useStore, currentTaskBot, type AppState, type Bot, type InstanceInfo, type ModelSelection } from "@/state/store";@@ -10,7 +10,7 @@ import { modelName, simpleModelMenu } from "@/lib/simple-model-menu";import { choiceIsSelected, modelChoices, modelSelectionForPick, type ModelChoice } from "@/lib/model-choices";export { modelSelectionForPick } from "@/lib/model-choices";import { pickerPlacement, type PickerPlacement } from "@/lib/picker-placement";-import { isTypeaheadKey, TYPEAHEAD_RESET_MS, typeaheadMatch, typeaheadText, type Typeahead } from "@/lib/menu-keys";+import type { Typeahead } from "@/lib/menu-keys";import { usePopoverDismiss } from "@/hooks/use-popover-dismiss";import { InstanceProviderMark } from "./ProviderIcons";import { ELEVATED_FLOAT, ELEVATED_HOVER } from "./elevated";@@ -24,7 +24,7 @@ import { useMenuMotion } from "./MenuMotion";import { SimpleModelMenu, type SimpleThinking } from "./SimpleModelMenu";import { apiKeysLabel, ClaudeAccountSelect, engineStatus, FollowBotModelRow, ModelEngineRail, ModelRow, ModelSearch } from "./ModelPickerFull";import { MENU_LABEL, MENU_LINE, MENU_ROW, MENU_SEPARATOR, MENU_STROKE, MENU_TRAILING } from "./menu-recipe";-import { nextMenuIndex } from "./SidebarPopoverMenu";+import { modelMenuKey, modelMenuPointerMove } from "./model-menu-keys";import { useAdvancedMode } from "@/lib/interface-mode";import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin";@@ -216,9 +216,7 @@ export function ModelVariantRow({ bot, threadId, updateBotDefault, className, laconst POPOVER_WIDTH = 420;const POPOVER_HEIGHT = 600;export const SIMPLE_POPOVER_WIDTH = 300;-const FOCUSABLE = "button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]";const MENU_ITSELF = ":scope";-const FORWARD_ROWS = "[data-simple-set-up], [data-simple-sign-in], [data-simple-manage], [data-model-local-entry]";export function ModelPicker({bot: shown,@@ -569,94 +567,13 @@ export function ModelPicker({const onMenuKey = (event: ReactKeyboardEvent<HTMLDivElement>) => {if (event.nativeEvent.isComposing || event.defaultPrevented || !(event.target instanceof HTMLElement)) return;- const menu = event.currentTarget;- const target = event.target;- const handled = () => {- event.preventDefault();- event.stopPropagation();- };- if (event.key === "Escape") {- handled();- if (query) setQuery("");- else if (!simpleView && pane === "custom" && canReturnToOfficial) setPane("main");- else if (fullView && !advanced) backToList(true);- else close(true);- return;- }- if (event.key === "Tab") {- const stops = [...menu.querySelectorAll<HTMLElement>(FOCUSABLE)].filter((element) => element !== target && element.tabIndex >= 0);- const follows = (first: Node, second: Node) => Boolean(first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING);- if (!stops.some((stop) => (event.shiftKey ? follows(stop, target) : follows(target, stop)))) {- handled();- close(true);- }- return;- }- if (target instanceof HTMLSelectElement) return;- const rtl = getComputedStyle(menu).direction === "rtl";- const pills = target.closest("[data-simple-effort]");- if (pills) {- const buttons = [...pills.querySelectorAll<HTMLElement>("button:not(:disabled)")];- const step = { ArrowRight: rtl ? "ArrowUp" : "ArrowDown", ArrowLeft: rtl ? "ArrowDown" : "ArrowUp", Home: "Home", End: "End" }[event.key];- const next = step ? nextMenuIndex(step, buttons.indexOf(target), buttons.length) : null;- if (next !== null) {- handled();- buttons[next]?.focus();- }- return;- }- const search = menu.querySelector<HTMLInputElement>("[data-menu-search]");- if (target instanceof HTMLInputElement && target !== search) return;- const rows = [...menu.querySelectorAll<HTMLElement>("[data-menu-row]:not(:disabled)")];- const below = search ? rows.filter((row) => search.compareDocumentPosition(row) & Node.DOCUMENT_POSITION_FOLLOWING) : [];- const above = search ? rows.filter((row) => !below.includes(row)) : [];- const goTo = (row: HTMLElement | undefined) => {- handled();- row?.focus({ preventScroll: true });- row?.scrollIntoView?.({ block: "nearest" });- };- if (target === search) {- if (event.key === "ArrowDown") goTo(below[0]);- else if (event.key === "ArrowUp" && above.length > 0) goTo(above.at(-1));- else if (event.key === "Enter") {- handled();- if (query.trim()) rows.find((row) => row.hasAttribute("aria-pressed") && !row.hasAttribute("data-follow-bot-model"))?.click();- }- return;- }- const index = rows.indexOf(target);- if (index < 0 && target !== menu) return;- if (event.key === "Enter" && index >= 0) {- handled();- target.click();- return;- }- if (search && ((event.key === "ArrowUp" && target === below[0]) || (event.key === "ArrowDown" && target === above.at(-1)))) return goTo(search);- const next = nextMenuIndex(event.key, index, rows.length);- if (next !== null) return goTo(rows[next]);- if (event.key === (rtl ? "ArrowLeft" : "ArrowRight") && index >= 0 && rows[index]!.matches(FORWARD_ROWS)) {- handled();- rows[index]!.click();- return;- }- const continuing = event.key === " " && typed.current !== null && event.timeStamp - typed.current.at < TYPEAHEAD_RESET_MS;- if (!isTypeaheadKey(event) && !continuing) return;- if (search) {- search.focus();- return;- }- if (continuing) handled();- typed.current = typeaheadText(typed.current, event.key, event.timeStamp);- const match = typeaheadMatch(rows.map((row) => row.textContent ?? ""), index, typed.current.text);- if (match !== null) goTo(rows[match]);- };-- const onMenuPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {- if (event.pointerType !== "mouse" || !(event.target instanceof Element)) return;- const row = event.target.closest<HTMLElement>("[data-menu-row]");- const focused = document.activeElement;- if (!row || row === focused || row.matches(":disabled") || !(focused instanceof HTMLElement)) return;- if (focused.matches("[data-menu-row]") && event.currentTarget.contains(focused)) row.focus({ preventScroll: true });+ if (event.key !== "Escape") return modelMenuKey(event, { query, typed, close: () => close(true) });+ event.preventDefault();+ event.stopPropagation();+ if (query) setQuery("");+ else if (!simpleView && pane === "custom" && canReturnToOfficial) setPane("main");+ else if (fullView && !advanced) backToList(true);+ else close(true);};const currentOption = active?.models.options.find((option) => option.id === selection.model);@@ -1043,7 +960,7 @@ export function ModelPicker({tabIndex={-1}{...motion.exitProps}onKeyDown={onMenuKey}- onPointerMove={onMenuPointerMove}+ onPointerMove={modelMenuPointerMove}style={floating ? {position: "fixed",left: placement?.left ?? 0,diff --git a/src/components/bot-panel/BackupAis.dom.test.ts b/src/components/bot-panel/BackupAis.dom.test.tsnew file mode 100644index 0000000000..b27c0c2a48--- /dev/null+++ b/src/components/bot-panel/BackupAis.dom.test.ts@@ -0,0 +1,138 @@+// @vitest-environment happy-dom+// Simple's Bot settings card for a bot's backup AIs, in a real DOM: the same model menu as Model, the bot's own list.+import { createElement } from "react";+import { flushSync } from "react-dom";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import type { Bot, InstanceInfo } from "@/state/store";++const fixture = vi.hoisted(() => ({ instances: [] as InstanceInfo[], dispatch: vi.fn() }));+vi.mock("@/state/store", async (importOriginal) => {+ const original = await importOriginal<typeof import("@/state/store")>();+ return {+ ...original,+ useStore: () => ({+ state: { ...original.initialState, instances: fixture.instances },+ dispatch: fixture.dispatch,+ refreshInstances: () => Promise.resolve(),+ refreshModels: () => Promise.resolve(),+ }),+ };+});+vi.mock("@/lib/interface-mode", () => ({ useAdvancedMode: () => false, readAdvancedMode: () => false, setAdvancedMode: vi.fn() }));+vi.mock("../Avatar", () => ({ BotAvatar: () => null, MausAvatar: () => null }));++const { BackupAis, MAX_BACKUPS } = await import("./BackupAis");++const engine = (instanceId: string, displayName: string, driverKind: string, models: Array<[string, string]>): InstanceInfo => ({+ instanceId, displayName, driverKind, access: "subscription", enabled: true,+ snapshot: { state: "available", version: "1", authenticated: true },+ models: { default: models[0]![0], options: models.map(([id, label]) => ({ id, label })) },+}) as unknown as InstanceInfo;++const claude = engine("claude", "Claude", "claudeAgent", [["claude-sonnet-5", "Claude Sonnet 5"]]);+const codex = engine("codex", "Codex", "codex", [["gpt-5.5", "GPT-5.5"], ["gpt-5.5-mini", "GPT-5.5 mini"]]);+const gemini = engine("gemini", "Gemini", "geminiAgent", [["gemini-3-pro", "Gemini 3 Pro"]]);++const bot = (fallback?: Bot["fallback"]): Bot => ({+ id: "scout", threadId: "thread-scout", name: "Scout", title: "", description: "", soul: "",+ notifications: true, color: "green", unread: false, messages: [],+ modelSelection: { instanceId: "claude", model: "claude-sonnet-5" },+ ...(fallback ? { fallback } : {}),+});++let host: HTMLDivElement;+let root: Root;+const onChange = vi.fn();+const render = (fallback?: Bot["fallback"]) => flushSync(() => root.render(createElement(BackupAis, { bot: bot(fallback), onChange })));+const settle = async () => {+ for (let i = 0; i < 3; i++) await new Promise((resolve) => setTimeout(resolve, 0));+};+const click = (element: Element | null | undefined) => {+ if (!element) throw new Error("nothing to click");+ flushSync(() => element.dispatchEvent(new MouseEvent("click", { bubbles: true, detail: 1 })));+};+const menu = () => document.querySelector<HTMLElement>("[data-backup-menu]");+const providers = () => [...(menu()?.querySelectorAll("[data-simple-provider]") ?? [])].map((group) => group.getAttribute("data-simple-provider"));+const modelRow = (label: string) => [...(menu()?.querySelectorAll<HTMLElement>("[data-menu-row]") ?? [])]+ .find((row) => row.getAttribute("aria-label")?.startsWith(label));++beforeEach(() => {+ fixture.instances.splice(0, fixture.instances.length, claude, codex, gemini);+ fixture.dispatch.mockReset();+ onChange.mockReset();+ host = document.createElement("div");+ document.body.append(host);+ root = createRoot(host);+});++afterEach(() => {+ flushSync(() => root.unmount());+ host.remove();+ document.body.innerHTML = "";+});++describe("a bot's backup AIs in Simple", () => {+ it("say when they are used, with no switch to turn them on", () => {+ render();+ const card = host.querySelector("[data-panel-row=backups]")!;+ expect(card.textContent).toContain("Backup AIs");+ expect(card.textContent).toContain("Used only when Scout's AI is at its usage limit or can't start on a message.");+ expect(card.textContent).toContain("After a usage limit resets, the conversation goes back.");+ expect(card.querySelector('[role="switch"], input[type="checkbox"]')).toBeNull();+ expect(host.querySelectorAll("[data-backup]")).toHaveLength(0);+ });++ it("adds one from the same model menu, never offering the bot's own AI", async () => {+ render();+ click(host.querySelector("[data-panel-action=backup-add]"));+ await settle();+ expect(menu()?.getAttribute("aria-label")).toBe("Choose a backup AI");+ expect(providers()).toEqual(["codex", "gemini"]);+ expect(menu()?.querySelector("[data-current-model]")).toBeNull();+ click(modelRow("GPT-5.5 mini"));+ expect(onChange).toHaveBeenCalledWith([{ instanceId: "codex", model: "gpt-5.5-mini" }]);+ expect(host.querySelector("[data-panel-action=backup-add]")?.getAttribute("aria-expanded")).toBe("false");+ });++ it("changes one in place, offering only AIs no other backup uses", async () => {+ render([{ instanceId: "codex", model: "gpt-5.5" }, { instanceId: "gemini", model: "gemini-3-pro" }]);+ const rows = host.querySelectorAll("[data-backup]");+ expect([...rows].map((row) => row.querySelector("[data-panel-action=backup-change]")?.getAttribute("aria-label")))+ .toEqual(["Backup 1: GPT-5.5", "Backup 2: Gemini 3 Pro"]);+ click(rows[0]!.querySelector("[data-panel-action=backup-change]"));+ await settle();+ expect(providers()).toEqual(["codex"]);+ expect(menu()?.querySelector("[data-current-model]")?.textContent).toContain("GPT-5.5");+ click(modelRow("GPT-5.5 mini"));+ expect(onChange).toHaveBeenCalledWith([{ instanceId: "codex", model: "gpt-5.5-mini" }, { instanceId: "gemini", model: "gemini-3-pro" }]);+ });++ it("removes one and keeps the rest in order", () => {+ render([{ instanceId: "codex", model: "gpt-5.5" }, { instanceId: "gemini", model: "gemini-3-pro" }]);+ const remove = host.querySelector('[data-backup="codex"] [data-panel-action=backup-remove]');+ expect(remove?.getAttribute("aria-label")).toBe("Remove GPT-5.5 from backups");+ click(remove);+ expect(onChange).toHaveBeenCalledWith([{ instanceId: "gemini", model: "gemini-3-pro" }]);+ });++ it("stops offering Add at the most the bot can keep", () => {+ const full = Array.from({ length: MAX_BACKUPS }, (_, index) => ({ instanceId: `engine-${index}`, model: "m" }));+ render(full);+ expect(host.querySelectorAll("[data-backup]")).toHaveLength(MAX_BACKUPS);+ expect(host.querySelector("[data-panel-action=backup-add]")).toBeNull();+ expect(host.querySelector("[data-backup]")?.textContent).toContain("Unavailable");+ });++ it("closes its menu on Escape without letting the key close the panel", async () => {+ render();+ click(host.querySelector("[data-panel-action=backup-add]"));+ await settle();+ const event = new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true });+ flushSync(() => (document.activeElement ?? menu())!.dispatchEvent(event));+ expect(event.defaultPrevented).toBe(true);+ await new Promise((resolve) => setTimeout(resolve, 250));+ expect(menu()).toBeNull();+ expect(document.activeElement?.getAttribute("data-panel-action")).toBe("backup-add");+ });+});diff --git a/src/components/bot-panel/BackupAis.tsx b/src/components/bot-panel/BackupAis.tsxnew file mode 100644index 0000000000..f9e939fcce--- /dev/null+++ b/src/components/bot-panel/BackupAis.tsx@@ -0,0 +1,285 @@+import { useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode, type RefObject } from "react";+import { createPortal } from "react-dom";+import { ChevronDown, LifeBuoy, Plus } from "lucide-react";++import { cn } from "@/lib/cn";+import { configuredModelInstances } from "@/lib/engine-rail";+import { t } from "@/lib/i18n";+import type { Typeahead } from "@/lib/menu-keys";+import { pickerPlacement, type PickerPlacement } from "@/lib/picker-placement";+import { shortModelLabel } from "@/lib/model-friendly";+import { modelName, providerName, simpleModelMenu } from "@/lib/simple-model-menu";+import { usePopoverDismiss } from "@/hooks/use-popover-dismiss";+import { useStore, type Bot, type InstanceInfo } from "@/state/store";+import { useMenuMotion } from "../MenuMotion";+import { modelMenuKey, modelMenuPointerMove } from "../model-menu-keys";+import { SIMPLE_POPOVER_WIDTH } from "../ModelPicker";+import { InstanceProviderMark } from "../ProviderIcons";+import { SimpleModelMenu } from "../SimpleModelMenu";+import { buttonCls, Card, ColRow, RowIcon, RowText, TrashButton } from "./rows";++type Backup = NonNullable<Bot["fallback"]>[number];++/** As many as the server keeps for one bot. */+export const MAX_BACKUPS = 5;++const NO_SELECTION = { instanceId: "", model: "" };+const NOTHING_PROBED: ReadonlySet<string> = new Set();++function BackupChooser({ bot, current, exclude, onPick, label, title, buttonRef, className, children, ...rest }: {+ bot: Bot;+ current: Backup | null;+ exclude: ReadonlySet<string>;+ onPick: (backup: Backup) => void;+ label: string;+ title?: string;+ buttonRef?: RefObject<HTMLButtonElement | null>;+ className: string;+ children: ReactNode;+ "data-panel-action"?: string;+}) {+ const { state, dispatch, refreshInstances, refreshModels } = useStore();+ const [open, setOpen] = useState(false);+ const [query, setQuery] = useState("");+ const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set());+ const [loading, setLoading] = useState(false);+ const [refreshing, setRefreshing] = useState<string | null>(null);+ const [placement, setPlacement] = useState<PickerPlacement | null>(null);+ const ownRef = useRef<HTMLButtonElement>(null);+ const triggerRef = buttonRef ?? ownRef;+ const menuRef = useRef<HTMLDivElement>(null);+ const typed = useRef<Typeahead | null>(null);+ const focusOnPlace = useRef(false);+ const menuId = useId();+ const motion = useMenuMotion(open);+ const inside = useRef({ contains: (target: unknown) => [triggerRef.current, menuRef.current].some((node) => node?.contains(target as Node)) });+ usePopoverDismiss(open, inside, () => setOpen(false));++ useLayoutEffect(() => {+ if (!open) return;+ const place = (event?: Event) => {+ if (event?.type === "scroll" && event.target instanceof Node && menuRef.current?.contains(event.target)) return;+ const anchor = triggerRef.current?.getBoundingClientRect();+ const menu = menuRef.current;+ if (!anchor || !menu) return;+ setPlacement((locked) => pickerPlacement(anchor, { width: SIMPLE_POPOVER_WIDTH, height: menu.offsetHeight },+ { width: window.innerWidth, height: window.innerHeight }, locked ?? undefined));+ };+ place();+ window.addEventListener("resize", place);+ window.addEventListener("scroll", place, true);+ return () => {+ window.removeEventListener("resize", place);+ window.removeEventListener("scroll", place, true);+ };+ }, [open, triggerRef]);++ useEffect(() => {+ if (!open || !placement || !focusOnPlace.current) return;+ focusOnPlace.current = false;+ const menu = menuRef.current;+ const target = menu?.querySelector<HTMLElement>("[data-menu-search]") ?? menu?.querySelector<HTMLElement>("[data-current-model]")+ ?? menu?.querySelector<HTMLElement>("[data-menu-row]:not(:disabled)") ?? menu;+ target?.focus({ preventScroll: true });+ }, [open, placement]);++ const close = (refocus: boolean) => {+ setOpen(false);+ if (refocus) triggerRef.current?.focus({ preventScroll: true });+ };+ const openMenu = () => {+ setQuery("");+ setExpanded(new Set());+ setPlacement(null);+ focusOnPlace.current = true;+ setOpen(true);+ setLoading(true);+ void refreshInstances().catch(() => {}).finally(() => setLoading(false));+ };+ const checkAgain = (instance: InstanceInfo) => {+ if (refreshing) return;+ setRefreshing(instance.instanceId);+ void refreshModels(instance.instanceId).catch(() => {}).finally(() => setRefreshing(null));+ };+ const manage = () => {+ close(false);+ dispatch({ type: "toggleAppSettings", open: true, section: "engines" });+ };++ const menuFor = () => {+ const listed = configuredModelInstances(state.instances, current?.instanceId).filter((instance) => !exclude.has(instance.instanceId));+ const built = simpleModelMenu({+ instances: state.instances, listed, selection: current ?? NO_SELECTION,+ bot: { name: bot.name, selection: bot.modelSelection }, query, expanded, probing: NOTHING_PROBED, loading, refreshing,+ });+ return current ? built : { ...built, current: null };+ };++ const onMenuKey = (event: ReactKeyboardEvent<HTMLDivElement>) => {+ if (event.nativeEvent.isComposing || event.defaultPrevented) return;+ if (event.key !== "Escape") return modelMenuKey(event, { query, typed, close: () => close(true) });+ event.preventDefault();+ event.stopPropagation();+ if (query) setQuery("");+ else close(true);+ };++ return (+ <>+ <button+ ref={triggerRef}+ type="button"+ {...rest}+ aria-label={label}+ title={title}+ aria-haspopup="dialog"+ aria-expanded={open}+ aria-controls={open ? menuId : undefined}+ onClick={() => (open ? close(false) : openMenu())}+ onKeyDown={(event) => {+ if (event.key === "Escape" && open) {+ event.preventDefault();+ event.stopPropagation();+ close(false);+ } else if ((event.key === "ArrowDown" || event.key === "ArrowUp") && !open) {+ event.preventDefault();+ openMenu();+ }+ }}+ className={className}+ >+ {children}+ </button>+ {motion.shown && createPortal(+ <div+ ref={menuRef}+ id={menuId}+ data-backup-menu+ role="dialog"+ aria-label={t("botPanel.backups.choose")}+ aria-modal="false"+ tabIndex={-1}+ {...motion.exitProps}+ onKeyDown={onMenuKey}+ onPointerMove={modelMenuPointerMove}+ style={{+ position: "fixed",+ left: placement?.left ?? 0,+ top: placement?.top,+ bottom: placement?.bottom,+ width: placement?.width ?? SIMPLE_POPOVER_WIDTH,+ maxHeight: placement?.maxHeight,+ transformOrigin: placement?.origin,+ visibility: placement ? undefined : "hidden",+ }}+ className={cn("menu-surface z-[80] flex flex-col overflow-hidden", motion.className)}+ >+ <SimpleModelMenu+ menu={menuFor()}+ query={query}+ bot={bot}+ botModel={{ label: "", title: "" }}+ idPrefix={menuId}+ onQuery={setQuery}+ onPick={(instance, model) => {+ if (instance.policy) return;+ onPick({ instanceId: instance.instanceId, model });+ close(true);+ }}+ onPickCurrent={() => close(true)}+ onFollowBot={() => close(true)}+ onToggle={(instance) => setExpanded((shown) => {+ const next = new Set(shown);+ if (!next.delete(instance.instanceId)) next.add(instance.instanceId);+ return next;+ })}+ onSetUp={manage}+ onCheckAgain={checkAgain}+ onManage={manage}+ />+ </div>,+ document.body,+ )}+ </>+ );+}++export function BackupAis({ bot, onChange }: { bot: Bot; onChange: (fallback: Backup[]) => void }) {+ const { state } = useStore();+ const chain = bot.fallback ?? [];+ const addRef = useRef<HTMLButtonElement>(null);+ const others = (except: number | null) =>+ new Set([bot.modelSelection.instanceId, ...chain.filter((_, index) => index !== except).map((entry) => entry.instanceId)]);+ const describe = (entry: Backup) => {+ const instance = state.instances.find((candidate) => candidate.instanceId === entry.instanceId);+ const option = instance?.models.options.find((candidate) => candidate.id === entry.model);+ const name = modelName(instance, entry.model);+ return { instance, name, short: instance && option ? shortModelLabel(option.label, providerName(instance)) : name };+ };++ return (+ <Card anchor="backups">+ <ColRow data-panel-row="backups">+ <div className="flex items-center gap-2.5">+ <RowIcon icon={LifeBuoy} />+ <RowText title={t("botPanel.backups.title")} />+ </div>+ <p className="-mt-1 pl-[38px] text-[13px] leading-[1.35] text-ink-secondary">{t("botPanel.backups.hint", { name: bot.name })}</p>+ {chain.length > 0 && (+ <ol aria-label={t("botPanel.backups.title")} className="flex flex-col gap-1 pl-[38px]">+ {chain.map((entry, index) => {+ const { instance, name, short } = describe(entry);+ return (+ <li key={entry.instanceId} data-backup={entry.instanceId} className="flex min-w-0 items-center gap-1.5">+ <span className="w-3 shrink-0 text-[12px] tabular-nums text-ink-tertiary" aria-hidden="true">{index + 1}</span>+ <BackupChooser+ bot={bot}+ current={entry}+ exclude={others(index)}+ onPick={(picked) => onChange(chain.map((candidate, at) => (at === index ? picked : candidate)))}+ label={t("botPanel.backups.row", { position: index + 1, model: name })}+ title={instance ? `${instance.displayName} · ${name}` : name}+ data-panel-action="backup-change"+ className="group flex h-8 min-w-0 flex-1 items-center gap-2 rounded-[9px] bg-ink/[0.04] pl-2.5 pr-2 text-left text-[13px] text-ink hover:bg-ink/[0.07] aria-expanded:bg-ink/[0.08]"+ >+ {instance+ ? <InstanceProviderMark instance={instance} size={14} subtle />+ : <span className="size-3.5 shrink-0 rounded-full bg-ink/[0.08]" aria-hidden="true" />}+ <span className="min-w-0 flex-1 truncate">{short}</span>+ {!instance && <span className="shrink-0 text-[12px] text-warning">{t("model.simple.unavailable")}</span>}+ <ChevronDown size={12} strokeWidth={2} aria-hidden="true" className="shrink-0 text-ink-tertiary group-hover:text-ink-secondary" />+ </BackupChooser>+ <TrashButton+ data-panel-action="backup-remove"+ label={t("botPanel.backups.remove", { model: name })}+ onClick={() => {+ onChange(chain.filter((_, at) => at !== index));+ addRef.current?.focus({ preventScroll: true });+ }}+ />+ </li>+ );+ })}+ </ol>+ )}+ {chain.length < MAX_BACKUPS && (+ <div className="pl-[38px]">+ <BackupChooser+ bot={bot}+ current={null}+ exclude={others(null)}+ onPick={(picked) => onChange([...chain, picked])}+ label={t("model.fallback.add")}+ buttonRef={addRef}+ data-panel-action="backup-add"+ className={cn(buttonCls, "aria-expanded:bg-raised-hover")}+ >+ <Plus size={14} aria-hidden="true" />+ {t("model.fallback.add")}+ </BackupChooser>+ </div>+ )}+ </ColRow>+ </Card>+ );+}diff --git a/src/components/bot-panel/SettingsPage.tsx b/src/components/bot-panel/SettingsPage.tsxindex 9aee535dbf..72ab9909c8 100644--- a/src/components/bot-panel/SettingsPage.tsx+++ b/src/components/bot-panel/SettingsPage.tsx@@ -16,6 +16,7 @@ import { SoulField } from "../SoulField";import { useBotApps } from "../bot-settings/useBotApps";import type { useBotSettingsDerived } from "../bot-settings/useBotSettingsDerived";import { useThreadApproval } from "../thread-approval";+import { BackupAis } from "./BackupAis";import type { SimplePageId } from "./page-registry";import { buttonCls, Card, ColRow, NavRow, RowIcon, rowCls, RowText, Segmented, type SegmentOption } from "./rows";@@ -142,6 +143,8 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false</ColRow></Card>+ <BackupAis bot={bot} onChange={(fallback) => patch({ fallback })} />+<Card anchor="call"><ColRow data-panel-row="call-mode"><div className="flex items-center gap-2.5">diff --git a/src/components/bot-settings/ModelSection.test.ts b/src/components/bot-settings/ModelSection.test.tsindex 3f3dbb2c65..8ad1e7fef9 100644--- a/src/components/bot-settings/ModelSection.test.ts+++ b/src/components/bot-settings/ModelSection.test.ts@@ -5,9 +5,10 @@ import { describe, expect, it, vi } from "vitest";import type { Bot, InstanceInfo } from "@/state/store";const instances = vi.hoisted(() => [] as InstanceInfo[]);+const recovery = vi.hoisted(() => ({ enabled: true }));vi.mock("@/state/store", async (importOriginal) => {const original = await importOriginal<typeof import("@/state/store")>();- return { ...original, useStore: () => ({ state: { ...original.initialState, instances, config: { automaticRecovery: { enabled: true } } }, dispatch: vi.fn() }) };+ return { ...original, useStore: () => ({ state: { ...original.initialState, instances, config: { automaticRecovery: recovery } }, dispatch: vi.fn() }) };});const { FallbackChain } = await import("./ModelSection");@@ -46,6 +47,16 @@ describe("a bot's backup models", () => {instances.pop();});+ it("says the list works on its own, with Automatic recovery off as well as on", () => {+ for (const enabled of [true, false]) {+ recovery.enabled = enabled;+ const markup = renderToStaticMarkup(createElement(FallbackChain, { bot: bot([{ instanceId: "codex", model: "gpt-a" }]), onChange: vi.fn() }));+ expect(markup).toContain("Used in order, with no other setting, when this bot's AI is at its usage limit or the provider proves a request never started.");+ expect(markup).not.toMatch(/Automatic recovery|inactive/);+ }+ recovery.enabled = true;+ });+it("keeps showing a saved model the engine no longer lists", () => {const markup = renderToStaticMarkup(createElement(FallbackChain, { bot: bot([{ instanceId: "codex", model: "gpt-old" }]), onChange: vi.fn() }));expect(markup).toMatch(/aria-label="Model for Codex"[^>]*>.*<option value="gpt-old" selected="">gpt-old<\/option>/);diff --git a/src/components/bot-settings/ModelSection.tsx b/src/components/bot-settings/ModelSection.tsxindex 3a53b4dd13..281d315f3f 100644--- a/src/components/bot-settings/ModelSection.tsx+++ b/src/components/bot-settings/ModelSection.tsx@@ -97,9 +97,8 @@ export function FallbackChain({ bot, onChange }: { bot: Bot; onChange: (fallback<div className="rounded-xl bg-card p-4"><div className="text-[15px] font-medium text-ink">{t("model.fallback.title")}</div><div className="mt-0.5 text-[13px] text-ink-secondary">- {t("model.fallback.help")}+ {t("model.fallback.uses")}</div>- {!state.config?.automaticRecovery?.enabled && <p className="mt-2 text-[12px] text-ink-secondary">{t("model.fallback.off")}</p>}{chain.length > 0 && (<ol className="mt-3 flex flex-col gap-1">{chain.map((entry, index) => (diff --git a/src/components/model-menu-keys.ts b/src/components/model-menu-keys.tsnew file mode 100644index 0000000000..d91f873025--- /dev/null+++ b/src/components/model-menu-keys.ts@@ -0,0 +1,97 @@+import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent } from "react";+import { isTypeaheadKey, TYPEAHEAD_RESET_MS, typeaheadMatch, typeaheadText, type Typeahead } from "@/lib/menu-keys";+import { nextMenuIndex } from "./SidebarPopoverMenu";++const FOCUSABLE = "button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]";+const FORWARD_ROWS = "[data-simple-set-up], [data-simple-sign-in], [data-simple-manage], [data-model-local-entry]";++/** A model menu's keys other than Escape: Tab past its last stop closes it; the arrows, Home and End move between its+ * rows, its search box and its thinking pills; Enter picks; typing jumps to a row, or into the search box. */+export function modelMenuKey(event: ReactKeyboardEvent<HTMLElement>, { query, typed, close }: {+ query: string;+ typed: { current: Typeahead | null };+ close: () => void;+}): void {+ if (!(event.target instanceof HTMLElement)) return;+ const menu = event.currentTarget;+ const target = event.target;+ const handled = () => {+ event.preventDefault();+ event.stopPropagation();+ };+ if (event.key === "Tab") {+ const stops = [...menu.querySelectorAll<HTMLElement>(FOCUSABLE)].filter((element) => element !== target && element.tabIndex >= 0);+ const follows = (first: Node, second: Node) => Boolean(first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING);+ if (!stops.some((stop) => (event.shiftKey ? follows(stop, target) : follows(target, stop)))) {+ handled();+ close();+ }+ return;+ }+ if (target instanceof HTMLSelectElement) return;+ const rtl = getComputedStyle(menu).direction === "rtl";+ const pills = target.closest("[data-simple-effort]");+ if (pills) {+ const buttons = [...pills.querySelectorAll<HTMLElement>("button:not(:disabled)")];+ const step = { ArrowRight: rtl ? "ArrowUp" : "ArrowDown", ArrowLeft: rtl ? "ArrowDown" : "ArrowUp", Home: "Home", End: "End" }[event.key];+ const next = step ? nextMenuIndex(step, buttons.indexOf(target), buttons.length) : null;+ if (next !== null) {+ handled();+ buttons[next]?.focus();+ }+ return;+ }+ const search = menu.querySelector<HTMLInputElement>("[data-menu-search]");+ if (target instanceof HTMLInputElement && target !== search) return;+ const rows = [...menu.querySelectorAll<HTMLElement>("[data-menu-row]:not(:disabled)")];+ const below = search ? rows.filter((row) => search.compareDocumentPosition(row) & Node.DOCUMENT_POSITION_FOLLOWING) : [];+ const above = search ? rows.filter((row) => !below.includes(row)) : [];+ const goTo = (row: HTMLElement | undefined) => {+ handled();+ row?.focus({ preventScroll: true });+ row?.scrollIntoView?.({ block: "nearest" });+ };+ if (target === search) {+ if (event.key === "ArrowDown") goTo(below[0]);+ else if (event.key === "ArrowUp" && above.length > 0) goTo(above.at(-1));+ else if (event.key === "Enter") {+ handled();+ if (query.trim()) rows.find((row) => row.hasAttribute("aria-pressed") && !row.hasAttribute("data-follow-bot-model"))?.click();+ }+ return;+ }+ const index = rows.indexOf(target);+ if (index < 0 && target !== menu) return;+ if (event.key === "Enter" && index >= 0) {+ handled();+ target.click();+ return;+ }+ if (search && ((event.key === "ArrowUp" && target === below[0]) || (event.key === "ArrowDown" && target === above.at(-1)))) return goTo(search);+ const next = nextMenuIndex(event.key, index, rows.length);+ if (next !== null) return goTo(rows[next]);+ if (event.key === (rtl ? "ArrowLeft" : "ArrowRight") && index >= 0 && rows[index]!.matches(FORWARD_ROWS)) {+ handled();+ rows[index]!.click();+ return;+ }+ const continuing = event.key === " " && typed.current !== null && event.timeStamp - typed.current.at < TYPEAHEAD_RESET_MS;+ if (!isTypeaheadKey(event) && !continuing) return;+ if (search) {+ search.focus();+ return;+ }+ if (continuing) handled();+ typed.current = typeaheadText(typed.current, event.key, event.timeStamp);+ const match = typeaheadMatch(rows.map((row) => row.textContent ?? ""), index, typed.current.text);+ if (match !== null) goTo(rows[match]);+}++/** A mouse moving over a model menu's rows takes keyboard focus with it, once a row already has it. */+export function modelMenuPointerMove(event: ReactPointerEvent<HTMLElement>): void {+ if (event.pointerType !== "mouse" || !(event.target instanceof Element)) return;+ const row = event.target.closest<HTMLElement>("[data-menu-row]");+ const focused = document.activeElement;+ if (!row || row === focused || row.matches(":disabled") || !(focused instanceof HTMLElement)) return;+ if (focused.matches("[data-menu-row]") && event.currentTarget.contains(focused)) row.focus({ preventScroll: true });+}diff --git a/src/locales/de.json b/src/locales/de.jsonindex 5d38f45895..ed692621c9 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -2522,5 +2522,13 @@"secretCard.resumed": "Bot fortgesetzt","notifications.status.notice": "Hinweis","mcp.ownBot": "Nur für {bot}: Die Dateien liegen im eigenen Ordner von {bot}.",- "mcp.offFor": "Aus für {bots}, weil er dort nicht startet. Er wird von selbst erneut geprüft."+ "mcp.offFor": "Aus für {bots}, weil er dort nicht startet. Er wird von selbst erneut geprüft.",+ "botPanel.backups.title": "Ersatz-KIs",+ "botPanel.backups.hint": "Nur genutzt, wenn die KI von {name} ihr Nutzungslimit erreicht hat oder mit einer Nachricht gar nicht erst beginnen kann. Dann übernimmt die erste hier, die das kann, nur in diesem Gespräch. Sobald ein Nutzungslimit zurückgesetzt ist, wechselt das Gespräch zurück.",+ "botPanel.backups.row": "Ersatz {position}: {model}",+ "botPanel.backups.remove": "{model} aus den Ersatz-KIs entfernen",+ "botPanel.backups.choose": "Ersatz-KI wählen",+ "model.fallback.add": "Ersatz-KI hinzufügen",+ "model.fallback.uses": "Werden der Reihe nach genutzt, ohne weitere Einstellung, wenn die KI dieses Bots ihr Nutzungslimit erreicht hat oder der Anbieter belegt, dass eine Anfrage nie gestartet ist. Arbeit, die schon gelaufen sein könnte, wird nicht wiederholt. Nur dieser Thread wechselt; Bot-Standards und andere Threads bleiben unverändert. Beim Ersatzanbieter können Kosten anfallen.",+ "settings.recovery.ownBackups": "Bots mit eigenen Ersatzmodellen (Modell → Ersatzmodelle für diesen Bot) nutzen stattdessen diese, ob das hier an ist oder nicht."}diff --git a/src/locales/en.json b/src/locales/en.jsonindex cd55a705ee..6f70026c7d 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -2356,6 +2356,7 @@"settings.recovery.enable": "Use a backup model","settings.recovery.help": "If an ACP model provider (such as Qwen or OpenCode) fails before starting, try a backup once. Work that may have already run is not replayed.","settings.recovery.scope": "Applies to direct bot threads, including Chief and delegated work. Channels are not included. Only this thread switches; bot defaults stay unchanged.",+ "settings.recovery.ownBackups": "Bots with backups of their own (Model → Backup models for this bot) use those instead, whether or not this is on.","settings.recovery.engine": "Backup provider","settings.recovery.model": "Backup model","settings.recovery.chooseEngine": "Choose a provider",@@ -2661,8 +2662,7 @@"model.section.effortHelpDefault": "How hard this bot thinks in groups and every thread that uses its model. By default, no level is sent.","model.effort.summary": "{level} effort","model.fallback.title": "Backup models for this bot",- "model.fallback.help": "When Automatic recovery is enabled in App Settings, try these models in order only if the provider proves the request never started. Work that may have run is not replayed. Only that thread switches; bot defaults and other threads stay unchanged. Backup provider charges may apply.",- "model.fallback.off": "Automatic recovery is off. This list stays inactive until you enable it in App Settings.",+ "model.fallback.uses": "Used in order, with no other setting, when this bot's AI is at its usage limit or the provider proves a request never started. Work that may have run is not replayed. Only that thread switches; bot defaults and other threads stay unchanged. Backup provider charges may apply.","model.fallback.remove": "Remove {name} from the fallback list","model.fallback.model": "Model for {name}","model.fallback.add": "Add a backup AI",@@ -3701,6 +3701,11 @@"botSettings.simple.justDoIt": "Just do it","botSettings.simple.custom": "Custom","botPanel.appsRow": "Apps it can use",+ "botPanel.backups.title": "Backup AIs",+ "botPanel.backups.hint": "Used only when {name}'s AI is at its usage limit or can't start on a message. The first one here that can take over does, in that conversation only. After a usage limit resets, the conversation goes back.",+ "botPanel.backups.row": "Backup {position}: {model}",+ "botPanel.backups.remove": "Remove {model} from backups",+ "botPanel.backups.choose": "Choose a backup AI","botPanel.appsNoneYet": "None yet","botPanel.apps.intro": "Switch on the apps {name} may use. Everything else stays off.","botPanel.apps.connectAnother": "Connect another app",diff --git a/src/locales/es.json b/src/locales/es.jsonindex 6ba8ff5972..fb03114677 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -5431,5 +5431,13 @@"approval.status.timedOut": "Sin respuesta a tiempo; no se ejecutó","secretCard.ref": "{app} lo guarda para un solo uso de sus propias herramientas. Tu bot nunca lo ve y nunca se añade al chat.","secretCard.file": "Se guarda en un archivo privado que los comandos de tu bot pueden leer durante 24 horas; después se borra. Nunca se añade al chat.",- "secretCard.resumed": "El bot continuó"+ "secretCard.resumed": "El bot continuó",+ "botPanel.backups.title": "IA de respaldo",+ "botPanel.backups.hint": "Solo se usan cuando la IA de {name} llega a su límite de uso o no puede empezar con un mensaje. Entonces se encarga la primera de aquí que pueda, solo en esa conversación. Cuando el límite de uso se restablece, la conversación vuelve.",+ "botPanel.backups.row": "Respaldo {position}: {model}",+ "botPanel.backups.remove": "Quitar {model} de los respaldos",+ "botPanel.backups.choose": "Elegir una IA de respaldo",+ "model.fallback.add": "Añadir una IA de respaldo",+ "model.fallback.uses": "Se usan en orden, sin ningún otro ajuste, cuando la IA de este bot llega a su límite de uso o el proveedor demuestra que una solicitud nunca empezó. El trabajo que pudo haberse ejecutado no se repite. Solo cambia ese hilo; los valores predeterminados del bot y los demás hilos no cambian. El proveedor de respaldo puede cobrar.",+ "settings.recovery.ownBackups": "Los bots con sus propios respaldos (Modelo → Modelos de respaldo de este bot) usan esos en su lugar, esté esto activado o no."}diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex 7b5f0d881a..0d6fc1154b 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -2481,5 +2481,13 @@"secretCard.resumed": "Le bot a repris","notifications.status.notice": "Info","mcp.ownBot": "Uniquement pour {bot} : ses fichiers sont dans le dossier de {bot}.",- "mcp.offFor": "Désactivé pour {bots}, car il ne démarre pas pour eux. Il est revérifié automatiquement."+ "mcp.offFor": "Désactivé pour {bots}, car il ne démarre pas pour eux. Il est revérifié automatiquement.",+ "botPanel.backups.title": "IA de secours",+ "botPanel.backups.hint": "Utilisées seulement quand l'IA de {name} atteint sa limite d'utilisation ou ne peut pas commencer un message. La première d'ici qui le peut prend alors le relais, dans cette conversation seulement. Une fois la limite d'utilisation réinitialisée, la conversation revient.",+ "botPanel.backups.row": "Secours {position} : {model}",+ "botPanel.backups.remove": "Retirer {model} des IA de secours",+ "botPanel.backups.choose": "Choisir une IA de secours",+ "model.fallback.add": "Ajouter une IA de secours",+ "model.fallback.uses": "Utilisés dans l'ordre, sans autre réglage, quand l'IA de ce bot atteint sa limite d'utilisation ou que le fournisseur prouve qu'une requête n'a jamais commencé. Le travail qui a pu s'exécuter n'est pas rejoué. Seul ce fil change ; les réglages par défaut du bot et les autres fils restent inchangés. Le fournisseur de secours peut facturer.",+ "settings.recovery.ownBackups": "Les bots qui ont leurs propres secours (Modèle → Modèles de secours de ce bot) utilisent ceux-là, que ceci soit activé ou non."}diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex c67f9bf4c8..51105eb4e7 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -2481,5 +2481,13 @@"secretCard.resumed": "बॉट फिर से चल पड़ा","notifications.status.notice": "सूचना","mcp.ownBot": "सिर्फ़ {bot} के लिए: इसकी फ़ाइलें {bot} के अपने फ़ोल्डर में हैं।",- "mcp.offFor": "{bots} के लिए बंद है, क्योंकि यह उनके लिए शुरू नहीं होता। इसे अपने-आप फिर से जाँचा जाता है।"+ "mcp.offFor": "{bots} के लिए बंद है, क्योंकि यह उनके लिए शुरू नहीं होता। इसे अपने-आप फिर से जाँचा जाता है।",+ "botPanel.backups.title": "बैकअप AI",+ "botPanel.backups.hint": "सिर्फ़ तब इस्तेमाल होते हैं जब {name} का AI अपनी उपयोग सीमा पर हो या किसी संदेश पर काम शुरू ही न कर पाए। तब यहाँ का पहला AI जो संभाल सके, सिर्फ़ उसी बातचीत में काम संभालता है। उपयोग सीमा रीसेट होने के बाद बातचीत वापस लौट आती है।",+ "botPanel.backups.row": "बैकअप {position}: {model}",+ "botPanel.backups.remove": "{model} को बैकअप से हटाएँ",+ "botPanel.backups.choose": "बैकअप AI चुनें",+ "model.fallback.add": "बैकअप AI जोड़ें",+ "model.fallback.uses": "बिना किसी और सेटिंग के, क्रम से इस्तेमाल होते हैं, जब इस बॉट का AI अपनी उपयोग सीमा पर हो या प्रदाता साबित करे कि अनुरोध कभी शुरू ही नहीं हुआ। जो काम चल चुका हो सकता है, उसे दोबारा नहीं चलाया जाता। सिर्फ़ वही थ्रेड बदलता है; बॉट की डिफ़ॉल्ट सेटिंग और बाकी थ्रेड वैसे ही रहते हैं। बैकअप प्रदाता शुल्क ले सकता है।",+ "settings.recovery.ownBackups": "जिन बॉट्स के अपने बैकअप हैं (मॉडल → इस बॉट के बैकअप मॉडल), वे उन्हीं का इस्तेमाल करते हैं, चाहे यह चालू हो या नहीं।"}diff --git a/src/locales/it.json b/src/locales/it.jsonindex 6ef8b25693..bf4bd502e8 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -2368,8 +2368,6 @@"model.section.effortHelpDefault": "Con quanto impegno questo bot ragiona nei gruppi e in ogni conversazione che usa il suo modello. Per impostazione predefinita non viene inviato alcun livello.","model.effort.summary": "{level} impegno","model.fallback.title": "Modelli di riserva per questo bot",- "model.fallback.help": "Se il Ripristino automatico è attivo in Impostazioni app, questi modelli si provano in ordine solo se il fornitore dimostra che la richiesta non è mai partita. Il lavoro che potrebbe essere già stato eseguito non viene ripetuto. Cambia solo quella conversazione; i predefiniti del bot e le altre conversazioni restano invariati. Il fornitore di riserva può addebitare dei costi.",- "model.fallback.off": "Il ripristino automatico è spento. Questo elenco resta inattivo finché non lo attivi in Impostazioni app.","model.fallback.remove": "Rimuovi {name} dall'elenco di riserva","model.effort.label": "Impegno di ragionamento","model.effort.default": "Predefinito",@@ -6129,5 +6127,13 @@"approval.status.timedOut": "Nessuna risposta in tempo: non eseguito","secretCard.ref": "{app} lo conserva per un solo uso da parte dei suoi strumenti. Il tuo bot non lo vede mai e non viene mai aggiunto alla chat.","secretCard.file": "Salvato in un file privato che i comandi del tuo bot possono leggere per 24 ore, poi eliminato. Non viene mai aggiunto alla chat.",- "secretCard.resumed": "Il bot ha ripreso"+ "secretCard.resumed": "Il bot ha ripreso",+ "botPanel.backups.title": "IA di riserva",+ "botPanel.backups.hint": "Usate solo quando l'IA di {name} raggiunge il limite di utilizzo o non riesce a iniziare un messaggio. Subentra allora la prima qui che può farlo, solo in quella conversazione. Quando il limite di utilizzo si azzera, la conversazione torna indietro.",+ "botPanel.backups.row": "Riserva {position}: {model}",+ "botPanel.backups.remove": "Rimuovi {model} dalle riserve",+ "botPanel.backups.choose": "Scegli un'IA di riserva",+ "model.fallback.add": "Aggiungi un'IA di riserva",+ "model.fallback.uses": "Usati in ordine, senza altre impostazioni, quando l'IA di questo bot raggiunge il limite di utilizzo o il fornitore dimostra che una richiesta non è mai partita. Il lavoro che potrebbe essere già stato eseguito non viene ripetuto. Cambia solo quella conversazione; i predefiniti del bot e le altre conversazioni restano invariati. Il fornitore di riserva può addebitare dei costi.",+ "settings.recovery.ownBackups": "I bot con riserve proprie (Modello → Modelli di riserva per questo bot) usano quelle, che questa opzione sia attiva o no."}diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex dbf23809b4..218c7e62c8 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -2486,8 +2486,6 @@"model.section.effortHelpDefault": "グループと、このボットのモデルを使用するすべてのスレッドで、ボットがどれだけ深く考えるかを設定します。既定ではレベルは送信されません。","model.effort.summary": "推論の強度:{level}","model.fallback.title": "このボットのバックアップモデル",- "model.fallback.help": "アプリ設定で「自動復旧」が有効な場合、プロバイダーがリクエストが開始されていないことを確認できたときに限り、これらのモデルを順に試します。実行された可能性のある作業は再実行されません。切り替わるのはそのスレッドだけで、ボットの既定値や他のスレッドは変わりません。バックアップのプロバイダーの料金が発生する場合があります。",- "model.fallback.off": "自動復旧はオフです。アプリ設定で有効にするまで、このリストは機能しません。","model.fallback.remove": "{name}をフォールバックのリストから削除","model.effort.label": "推論の強度","model.effort.default": "既定",@@ -6356,5 +6354,13 @@"approval.status.timedOut": "時間内に回答がなく、実行されませんでした","secretCard.ref": "{app}が自分のツールで1回だけ使うために保管します。ボットが値を見ることはなく、チャットにも追加されません。","secretCard.file": "ボットのコマンドが24時間だけ読める非公開ファイルに保存され、その後削除されます。チャットには追加されません。",- "secretCard.resumed": "ボットが再開しました"+ "secretCard.resumed": "ボットが再開しました",+ "botPanel.backups.title": "予備の AI",+ "botPanel.backups.hint": "{name} の AI が利用上限に達したとき、またはメッセージに取りかかれないときだけ使います。引き継げる最初の AI が、その会話でだけ代わりに応答します。利用上限がリセットされると、会話は元に戻ります。",+ "botPanel.backups.row": "予備 {position}: {model}",+ "botPanel.backups.remove": "{model} を予備から外す",+ "botPanel.backups.choose": "予備の AI を選ぶ",+ "model.fallback.add": "予備の AI を追加",+ "model.fallback.uses": "ほかの設定なしで、このボットの AI が利用上限に達したとき、またはリクエストが開始されていないことをプロバイダーが確認できたときに、順に使います。実行された可能性のある作業は再実行されません。切り替わるのはそのスレッドだけで、ボットの既定値や他のスレッドは変わりません。バックアップのプロバイダーの料金が発生する場合があります。",+ "settings.recovery.ownBackups": "独自の予備があるボット(モデル → このボットのバックアップモデル)は、この設定のオン・オフに関係なく、そちらを使います。"}diff --git a/src/locales/ko.json b/src/locales/ko.jsonindex e113860ed8..4f0e4bd6fe 100644--- a/src/locales/ko.json+++ b/src/locales/ko.json@@ -2636,11 +2636,9 @@"model.section.effortHelpDefault": "그룹과 이 봇의 모델을 쓰는 모든 스레드에서 이 봇이 얼마나 깊이 생각할지 정해요. 기본적으로는 수준을 보내지 않아요.","model.effort.summary": "사고 수준 {level}","model.fallback.title": "이 봇의 백업 모델",- "model.fallback.help": "앱 설정에서 자동 복구가 켜져 있으면, 제공자가 요청이 시작되지 않았다고 확인한 경우에만 이 모델들을 순서대로 시도해요. 이미 실행됐을 수 있는 작업은 다시 실행하지 않아요. 해당 스레드만 전환되고, 봇 기본값과 다른 스레드는 그대로예요. 백업 제공자 요금이 나올 수 있어요.",- "model.fallback.off": "자동 복구가 꺼져 있어요. 앱 설정에서 켜기 전까지 이 목록은 작동하지 않아요.","model.fallback.remove": "대체 목록에서 {name} 제거","model.fallback.model": "{name}의 모델",- "model.fallback.add": "대체 엔진 추가",+ "model.fallback.add": "백업 AI 추가","model.fallback.none": "사용할 수 있는 다른 엔진이 없어요","model.fallback.addOption": "엔진 추가…","model.effort.label": "추론 수준",@@ -6855,5 +6853,12 @@"engineSetup.apiKey.inline": "여기에 붙여 넣으세요. 알아서 저장하고 확인한 뒤 모델이 여기에 나타나요.","secretCard.ref": "{app}이 자체 도구에서 한 번 쓰도록 보관해요. 봇은 절대 보지 못하고, 채팅에도 추가되지 않아요.","secretCard.file": "봇의 명령이 24시간 동안 읽을 수 있는 비공개 파일에 저장된 뒤 삭제돼요. 채팅에는 절대 추가되지 않아요.",- "secretCard.resumed": "봇이 재개됐어요"+ "secretCard.resumed": "봇이 재개됐어요",+ "botPanel.backups.title": "백업 AI",+ "botPanel.backups.hint": "{name}의 AI가 사용 한도에 도달했거나 메시지를 시작하지 못할 때만 써요. 이어받을 수 있는 첫 번째 AI가 그 대화에서만 대신 맡아요. 사용 한도가 초기화되면 대화는 원래대로 돌아가요.",+ "botPanel.backups.row": "백업 {position}: {model}",+ "botPanel.backups.remove": "백업에서 {model} 제거",+ "botPanel.backups.choose": "백업 AI 선택",+ "model.fallback.uses": "다른 설정 없이, 이 봇의 AI가 사용 한도에 도달했거나 제공자가 요청이 시작되지 않았다고 확인하면 순서대로 써요. 이미 실행됐을 수 있는 작업은 다시 실행하지 않아요. 해당 스레드만 전환되고, 봇 기본값과 다른 스레드는 그대로예요. 백업 제공자 요금이 나올 수 있어요.",+ "settings.recovery.ownBackups": "자체 백업이 있는 봇(모델 → 이 봇의 백업 모델)은 이 설정이 켜져 있든 아니든 그 백업을 써요."}diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex 01d38d2926..9b35156da8 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -2408,8 +2408,6 @@"model.section.effortHelpDefault": "Jak intensywnie ten bot myśli w grupach i każdym wątku korzystającym z jego modelu. Domyślnie nie jest wysyłany żaden poziom.","model.effort.summary": "Wysiłek: {level}","model.fallback.title": "Modele zapasowe dla tego bota",- "model.fallback.help": "Gdy w Ustawieniach aplikacji włączone jest automatyczne odzyskiwanie, te modele są wypróbowywane po kolei tylko wtedy, gdy dostawca potwierdzi, że żądanie nigdy nie zostało rozpoczęte. Praca, która mogła zostać wykonana, nie jest powtarzana. Przełącza się tylko ten wątek; domyślne ustawienia bota i inne wątki pozostają bez zmian. Mogą obowiązywać opłaty u dostawcy zapasowego.",- "model.fallback.off": "Automatyczne odzyskiwanie jest wyłączone. Ta lista pozostaje nieaktywna, dopóki nie włączysz jej w Ustawieniach aplikacji.","model.fallback.remove": "Usuń z listy zapasowej: {name}","model.effort.label": "Wysiłek rozumowania","model.effort.default": "Domyślny",@@ -6253,5 +6251,13 @@"approval.status.timedOut": "Brak odpowiedzi na czas — nie uruchomiono","secretCard.ref": "{app} przechowuje go do jednego użycia przez własne narzędzia. Twój bot nigdy go nie widzi i nigdy nie trafia on do czatu.","secretCard.file": "Zapisany w prywatnym pliku, który polecenia twojego bota mogą czytać przez 24 godziny, a potem usunięty. Nigdy nie trafia do czatu.",- "secretCard.resumed": "Bot wznowił pracę"+ "secretCard.resumed": "Bot wznowił pracę",+ "botPanel.backups.title": "Zapasowe AI",+ "botPanel.backups.hint": "Używane tylko wtedy, gdy AI bota {name} osiągnie limit użycia albo nie może zacząć pracy nad wiadomością. Wtedy przejmuje pierwsze z listy, które może, tylko w tej rozmowie. Po zresetowaniu limitu użycia rozmowa wraca.",+ "botPanel.backups.row": "Zapasowe {position}: {model}",+ "botPanel.backups.remove": "Usuń {model} z zapasowych",+ "botPanel.backups.choose": "Wybierz zapasowe AI",+ "model.fallback.add": "Dodaj zapasowe AI",+ "model.fallback.uses": "Używane po kolei, bez żadnych innych ustawień, gdy AI tego bota osiągnie limit użycia albo dostawca potwierdzi, że żądanie nigdy nie zostało rozpoczęte. Praca, która mogła zostać wykonana, nie jest powtarzana. Przełącza się tylko ten wątek; domyślne ustawienia bota i inne wątki pozostają bez zmian. Mogą obowiązywać opłaty u dostawcy zapasowego.",+ "settings.recovery.ownBackups": "Boty z własnymi modelami zapasowymi (Model → Modele zapasowe dla tego bota) używają ich, niezależnie od tego, czy to jest włączone."}diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 3b3efcc906..63c61cdb82 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -2372,8 +2372,6 @@"model.section.effortHelpDefault": "O quanto este bot raciocina em grupos e em todas as conversas que usam seu modelo. Por padrão, nenhum nível é enviado.","model.effort.summary": "Esforço {level}","model.fallback.title": "Modelos de reserva deste bot",- "model.fallback.help": "Quando a recuperação automática está ativada nas Configurações do aplicativo, tenta estes modelos em ordem somente se o provedor confirmar que a solicitação nem começou. Um trabalho que pode ter sido executado não é repetido. Apenas essa conversa muda; o modelo padrão do bot e as outras conversas permanecem iguais. Podem ser cobradas taxas do provedor de reserva.",- "model.fallback.off": "A recuperação automática está desligada. Esta lista fica inativa até você ativá-la nas Configurações do aplicativo.","model.fallback.remove": "Remover {name} da lista de reserva","model.effort.label": "Esforço de raciocínio","model.effort.default": "Padrão",@@ -6114,5 +6112,13 @@"approval.status.timedOut": "Sem resposta a tempo — não foi executado","secretCard.ref": "O {app} guarda para um único uso pelas próprias ferramentas. Seu bot nunca vê o valor, e ele nunca entra no chat.","secretCard.file": "Fica salvo em um arquivo privado que os comandos do seu bot podem ler por 24 horas e depois é apagado. Nunca entra no chat.",- "secretCard.resumed": "O bot continuou"+ "secretCard.resumed": "O bot continuou",+ "botPanel.backups.title": "IAs de reserva",+ "botPanel.backups.hint": "Usadas só quando a IA de {name} atinge o limite de uso ou não consegue começar uma mensagem. A primeira daqui que puder assume, só naquela conversa. Quando o limite de uso é renovado, a conversa volta.",+ "botPanel.backups.row": "Reserva {position}: {model}",+ "botPanel.backups.remove": "Remover {model} das reservas",+ "botPanel.backups.choose": "Escolher uma IA de reserva",+ "model.fallback.add": "Adicionar uma IA de reserva",+ "model.fallback.uses": "Usados em ordem, sem nenhuma outra configuração, quando a IA deste bot atinge o limite de uso ou o provedor confirma que a solicitação nem começou. Um trabalho que pode ter sido executado não é repetido. Apenas essa conversa muda; o modelo padrão do bot e as outras conversas permanecem iguais. Podem ser cobradas taxas do provedor de reserva.",+ "settings.recovery.ownBackups": "Bots com reservas próprias (Modelo → Modelos de reserva deste bot) usam essas, com isto ativado ou não."}diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex bc855c31a2..c878c3439f 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -2467,8 +2467,6 @@"model.section.effortHelpDefault": "Насколько глубоко бот думает в группах и во всех ветках, использующих его модель. По умолчанию уровень не передаётся.","model.effort.summary": "Уровень усилий: {level}","model.fallback.title": "Резервные модели для этого бота",- "model.fallback.help": "Если в настройках приложения включено автоматическое восстановление, эти модели пробуются по порядку только когда провайдер подтверждает, что запрос так и не был запущен. Работа, которая могла уже выполниться, не воспроизводится заново. Переключается только эта ветка; модель по умолчанию для бота и другие ветки остаются без изменений. Возможна оплата запросов к резервному провайдеру.",- "model.fallback.off": "Автоматическое восстановление отключено. Список остаётся неактивным, пока вы не включите его в настройках приложения.","model.fallback.remove": "Убрать {name} из списка резервных моделей","model.effort.label": "Уровень рассуждений","model.effort.default": "По умолчанию",@@ -6334,5 +6332,13 @@"approval.status.timedOut": "Нет ответа вовремя — не выполнено","secretCard.ref": "{app} хранит его для одного использования своими инструментами. Ваш бот никогда его не видит, и он никогда не попадает в чат.","secretCard.file": "Сохраняется в личном файле, который команды вашего бота могут читать 24 часа, а затем удаляется. Он никогда не попадает в чат.",- "secretCard.resumed": "Бот продолжил работу"+ "secretCard.resumed": "Бот продолжил работу",+ "botPanel.backups.title": "Запасные ИИ",+ "botPanel.backups.hint": "Используются, только когда ИИ бота {name} достиг лимита использования или не может начать работу над сообщением. Тогда подключается первый из списка, кто может, и только в этом разговоре. Когда лимит обновится, разговор вернётся к прежнему ИИ.",+ "botPanel.backups.row": "Запасной {position}: {model}",+ "botPanel.backups.remove": "Убрать {model} из запасных",+ "botPanel.backups.choose": "Выбрать запасной ИИ",+ "model.fallback.add": "Добавить запасной ИИ",+ "model.fallback.uses": "Используются по порядку, без других настроек, когда ИИ этого бота достиг лимита использования или провайдер подтверждает, что запрос так и не был запущен. Работа, которая могла уже выполниться, не воспроизводится заново. Переключается только эта ветка; модель по умолчанию для бота и другие ветки остаются без изменений. Возможна оплата запросов к резервному провайдеру.",+ "settings.recovery.ownBackups": "Боты со своими резервными моделями (Модель → Резервные модели для этого бота) используют их, независимо от того, включено ли это."}diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex 4a09185712..946cceb1ce 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -15193,8 +15193,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.effort.label": "3236aeec43e563ca9ea03a7d0c077021021a3e36b4a0648ea5539d07d9e0f379","model.effort.default": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d",@@ -21439,8 +21437,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.effort.label": "3236aeec43e563ca9ea03a7d0c077021021a3e36b4a0648ea5539d07d9e0f379","model.effort.default": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d",@@ -48063,8 +48059,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.effort.label": "3236aeec43e563ca9ea03a7d0c077021021a3e36b4a0648ea5539d07d9e0f379","model.effort.default": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d",@@ -54358,8 +54352,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.effort.label": "3236aeec43e563ca9ea03a7d0c077021021a3e36b4a0648ea5539d07d9e0f379","model.effort.default": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d",@@ -60633,8 +60625,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.effort.label": "3236aeec43e563ca9ea03a7d0c077021021a3e36b4a0648ea5539d07d9e0f379","model.effort.default": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d",@@ -67209,8 +67199,6 @@"model.section.effortHelpDefault": "0b57154bbdd838cbbaed47cb04edea2fed9672f5a09c4fc9919ba84885477c01","model.effort.summary": "b237dbb30a9bd498d08ee3828f5e48bfac2a2452f0767bd15bf131058922ae8b","model.fallback.title": "8430cb1d238d6919509d5d73fa0155bee99a854007f68e8639ccf677eb489370",- "model.fallback.help": "6acd5044ee300b4798587c1f6c10842291698a91846e39a2c55a2b6861c47a5a",- "model.fallback.off": "951b23846200b6d32577af6ba3e871280ce849e40ea8e81a719d1e349dba61bc","model.fallback.remove": "c8dd8c366d80e0a8e3e77276656947f2f9932b580ea279bce52b0793d31e760d","model.fallback.model": "ec3f2e7309bf8a4b3c689743fbdfb3ae3fe1ac8132a7a25e8b38d0f9797f5fe0","model.fallback.add": "f2244d6001ab8ecfa41b5626c65df49b3e4ad7e5fde1224afc71f68d5c407b26",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex 3b9b95d3e0..5a7a33f861 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -4922,5 +4922,13 @@"secretCard.file": "Botunuzun komutlarının 24 saat boyunca okuyabileceği özel bir dosyaya kaydedilir, sonra silinir. Sohbete asla eklenmez.","secretCard.resumed": "Bot devam etti","mcp.ownBot": "Yalnızca {bot} için: dosyaları {bot} botunun kendi klasöründe.",- "mcp.offFor": "{bots} için kapalı, çünkü onlarda başlamıyor. Kendiliğinden yeniden denetlenir."+ "mcp.offFor": "{bots} için kapalı, çünkü onlarda başlamıyor. Kendiliğinden yeniden denetlenir.",+ "botPanel.backups.title": "Yedek yapay zekâlar",+ "botPanel.backups.hint": "Yalnızca {name} adlı botun yapay zekâsı kullanım sınırına ulaştığında ya da bir mesaja hiç başlayamadığında kullanılır. Devralabilen ilk yedek, yalnızca o sohbette devralır. Kullanım sınırı sıfırlanınca sohbet geri döner.",+ "botPanel.backups.row": "Yedek {position}: {model}",+ "botPanel.backups.remove": "{model} modelini yedeklerden kaldır",+ "botPanel.backups.choose": "Yedek yapay zekâ seç",+ "model.fallback.add": "Yedek yapay zekâ ekle",+ "model.fallback.uses": "Başka bir ayar gerekmeden, bu botun yapay zekâsı kullanım sınırına ulaştığında ya da sağlayıcı bir isteğin hiç başlamadığını kanıtladığında sırayla kullanılır. Çalışmış olabilecek işler yeniden yürütülmez. Yalnızca o konu değişir; bot varsayılanları ve diğer konular aynı kalır. Yedek sağlayıcı ücret alabilir.",+ "settings.recovery.ownBackups": "Kendi yedekleri olan botlar (Model → Bu botun yedek modelleri) bu ayar açık olsun ya da olmasın onları kullanır."}diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex 2c440eadf6..b5c8d410d4 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -2924,5 +2924,13 @@"secretCard.resumed": "Бот продовжив роботу","notifications.status.notice": "Повідомлення","mcp.ownBot": "Лише для бота {bot}: його файли лежать у папці бота {bot}.",- "mcp.offFor": "Вимкнено для: {bots}, бо в них він не запускається. Його знову перевіряють автоматично."+ "mcp.offFor": "Вимкнено для: {bots}, бо в них він не запускається. Його знову перевіряють автоматично.",+ "botPanel.backups.title": "Запасні ШІ",+ "botPanel.backups.hint": "Використовуються, лише коли ШІ бота {name} досяг ліміту використання або не може почати роботу над повідомленням. Тоді підхоплює перший зі списку, хто може, і лише в цій розмові. Коли ліміт оновиться, розмова повернеться до свого ШІ.",+ "botPanel.backups.row": "Запасний {position}: {model}",+ "botPanel.backups.remove": "Прибрати {model} із запасних",+ "botPanel.backups.choose": "Вибрати запасний ШІ",+ "model.fallback.add": "Додати запасний ШІ",+ "model.fallback.uses": "Використовуються по черзі, без інших налаштувань, коли ШІ цього бота досяг ліміту використання або провайдер підтверджує, що запит так і не почався. Робота, яка могла вже виконатися, не повторюється. Перемикається лише ця гілка; типові налаштування бота та інші гілки не змінюються. Резервний провайдер може стягувати плату.",+ "settings.recovery.ownBackups": "Боти з власними запасними моделями (Модель → Запасні моделі для цього бота) використовують їх, незалежно від того, чи це ввімкнено."}diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 8c88192f06..94c3a0c822 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -4922,5 +4922,13 @@"secretCard.file": "Được lưu vào một tệp riêng tư mà các lệnh của bot có thể đọc trong 24 giờ, sau đó bị xóa. Nó không bao giờ được thêm vào cuộc trò chuyện.","secretCard.resumed": "Bot đã tiếp tục","mcp.ownBot": "Chỉ dành cho {bot}: các tệp của nó nằm trong thư mục riêng của {bot}.",- "mcp.offFor": "Đã tắt cho {bots} vì nó không khởi động được với họ. Nó sẽ tự được kiểm tra lại."+ "mcp.offFor": "Đã tắt cho {bots} vì nó không khởi động được với họ. Nó sẽ tự được kiểm tra lại.",+ "botPanel.backups.title": "AI dự phòng",+ "botPanel.backups.hint": "Chỉ dùng khi AI của {name} chạm giới hạn sử dụng hoặc không thể bắt đầu xử lý tin nhắn. Khi đó AI đầu tiên ở đây có thể tiếp quản sẽ làm thay, chỉ trong cuộc trò chuyện đó. Khi giới hạn sử dụng được đặt lại, cuộc trò chuyện sẽ quay về.",+ "botPanel.backups.row": "Dự phòng {position}: {model}",+ "botPanel.backups.remove": "Xóa {model} khỏi danh sách dự phòng",+ "botPanel.backups.choose": "Chọn AI dự phòng",+ "model.fallback.add": "Thêm AI dự phòng",+ "model.fallback.uses": "Được dùng theo thứ tự, không cần cài đặt nào khác, khi AI của bot này chạm giới hạn sử dụng hoặc nhà cung cấp xác nhận yêu cầu chưa từng bắt đầu. Công việc có thể đã chạy sẽ không được chạy lại. Chỉ luồng đó chuyển đổi; cài đặt mặc định của bot và các luồng khác vẫn giữ nguyên. Nhà cung cấp dự phòng có thể tính phí.",+ "settings.recovery.ownBackups": "Bot có mô hình dự phòng riêng (Mô hình → Mô hình dự phòng cho bot này) sẽ dùng chúng, dù mục này bật hay tắt."}diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 18f63ba090..908be73ab3 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -4313,5 +4313,13 @@"secretCard.resumed": "機器人已繼續","notifications.status.notice": "通知","mcp.ownBot": "僅限 {bot}:它的檔案在 {bot} 自己的資料夾中。",- "mcp.offFor": "已為 {bots} 關閉,因為它在他們那裡無法啟動。會自動再檢查。"+ "mcp.offFor": "已為 {bots} 關閉,因為它在他們那裡無法啟動。會自動再檢查。",+ "botPanel.backups.title": "備用 AI",+ "botPanel.backups.hint": "僅在 {name} 的 AI 達到使用上限,或無法開始處理訊息時使用。由這裡第一個能接手的 AI 接手,且只限該對話。使用上限重設後,對話會切換回來。",+ "botPanel.backups.row": "備用 {position}:{model}",+ "botPanel.backups.remove": "從備用中移除 {model}",+ "botPanel.backups.choose": "選擇備用 AI",+ "model.fallback.add": "新增備用 AI",+ "model.fallback.uses": "無需其他設定:當此機器人的 AI 達到使用上限,或供應商證明請求從未開始時,依序使用。可能已經執行過的工作不會重播。只有該對話會切換;機器人的預設值和其他對話保持不變。備用供應商可能會收費。",+ "settings.recovery.ownBackups": "有自己備用模型的機器人(模型 → 此機器人的備用模型)會改用它們,無論這裡是否開啟。"}diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex e1afc665a6..79a8a9d37d 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -3332,5 +3332,13 @@"secretCard.resumed": "机器人已继续","notifications.status.notice": "通知","mcp.ownBot": "仅限 {bot}:它的文件在 {bot} 自己的文件夹中。",- "mcp.offFor": "已为 {bots} 关闭,因为它在他们那里无法启动。会自动再次检查。"+ "mcp.offFor": "已为 {bots} 关闭,因为它在他们那里无法启动。会自动再次检查。",+ "botPanel.backups.title": "备用 AI",+ "botPanel.backups.hint": "仅在 {name} 的 AI 达到使用上限,或无法开始处理消息时使用。由这里第一个能接手的 AI 接手,且只限该对话。使用上限重置后,对话会切换回来。",+ "botPanel.backups.row": "备用 {position}:{model}",+ "botPanel.backups.remove": "从备用中移除 {model}",+ "botPanel.backups.choose": "选择备用 AI",+ "model.fallback.add": "添加备用 AI",+ "model.fallback.uses": "无需其他设置:当此机器人的 AI 达到使用上限,或提供方证明请求从未开始时,按顺序使用。可能已经执行过的工作不会重放。只有该对话会切换;机器人的默认设置和其他对话保持不变。备用提供方可能会收费。",+ "settings.recovery.ownBackups": "有自己备用模型的机器人(模型 → 此机器人的备用模型)会改用它们,无论这里是否开启。"}