Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Allow per-bot Fish and GPT-Live call settings

vincent7c2b58ca9cee
diff --git a/packages/phone-protocol/src/live-call-wire.ts b/packages/phone-protocol/src/live-call-wire.ts
index 90367e23cd..f473558fb2 100644
--- a/packages/phone-protocol/src/live-call-wire.ts
+++ b/packages/phone-protocol/src/live-call-wire.ts
@@ -61,6 +61,9 @@ export interface LiveCallRecord {
* "custom": an OpenAI-compatible server the person names (a gateway that serves the GPT-Live API), reached like OpenAI. */
export type LiveProvider = "openai" | "azure" | "fish" | "gemini" | "elevenlabs" | "custom";
+/** A bot can choose GPT-Live or Fish Live 3 while sharing the workspace's provider credentials. */
+export type BotLiveOverride = { provider: "openai" } | { provider: "fish"; fishAgentId?: string };
+
/** `live`: the key saved for Live calls only; `openai`: the OpenAI API key from Settings → API keys, used when there is no `live` key;
* `fishAudio`: the Fish Audio key from Settings → API keys, the only key a Fish Audio call uses;
* `gemini`: the Gemini key from Settings → API keys, the only key a Gemini call uses;
diff --git a/packages/phone-protocol/src/wire.ts b/packages/phone-protocol/src/wire.ts
index ac5a800392..6ca1c88444 100644
--- a/packages/phone-protocol/src/wire.ts
+++ b/packages/phone-protocol/src/wire.ts
@@ -33,7 +33,7 @@ import type { Routine, RoutineRun } from "./routines.ts";
import type { WebhookAttempt, WebhookTrigger } from "./webhooks.ts";
import type { PublishedPageCard } from "./published-page.ts";
import type { InboxItem, InboxTask } from "./inbox.ts";
-import type { LiveCallRecord, LiveCallState } from "./live-call-wire.ts";
+import type { BotLiveOverride, LiveCallRecord, LiveCallState } from "./live-call-wire.ts";
import type { ForkOrigin, TaskClosedBy, TaskOpenedBy } from "./task-provenance.ts"; import type { RoomThreadCloser } from "./room-threads.ts";
import type { CompanionEndpointsSnapshot } from "./responses.ts";
/** What a team bot's main chat is called, beside each person's own chats. */
@@ -326,6 +326,7 @@ export interface WireBot extends DefaultBotFields, BotAccessFields {
/** This bot's own voice id, so a room of bots doesn't sound like one person. */
voice?: string;
/** This bot's own Live call voice, a GPT-Live or Gemini Live voice id; absent, or not the call provider's, uses the app's. */ liveVoice?: string;
+ /** Absent uses the workspace's Live service. */ liveOverride?: BotLiveOverride;
/** Whether this bot may send voice notes. Absent/true = allowed; false
* hides the tool and refuses the route even with a voice configured. */
voiceNotes?: boolean; /** The harness speaks each reply as a voice note; absent follows the installation's `tts.everyReply`. */ voiceNoteEveryReply?: boolean;
diff --git a/scripts/testing/file-size-ratchet.test.ts b/scripts/testing/file-size-ratchet.test.ts
index 10a4ea7392..74e4f4e34c 100644
--- a/scripts/testing/file-size-ratchet.test.ts
+++ b/scripts/testing/file-size-ratchet.test.ts
@@ -38,6 +38,7 @@ const LINES: Record<string, number> = {
"server/boat.ts": 1253,
"server/plan-usage.ts": 1039,
"server/container-computer.ts": 1156,
+ "packages/phone-protocol/src/wire.ts": 1001,
"src/components/ModelPicker.tsx": 1017,
"src/components/PhoneSetupFlow.tsx": 1085,
"server/cli.ts": 1052,
diff --git a/server/index.ts b/server/index.ts
index 2d5930c9d1..e597d3945e 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -12328,7 +12328,7 @@ const liveCalls = new LiveCallController({
return task.activity === "waiting-on-you" ? "waiting" : "working";
},
broadcast: (frame) => broadcast(frame, { adminOnly: true }),
- settings: () => liveCallSettings(cfg), botVoice: (botId) => store.bot(botId)?.liveVoice,
+ settings: (botId) => liveCallSettings(cfg, botId ? store.bot(botId)?.liveOverride : undefined), botVoice: (botId) => store.bot(botId)?.liveVoice,
azureRefusal: (auth) => azureLiveCallRefusal(auth, { othersOnLoopback: adminActivityRecording() }),
...liveWiring.calls,
speakable: (text) => toUtterances(text),
diff --git a/server/live-call-controller.ts b/server/live-call-controller.ts
index 520a06ebae..9c243f4495 100644
--- a/server/live-call-controller.ts
+++ b/server/live-call-controller.ts
@@ -72,7 +72,7 @@ export interface LiveCallDeps {
activity(botId: string, threadId: string): LiveActivity;
broadcast(frame: { kind: "live.call"; botId: string; threadId: string; call: LiveCallState | null }): void;
/** `endpoint` null, or a `setupProblem`, refuses the call with that message (409). */
- settings(): { key: string; endpoint: LiveEndpoint | null; setupProblem?: string | null; provider?: LiveProvider; voice: string; geminiVoice?: string; readTypedReplies: boolean; idleMinutes: number };
+ settings(botId?: string): { key: string; endpoint: LiveEndpoint | null; setupProblem?: string | null; provider?: LiveProvider; voice: string; geminiVoice?: string; readTypedReplies: boolean; idleMinutes: number };
/** The called bot's own Live call voice, used over the app's when it is the call provider's. */
botVoice?(botId: string): string | undefined;
/** Why this caller may not hold a call through Azure OpenAI; null when they may. Required, so no wiring can leave it out. */
@@ -187,7 +187,7 @@ export class LiveCallController {
}
async start(input: { auth: RequestAuth; device?: string; botId: string; botName: string; threadId: string; client: LiveClient; sdp?: string; relays?: readonly LiveRelayClient[] }): Promise<LiveCallStarted> {
- const settings = this.deps.settings();
+ const settings = this.deps.settings(input.botId);
// First: someone refused here is not told about a running call, or sent to set Azure or a relayed service up.
// The chosen relayed service comes before a key's endpoint, so its refusal and its mismatch check apply.
const relayedChoice = relayedProvider(settings.provider);
diff --git a/server/live-call.e2e.test.ts b/server/live-call.e2e.test.ts
index 2a400ac2f1..af8a1a00af 100644
--- a/server/live-call.e2e.test.ts
+++ b/server/live-call.e2e.test.ts
@@ -2,6 +2,7 @@
import { randomBytes } from "node:crypto";
import { spawn, type ChildProcess } from "node:child_process";
import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
+import { createServer, type Server } from "node:http";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -29,6 +30,8 @@ posixOnly("Live call e2e", () => {
let base = "";
let output = "";
let live: FakeOpenAiLive;
+ let fish: Server;
+ const fishRequests: { path?: string; key?: string; agent?: string }[] = [];
/** while missing, the `steer` engine holds its turn open after its tool result */
let steerGate = "";
/** the fake claude's one-shot replies, by a marker in the prompt */
@@ -76,6 +79,17 @@ posixOnly("Live call e2e", () => {
chmodSync(FAKE_ACP, 0o755);
chmodSync(FAKE_CODEX, 0o755);
live = await startFakeOpenAiLive();
+ fish = createServer(async (req, res) => {
+ const chunks: Buffer[] = [];
+ for await (const chunk of req) chunks.push(chunk);
+ const json = Buffer.concat(chunks).toString();
+ fishRequests.push({ path: req.url, key: req.headers.authorization, agent: json ? JSON.parse(json).agent_id : undefined });
+ res.setHeader("content-type", "application/json");
+ res.end(JSON.stringify({ session_id: "fish-session", transport: "livekit", token: "fixture-token", livekit_url: "wss://fish.invalid" }));
+ });
+ await new Promise<void>((resolve) => fish.listen(0, "127.0.0.1", resolve));
+ const fishAddress = fish.address();
+ if (!fishAddress || typeof fishAddress === "string") throw new Error("Fish fixture did not open a TCP port");
home = mkdtempSync(join(tmpdir(), "omb-live-call-"));
mkdirSync(join(home, ".openmausbot"), { recursive: true });
steerGate = join(home, "steer.gate");
@@ -123,6 +137,8 @@ posixOnly("Live call e2e", () => {
OMB_WEBHOOK_PORT: String(port + 1),
OMB_OPENAI_LIVE_URL: live.url,
OMB_OPENAI_LIVE_KEY: LIVE_KEY,
+ OMB_FISH_LIVE_URL: `http://127.0.0.1:${fishAddress.port}`,
+ OMB_FISH_AUDIO_API_KEY: "fixture-fish-key",
},
stdio: ["ignore", "pipe", "pipe"],
});
@@ -144,9 +160,48 @@ posixOnly("Live call e2e", () => {
afterAll(async () => {
await waitForExit(child, { signal: "SIGTERM" });
await live?.stop();
+ if (fish) await new Promise<void>((resolve) => fish.close(() => resolve()));
if (home) await removeTempDir(home);
});
+ it("uses the selected Fish agent on web and a different bot's GPT-Live preset on a native call", async () => {
+ const fishBot = await createBot();
+ const openAiBot = await createBot();
+ const patchBot = (botId: string, patch: unknown) => fetch(`${base}/api/bots/${botId}`, {
+ method: "PATCH", headers: { "content-type": "application/json" }, body: JSON.stringify(patch),
+ });
+ const patchWorkspace = (provider: string) => fetch(`${base}/api/live/settings`, {
+ method: "PATCH", headers: { "content-type": "application/json" }, body: JSON.stringify({ provider }),
+ });
+ try {
+ expect((await patchBot(fishBot.id, { liveOverride: { provider: "fish", fishAgentId: "agent_selected", key: "untrusted" } })).status).toBe(400);
+ const saved = await patchBot(fishBot.id, { liveOverride: { provider: "fish", fishAgentId: "agent_selected" } });
+ expect(saved.status).toBe(200);
+ expect(await saved.json()).toMatchObject({ bot: { liveOverride: { provider: "fish", fishAgentId: "agent_selected" } } });
+ expect((await patchWorkspace("gemini")).status).toBe(200);
+ const denied = await post("/api/live/session", { botId: fishBot.id, client: "android", sdp: SDP });
+ expect(denied.status).toBe(400);
+ const started = await post("/api/live/session", { botId: fishBot.id, client: "web" });
+ expect(started).toMatchObject({ status: 201, body: { transport: { type: "fish" } } });
+ expect(fishRequests).toEqual([{ path: "/v1/agent/sessions", key: "Bearer fixture-fish-key", agent: "agent_selected" }]);
+ const { call: fishCall, transport } = started.body as { call: LiveCallState; transport: { relayToken: string; session: { session_id: string } } };
+ await post("/api/live/relay", { token: transport.relayToken, sessionId: transport.session.session_id, events: [{ type: "connected" }] });
+ expect((await post("/api/live/call/end", { callId: fishCall.callId })).status).toBe(200);
+
+ expect((await patchBot(openAiBot.id, { liveOverride: { provider: "openai" }, liveVoice: "cedar" })).status).toBe(200);
+ const { call, session } = await startCall(openAiBot.id, "android");
+ expect(session.body).toMatchObject({ session: { audio: { output: { voice: "cedar" } } } });
+ await live.waitForAttach(session.id);
+ expect((await post("/api/live/call/end", { callId: call.callId })).status).toBe(200);
+ expect((await patchBot(openAiBot.id, { liveOverride: null })).status).toBe(200);
+ expect((await post("/api/live/session", { botId: openAiBot.id, client: "android", sdp: SDP })).status).toBe(400);
+ } finally {
+ const { call } = await (await fetch(`${base}/api/live/call`)).json() as { call: LiveCallState | null };
+ if (call) await post("/api/live/call/end", { callId: call.callId });
+ await patchWorkspace("openai");
+ }
+ }, 40_000);
+
it("runs a spoken request through the bot and speaks the answer", async () => {
const bot = await createBot();
const sse = await openSse(`${base}/api/events`);
diff --git a/server/live-call.ts b/server/live-call.ts
index f00f582834..a3854fff8c 100644
--- a/server/live-call.ts
+++ b/server/live-call.ts
@@ -52,6 +52,8 @@ export interface LiveEndpoint {
apiBase: string;
/** The OpenAI model id, the Azure deployment name, the Fish Audio agent id or ElevenLabs agent id ('' until one is set up) or the Gemini Live model id. */
model: string;
+ /** A selected Fish agent belongs to its account and is never modified by the harness. */
+ fixedAgent?: true;
}
export function liveProviderName(provider: LiveProvider): string {
diff --git a/server/live-fish.ts b/server/live-fish.ts
index 31adbb20ce..e77dbb3a82 100644
--- a/server/live-fish.ts
+++ b/server/live-fish.ts
@@ -11,7 +11,7 @@ const CREATE_TIMEOUT_MS = 20_000;
const END_TIMEOUT_MS = 5_000;
const SETUP_TIMEOUT_MS = 8_000;
/** Fish agent ids as the dashboard and `GET /v1/agent/agents` show them. */
-const AGENT_ID = /^[\w-]{1,128}$/;
+export const FISH_AGENT_ID = /^[\w-]{1,128}$/;
const HISTORY_MESSAGES = 8;
const HISTORY_MESSAGE_CHARS = 600;
const HISTORY_TOTAL_CHARS = 6_000;
@@ -31,7 +31,7 @@ export function fishLiveBaseUrl(env: NodeJS.ProcessEnv = process.env): string {
/** `model` is the agent id, "" while no usable one is saved. */
export function fishLiveEndpoint(agentId: string | null | undefined, env: NodeJS.ProcessEnv = process.env): LiveEndpoint {
const id = agentId?.trim() ?? "";
- return { provider: "fish", apiBase: `${fishLiveBaseUrl(env)}/v1/agent`, model: AGENT_ID.test(id) ? id : "" };
+ return { provider: "fish", apiBase: `${fishLiveBaseUrl(env)}/v1/agent`, model: FISH_AGENT_ID.test(id) ? id : "" };
}
/** Which Fish Audio account an agent was set up on, without keeping its key. */
@@ -42,7 +42,7 @@ export function fishKeyPrint(key: string): string {
/** The saved agent, while it belongs to the account of `key` or was set by the operator (no `fishAgentFor`). */
export function usableFishAgent(live: LiveConfig | undefined, key: string): string | null {
const id = live?.fishAgentId?.trim() ?? "";
- if (!AGENT_ID.test(id)) return null;
+ if (!FISH_AGENT_ID.test(id)) return null;
return live?.fishAgentFor === undefined || (key.trim() !== "" && live.fishAgentFor === fishKeyPrint(key)) ? id : null;
}
@@ -78,7 +78,7 @@ export async function setUpFishAgent(key: string, endpoint: LiveEndpoint, produc
name: `${product} Live calls`.slice(0, 120),
config: { voice: { engine: "live3", speaking_language: language }, tools: { enabled: true, tool_ids: [toolId] } },
});
- const agentId = typeof agent.agent_id === "string" && AGENT_ID.test(agent.agent_id) ? agent.agent_id : "";
+ const agentId = typeof agent.agent_id === "string" && FISH_AGENT_ID.test(agent.agent_id) ? agent.agent_id : "";
if (!agentId) throw new LiveSessionError(FISH_UNEXPECTED, 502);
await call("PATCH", `/agents/${encodeURIComponent(agentId)}`, { overrides_allowed: ["system_prompt"] });
await call("POST", `/agents/${encodeURIComponent(agentId)}/publish`, {});
diff --git a/server/live-session-wiring.ts b/server/live-session-wiring.ts
index 936498d8aa..7dcbe59ea9 100644
--- a/server/live-session-wiring.ts
+++ b/server/live-session-wiring.ts
@@ -64,6 +64,7 @@ export function liveSessionWiring(input: LiveSessionWiringInput): {
const startFish = async (key: string, endpoint: LiveEndpoint, botId: string, threadId: string) => {
const session = { key, bot: input.bot(botId), history: input.history(threadId), cloudHome: input.cloudHome, fetchImpl };
+ if (endpoint.fixedAgent) return { agent: endpoint, token: await createFishLiveSession({ ...session, endpoint }) };
const language = fishSpeakingLanguage(input.language?.());
if (endpoint.model) await speakLanguage(key, endpoint, language);
let agent = endpoint.model ? endpoint : await setUpAgent(key, endpoint, language);
diff --git a/server/live-settings.ts b/server/live-settings.ts
index 6224d4d612..9b5af19b9c 100644
--- a/server/live-settings.ts
+++ b/server/live-settings.ts
@@ -1,4 +1,4 @@
-import type { LiveKeySource, LiveSettings } from "../shared/wire.ts";
+import type { LiveKeySource, LiveSettings, WireBot } from "../shared/wire.ts";
import { saveConfig, syncCredentialEnv, type AppConfig } from "./config.ts";
import { azureLiveEndpoint, customLiveEndpoint, LIVE_NEEDS_AZURE, LIVE_NEEDS_CUSTOM, LIVE_NEEDS_ELEVENLABS, LIVE_NEEDS_FISH, LIVE_NEEDS_GEMINI, LIVE_NEEDS_KEY, openAiLiveEndpoint, type LiveEndpoint } from "./live-call.ts";
import { liveSavePatch, usableLiveKey, type LiveConfig as LiveConfigSection } from "./live-config.ts";
@@ -62,8 +62,12 @@ export function saveLiveSettings(cfg: Pick<AppConfig, "live">, patch: LiveConfig
}
/** What a call start reads, once: its key, endpoint and provider all come from this one reading. */
-export function liveCallSettings(cfg: AppConfig) {
- return { key: liveCallKey(cfg)?.key ?? "", endpoint: liveCallEndpoint(cfg), setupProblem: liveSetupProblem(cfg), ...liveSettingsFor(cfg) };
+export function liveCallSettings(cfg: AppConfig, override?: WireBot["liveOverride"]) {
+ const effective = override ? { ...cfg, live: { ...cfg.live, provider: override.provider } } : cfg;
+ const agentId = override?.provider === "fish" ? override.fishAgentId : undefined;
+ const endpoint = agentId ? { ...fishLiveEndpoint(agentId), fixedAgent: true as const } : liveCallEndpoint(effective);
+ const setupProblem = agentId && !endpoint?.model ? "The bot's Fish Audio agent ID is invalid." : liveSetupProblem(effective);
+ return { key: liveCallKey(effective)?.key ?? "", endpoint, setupProblem, ...liveSettingsFor(effective) };
}
/** A caller without the admin scope learns which service calls use, not which Azure resource or custom endpoint. */
diff --git a/server/routes/bot-patch.ts b/server/routes/bot-patch.ts
index 9a664d9b27..5670d77a5f 100644
--- a/server/routes/bot-patch.ts
+++ b/server/routes/bot-patch.ts
@@ -34,7 +34,8 @@ import type { MemoryUpkeep } from "../memory-upkeep.ts";
import { phoneAppsFor } from "../phones/access.ts";
import { profileSnapshot } from "../profile-revision.ts";
import { recordProfileChange } from "../profile-versions.ts";
-import { memberBotPatchViolation, requestSource, type RequestAuth } from "../request-auth.ts"; import { defaultBotPatchRefusal, ownsDefaultBot } from "../default-bot.ts";
+import { memberBotPatchViolation, ownerOrAdmin, requestSource, type RequestAuth } from "../request-auth.ts";
+import { FISH_AGENT_ID } from "../live-fish.ts"; import { defaultBotPatchRefusal, ownsDefaultBot } from "../default-bot.ts";
import type { RoutineManager } from "../routines.ts";
import type { SessionRegistry } from "../sessions.ts";
import { parseConnectorTools } from "../connector-tools.ts";
@@ -109,6 +110,10 @@ export function createBotPatchRoutes(deps: BotPatchRouteDeps): RouteHandler {
revokeInternalCapabilitiesForThread, runningTurnInstance, closeOpenApprovals, assertTeamComputerChangeIdle, forgetTemporaryBrowser,
} = deps;
const pinnedClientThread = pinnedClientThreadGuard(store);
+ const liveOverrideSchema = z.discriminatedUnion("provider", [
+ z.strictObject({ provider: z.literal("openai") }),
+ z.strictObject({ provider: z.literal("fish"), fishAgentId: z.string().trim().regex(FISH_AGENT_ID).optional() }),
+ ]).nullable();
return async ({ req, res, path, method, auth, json, readBody }) => {
let m: RegExpMatchArray | null = null;
const routines = deps.routines();
@@ -327,6 +332,12 @@ export function createBotPatchRoutes(deps: BotPatchRouteDeps): RouteHandler {
if (body.liveVoice !== null && body.liveVoice !== "" && !isBotLiveVoice(body.liveVoice)) return json(res, 400, { error: "liveVoice must be a GPT-Live or Gemini Live voice, or empty" });
patch.liveVoice = body.liveVoice || undefined;
}
+ if (body.liveOverride !== undefined) {
+ if (!ownerOrAdmin(auth)) return json(res, 403, { error: "Only a workspace admin can change a bot's Live provider." });
+ const parsed = liveOverrideSchema.safeParse(body.liveOverride);
+ if (!parsed.success) return json(res, 400, { error: "Select OpenAI or Fish Audio Live 3, with an optional Fish agent ID." });
+ patch.liveOverride = parsed.data ?? undefined;
+ }
// Spends the Cloud plan's monthly X research calls: an admin decision too.
if (body.xResearch !== undefined) {
if (typeof body.xResearch !== "boolean") return json(res, 400, { error: "xResearch must be true or false" });
diff --git a/src/components/CallView.composer.test.ts b/src/components/CallView.composer.test.ts
index 99dd1629d6..e048bd6a19 100644
--- a/src/components/CallView.composer.test.ts
+++ b/src/components/CallView.composer.test.ts
@@ -153,7 +153,7 @@ describe("composer call button", () => {
expect(fixture.startCall).not.toHaveBeenCalled();
});
- it("is a Live call on a device that can't take turns", () => {
+ it("is a Live call on a device that can't take turns", async () => {
fixture.dictation = false;
const getUserMedia = vi.fn(() => new Promise<MediaStream>(() => {}));
configureLiveMedia({ getUserMedia });
@@ -161,6 +161,7 @@ describe("composer call button", () => {
expect(button.props["aria-label"]).toBe("Live call with Pepper");
expect(html).not.toContain("bg-warning");
button.props.onClick!();
+ await Promise.resolve();
expect(getUserMedia).toHaveBeenCalledTimes(1);
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "pepper" });
expect(fixture.track).toHaveBeenCalledWith("call_started", { driver: "codex", mode: "live" });
diff --git a/src/components/CallView.mode-menu.test.ts b/src/components/CallView.mode-menu.test.ts
index 52646b3dae..01d45c035d 100644
--- a/src/components/CallView.mode-menu.test.ts
+++ b/src/components/CallView.mode-menu.test.ts
@@ -85,21 +85,23 @@ afterEach(() => {
});
describe("the call button", () => {
- it("starts a Live call through the Live media, not the take-turns overlay", () => {
+ it("starts a Live call through the Live media, not the take-turns overlay", async () => {
setCallMode("live");
const onStart = vi.fn();
pressPhone(onStart);
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "thread-atlas" });
expect(onStart).toHaveBeenCalledWith("live");
});
- it("asks for the microphone before the key when Live has none", () => {
+ it("asks for the microphone before the key when Live has none", async () => {
fixture.liveConfigured = false;
setCallMode("live");
const getUserMedia = vi.fn(() => new Promise<MediaStream>(() => {}));
configureLiveMedia({ getUserMedia });
const onStart = vi.fn();
pressPhone(onStart);
+ await Promise.resolve();
expect(getUserMedia).toHaveBeenCalledTimes(1);
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "thread-atlas" });
expect(renderButton()).not.toContain("OpenAI API key");
diff --git a/src/components/CallView.start-request.test.ts b/src/components/CallView.start-request.test.ts
index cc661a6eca..e8672d5571 100644
--- a/src/components/CallView.start-request.test.ts
+++ b/src/components/CallView.start-request.test.ts
@@ -79,14 +79,15 @@ describe("a call started from the composer's + menu", () => {
expect(callMode()).toBe("turns");
});
- it("goes Live through the Live media", () => {
+ it("goes Live through the Live media", async () => {
flushSync(() => requestCallStart("atlas", "live"));
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "thread-atlas" });
expect(onStart).toHaveBeenCalledWith("live");
expect(callMode()).toBe("live");
});
- it("goes Live from a blank chat once the conversation it makes exists", () => {
+ it("goes Live from a blank chat once the conversation it makes exists", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
expect(onStart).toHaveBeenCalledWith("live");
@@ -94,10 +95,11 @@ describe("a call started from the composer's + menu", () => {
expect(fixture.dispatch).toHaveBeenCalledExactlyOnceWith(expect.objectContaining({ type: "makeNewChat", botId: "atlas", threadId: newChatThreadId("atlas") }));
flushSync(() => fixture.dispatch.mock.calls[0][0].onMade("made"));
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "made" });
});
- it("waits for the blank chat's Live start when Live is pressed again before its settings are saved", () => {
+ it("waits for the blank chat's Live start when Live is pressed again before its settings are saved", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
render("made");
@@ -106,19 +108,21 @@ describe("a call started from the composer's + menu", () => {
expect(fixture.dispatch).toHaveBeenCalledOnce();
flushSync(() => fixture.dispatch.mock.calls[0][0].onMade("made"));
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "made" });
});
- it("lets Live be pressed again once making the blank chat's conversation failed", () => {
+ it("lets Live be pressed again once making the blank chat's conversation failed", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
flushSync(() => fixture.dispatch.mock.calls[0][0].onError());
render("made");
flushSync(() => requestCallStart("atlas", "live"));
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "made" });
});
- it("never goes Live from a blank chat after a Turns call started and hung up while the conversation was being made", () => {
+ it("never goes Live from a blank chat after a Turns call started and hung up while the conversation was being made", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
flushSync(() => requestCallStart("atlas", "turns"));
@@ -126,10 +130,11 @@ describe("a call started from the composer's + menu", () => {
flushSync(() => endCall("atlas"));
flushSync(() => fixture.dispatch.mock.calls[0][0].onMade("made"));
+ await Promise.resolve();
expect(liveMedia().phase).toBe("idle");
});
- it("waits for the blank chat's Live start when the made conversation remounts the button before Live is pressed again", () => {
+ it("waits for the blank chat's Live start when the made conversation remounts the button before Live is pressed again", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
remount();
@@ -139,10 +144,11 @@ describe("a call started from the composer's + menu", () => {
expect(fixture.dispatch).toHaveBeenCalledOnce();
flushSync(() => fixture.dispatch.mock.calls[0][0].onMade("made"));
+ await Promise.resolve();
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "atlas", threadId: "made" });
});
- it("never goes Live from a blank chat after a Turns call started on the remounted button", () => {
+ it("never goes Live from a blank chat after a Turns call started on the remounted button", async () => {
render(newChatThreadId("atlas"));
flushSync(() => requestCallStart("atlas", "live"));
remount();
@@ -152,6 +158,7 @@ describe("a call started from the composer's + menu", () => {
flushSync(() => endCall("atlas"));
flushSync(() => fixture.dispatch.mock.calls[0][0].onMade("made"));
+ await Promise.resolve();
expect(liveMedia().phase).toBe("idle");
});
diff --git a/src/components/CallView.tsx b/src/components/CallView.tsx
index 27b1ae01b0..ec1dfcba78 100644
--- a/src/components/CallView.tsx
+++ b/src/components/CallView.tsx
@@ -63,6 +63,7 @@ export function CallButton({ bot, placement = "header", fill, ink, inverse, mode
targetId={bot.id}
targetName={bot.name}
threadId={bot.threadId}
+ liveOverride={bot.liveOverride?.provider}
voices={[bot.voice]}
setupBotId={bot.id}
requireExplicitVoices={false}
@@ -76,6 +77,7 @@ export function CallTargetButton({
targetId,
targetName,
threadId,
+ liveOverride,
voices,
setupBotId,
requireExplicitVoices,
@@ -95,13 +97,14 @@ export function CallTargetButton({
targetId: string;
targetName: string;
threadId?: string;
+ liveOverride?: NonNullable<Bot["liveOverride"]>["provider"];
voices: Array<string | undefined>;
setupBotId?: string;
requireExplicitVoices: boolean;
liveCapable?: boolean;
onStart: (mode: CallMode) => void;
}) {
- const { state, dispatch } = useStore();
+ const { state, dispatch, flushBotPatches } = useStore();
const showThreads = useShowThreads();
const { capabilities, ready: capabilitiesReady } = useDesktopCapabilities();
const media = useLiveMedia();
@@ -198,15 +201,17 @@ export function CallTargetButton({
const request = ++pending.request;
if (next === "live" && liveThreadId !== undefined) {
onStart("live");
- const live = (thread: string) => {
+ const live = async (thread: string) => {
+ const saved = await flushBotPatches?.(targetId);
if (pending.waiting === request) pending.waiting = 0;
- if (pending.request === request) void startLiveCall({ botId: targetId, threadId: thread, provider: state.config?.live?.provider });
+ const provider = (saved ? saved.liveOverride?.provider : liveOverride) ?? state.config?.live?.provider;
+ if (pending.request === request) void startLiveCall({ botId: targetId, threadId: thread, provider });
};
+ pending.waiting = request;
if (isNewChatThread(liveThreadId)) {
- pending.waiting = request;
const failed = () => { if (pending.waiting === request) pending.waiting = 0; };
dispatch({ type: "makeNewChat", botId: targetId, threadId: liveThreadId, onMade: live, onError: failed });
- } else live(liveThreadId);
+ } else void live(liveThreadId);
return;
}
if (!turnsReady) {
@@ -359,7 +364,7 @@ export function CallTargetButton({
id={keyId}
className={cn("animate-pop-in absolute right-0 z-30 max-h-[calc(100dvh-80px)] w-[340px] max-w-[90vw] overflow-y-auto overscroll-contain rounded-xl shadow-2xl", composer ? "bottom-full mb-1.5" : "top-full mt-1.5")}
>
- <LiveKeyNeeded />
+ <LiveKeyNeeded override={liveOverride} />
</div>
)}
diff --git a/src/components/CallView.voiceSetup.test.ts b/src/components/CallView.voiceSetup.test.ts
index 4118206979..2f2cd9c8bc 100644
--- a/src/components/CallView.voiceSetup.test.ts
+++ b/src/components/CallView.voiceSetup.test.ts
@@ -264,11 +264,12 @@ describe("setting up a voice from the call button", () => {
]);
});
- it("starts the Live call, not voice set-up, where the device can't take turns", () => {
+ it("starts the Live call, not voice set-up, where the device can't take turns", async () => {
fixture.dictation = { available: false, reasonCode: "remote-server" };
const getUserMedia = vi.fn(() => new Promise<MediaStream>(() => {}));
configureLiveMedia({ getUserMedia });
click(find(render(), "data-call-button"));
+ await Promise.resolve();
expect(getUserMedia).toHaveBeenCalledTimes(1);
expect(liveMedia()).toMatchObject({ phase: "starting", botId: "pepper", threadId: "t" });
expect(fixture.track).toHaveBeenCalledWith("call_started", { driver: "codex", mode: "live" });
diff --git a/src/components/LiveCallSettings.tsx b/src/components/LiveCallSettings.tsx
index bd9bfcf7ba..7819bed680 100644
--- a/src/components/LiveCallSettings.tsx
+++ b/src/components/LiveCallSettings.tsx
@@ -14,7 +14,7 @@ import { Select } from "./Select";
const IDLE_CHOICES = [1, 2, 3, 5, 10, 15, 30, 60];
/** With `bot`, the bot on the call: it can have a voice of its own, and the other voice is the default for every other bot. */
-export function LiveCallSettings({ bot, onClose }: { bot?: Pick<Bot, "id" | "name" | "liveVoice">; onClose: () => void }) {
+export function LiveCallSettings({ bot, onClose }: { bot?: Pick<Bot, "id" | "name" | "liveVoice" | "liveOverride">; onClose: () => void }) {
const { state, dispatch } = useStore();
const live: LiveSettings = state.config?.live ?? { configured: false, voice: "", readTypedReplies: true, idleMinutes: 5 };
const [saving, setSaving] = useState(false);
@@ -32,6 +32,7 @@ export function LiveCallSettings({ bot, onClose }: { bot?: Pick<Bot, "id" | "nam
const fish = live.provider === "fish";
const gemini = live.provider === "gemini";
const elevenlabs = live.provider === "elevenlabs";
+ const botProvider = bot?.liveOverride?.provider ?? live.provider;
const copy = liveKeyCopy(live.provider);
const hasKey = live.keySource === (fish ? "fishAudio" : gemini ? "gemini" : elevenlabs ? "elevenlabs" : "live");
// Gemini has its own voices, kept apart from the GPT-Live one.
@@ -82,10 +83,10 @@ export function LiveCallSettings({ bot, onClose }: { bot?: Pick<Bot, "id" | "nam
>
<LiveProviderSettings locked={keySaving} onSaving={setProviderSaving} />
{/* Fish Audio and ElevenLabs calls speak in their agent's own voice. */}
- {!fish && !elevenlabs && <>
- {bot && (
- <BotLiveVoiceSelect bot={bot} gemini={gemini} onChange={(liveVoice) => dispatch({ type: "updateBot", botId: bot.id, patch: { liveVoice } })} />
+ {bot && botProvider !== "fish" && botProvider !== "elevenlabs" && (
+ <BotLiveVoiceSelect bot={bot} gemini={botProvider === "gemini"} onChange={(liveVoice) => dispatch({ type: "updateBot", botId: bot.id, patch: { liveVoice } })} />
)}
+ {!fish && !elevenlabs && <>
<label className="flex items-center justify-between gap-2">
<span className="text-ink-secondary">{t(bot ? "call.live.defaultVoice" : "call.live.voice")}</span>
<Select
diff --git a/src/components/LiveKeyNeeded.tsx b/src/components/LiveKeyNeeded.tsx
index 1888af6124..5e52ccf546 100644
--- a/src/components/LiveKeyNeeded.tsx
+++ b/src/components/LiveKeyNeeded.tsx
@@ -9,9 +9,16 @@ import { openKeySettings } from "./keys/key-focus";
import { LiveKeySetup } from "./LiveKeySetup";
import { LiveProviderSettings } from "./LiveProviderSettings";
-export function LiveKeyNeeded() {
+export function LiveKeyNeeded({ override }: { override?: "openai" | "fish" } = {}) {
const { state, dispatch } = useStore();
const titleId = useId();
+ if (override) {
+ const copy = liveKeyCopy(override);
+ return <section aria-labelledby={titleId} className="flex flex-col gap-2.5 rounded-xl border border-hairline bg-panel p-4 text-left text-[13px]">
+ <h2 id={titleId} className="font-medium text-ink">{t(copy.needs)}</h2>
+ <button type="button" className="ui-button ui-button-primary self-start" onClick={() => { dismissLiveNotice(); dispatch(openKeySettings(override === "fish" ? "fishAudio" : "openai")); }}>{t("call.live.openApiKeys")}</button>
+ </section>;
+ }
const live = state.config?.live;
const azure = live?.provider === "azure";
const custom = live?.provider === "custom";
diff --git a/src/components/bot-settings/VoiceSection.dom.test.ts b/src/components/bot-settings/VoiceSection.dom.test.ts
index 7a91f698cc..e7710af47a 100644
--- a/src/components/bot-settings/VoiceSection.dom.test.ts
+++ b/src/components/bot-settings/VoiceSection.dom.test.ts
@@ -11,6 +11,9 @@ import { BotEditorContext } from "./BotEditorContext";
import { VoiceSection } from "./VoiceSection";
import type { useBotSettingsDerived } from "./useBotSettingsDerived";
+let admin = false;
+vi.mock("@/lib/use-owner-or-admin", () => ({ useOwnerOrAdmin: () => admin }));
+
const atlas: Bot = {
id: "atlas", threadId: "thread-atlas", name: "Atlas", title: "", description: "", notifications: true, color: "green",
unread: false, modelSelection: { instanceId: "claude", model: "test" }, messages: [],
@@ -33,6 +36,7 @@ const picker = () => card()?.querySelector("select") ?? null;
beforeEach(() => {
setLocale("en");
patch.mockReset();
+ admin = false;
host = document.createElement("div");
document.body.append(host);
root = createRoot(host);
@@ -73,6 +77,29 @@ describe("a bot's Live call voice in its voice settings", () => {
expect(card()).toBeNull();
});
+ it("lets an admin choose a Fish agent, a GPT-Live voice, or the workspace service", () => {
+ admin = true;
+ render(openAiLive);
+ expect(picker()?.value).toBe("");
+ picker()!.value = "fish";
+ flushSync(() => picker()!.dispatchEvent(new Event("change", { bubbles: true })));
+ expect(patch).toHaveBeenLastCalledWith({ liveOverride: { provider: "fish" } });
+
+ render(openAiLive, { ...atlas, liveOverride: { provider: "fish" } });
+ const agent = card()?.querySelector("input");
+ expect(agent).toBeDefined();
+ agent!.value = "fish-atlas";
+ flushSync(() => agent!.dispatchEvent(new Event("focusout", { bubbles: true })));
+ expect(patch).toHaveBeenLastCalledWith({ liveOverride: { provider: "fish", fishAgentId: "fish-atlas" } });
+
+ render({ ...openAiLive, provider: "fish" }, { ...atlas, liveOverride: { provider: "openai" }, liveVoice: "cedar" });
+ expect(picker()?.value).toBe("openai");
+ expect(card()?.querySelectorAll("select")[1]?.value).toBe("cedar");
+ picker()!.value = "";
+ flushSync(() => picker()!.dispatchEvent(new Event("change", { bubbles: true })));
+ expect(patch).toHaveBeenLastCalledWith({ liveOverride: null });
+ });
+
it("is not on a bot being created, whose defaults keep no call voice", () => {
render(openAiLive, atlas, true);
expect(card()).toBeNull();
diff --git a/src/components/bot-settings/VoiceSection.tsx b/src/components/bot-settings/VoiceSection.tsx
index fb49bfbba5..818a939690 100644
--- a/src/components/bot-settings/VoiceSection.tsx
+++ b/src/components/bot-settings/VoiceSection.tsx
@@ -1,6 +1,8 @@
import { requestNotificationPermission } from "@/lib/notify";
import { t } from "@/lib/i18n";
+import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin";
import { type Bot } from "@/state/store";
+import { Select } from "../Select";
import { BotLiveVoiceSelect } from "../BotLiveVoiceSelect";
import { Switch } from "../SettingsPrimitives";
import { VoiceSettings } from "../VoiceSettings";
@@ -19,21 +21,46 @@ export function VoiceSection({
const { draft } = useBotEditor();
const state = useStoreSelector((s) => ({ config: s.config }), sameFields);
const live = state.config?.live;
- // Fish Audio and ElevenLabs calls speak in their agent's own voice, so only the other providers have a voice to pick.
- // A bot being created has no call voice yet: new-bot defaults don't keep one.
- const liveVoicePicker = !draft && live?.configured && live.provider !== "fish" && live.provider !== "elevenlabs";
+ const canChooseService = useOwnerOrAdmin() === true;
+ const override = bot.liveOverride;
+ const provider = override?.provider ?? live?.provider;
+ const liveVoicePicker = (override || live?.configured) && provider !== "fish" && provider !== "elevenlabs";
+ const fishAgentId = override?.provider === "fish" ? override.fishAgentId ?? "" : "";
return (
<div className="flex flex-col gap-4">
<VoiceSettings bot={bot} onPatch={patch} />
- {liveVoicePicker && (
+ {!draft && (canChooseService || liveVoicePicker) && (
<div data-live-call-voice className="flex flex-col gap-2 rounded-xl bg-card p-4 text-[13px]">
<div>
<div className="text-[15px] font-medium text-ink">{t("voice.liveCall.title")}</div>
<div className="mt-0.5 text-ink-secondary">{t("voice.liveCall.help")}</div>
</div>
- <BotLiveVoiceSelect bot={bot} gemini={live.provider === "gemini"} onChange={(liveVoice) => patch({ liveVoice })} />
+ {canChooseService && <label className="flex items-center justify-between gap-2">
+ <span className="text-ink-secondary">{t("call.live.provider")}</span>
+ <Select size="sm" value={override?.provider ?? ""} onChange={(event) => {
+ const provider = event.target.value;
+ patch({ liveOverride: provider === "fish" || provider === "openai" ? { provider } : null });
+ }}>
+ <option value="">{t("voice.liveCall.workspaceProvider")}</option>
+ <option value="openai">{t("call.live.provider.openai")}</option>
+ <option value="fish">{t("call.live.provider.fish")}</option>
+ </Select>
+ </label>}
+ {canChooseService && override?.provider === "fish" && <label className="flex flex-col gap-1 text-ink-secondary">
+ {t("voice.liveCall.fishAgentId")}
+ <input key={`${bot.id}:${fishAgentId}`} defaultValue={fishAgentId} type="text" maxLength={128} pattern="[A-Za-z0-9_\-]{1,128}"
+ className="rounded-lg border border-hairline bg-inset px-3 py-2 text-ink invalid:border-danger"
+ onKeyDown={(event) => { if (event.key === "Enter" && !event.nativeEvent.isComposing) event.currentTarget.blur(); }}
+ onBlur={(event) => {
+ const id = event.currentTarget.value.trim();
+ if (!event.currentTarget.reportValidity() || id === fishAgentId) return;
+ patch({ liveOverride: id ? { provider: "fish", fishAgentId: id } : { provider: "fish" } });
+ }} />
+ <span className="text-[12px] text-ink-tertiary">{t("voice.liveCall.fishAgentHelp")}</span>
+ </label>}
+ {liveVoicePicker && <BotLiveVoiceSelect bot={bot} gemini={provider === "gemini"} onChange={(liveVoice) => patch({ liveVoice })} />}
<div className="text-[12px] text-ink-tertiary">{t("call.live.voiceNext")}</div>
</div>
)}
diff --git a/src/components/bot-settings/useBotSettingsDerived.ts b/src/components/bot-settings/useBotSettingsDerived.ts
index 4c2ef3455d..466618a382 100644
--- a/src/components/bot-settings/useBotSettingsDerived.ts
+++ b/src/components/bot-settings/useBotSettingsDerived.ts
@@ -55,6 +55,7 @@ export type BotPatch = Partial<
connectorTools?: Bot["connectorTools"] | null;
connectorScopes?: Bot["connectorScopes"] | null;
phoneApps?: Bot["phoneApps"] | null;
+ liveOverride?: Bot["liveOverride"] | null;
acknowledgeLocalAuto?: boolean;
acknowledgePeerScope?: boolean;
};
diff --git a/src/locales/en.json b/src/locales/en.json
index cf38252006..d2bcd855ae 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -1012,6 +1012,9 @@
"voice.usesOwn": "This bot speaks in its own voice.",
"voice.liveCall.title": "Live call voice",
"voice.liveCall.help": "Live calls use their own voices, apart from the read-aloud voice above.",
+ "voice.liveCall.workspaceProvider": "Use workspace service",
+ "voice.liveCall.fishAgentId": "Fish Audio agent ID",
+ "voice.liveCall.fishAgentHelp": "Leave blank to use the workspace agent. A custom Fish Live 3 agent must allow system prompt overrides and have the delegate client tool.",
"voice.notifications.title": "Notifications",
"voice.notifications.help": "Get notified when this agent finishes or needs input",
"voice.notifications.label": "Agent notifications",
diff --git a/src/state/bot-patch-queue.test.ts b/src/state/bot-patch-queue.test.ts
index 9dd4d7559d..31eddb139f 100644
--- a/src/state/bot-patch-queue.test.ts
+++ b/src/state/bot-patch-queue.test.ts
@@ -164,6 +164,7 @@ describe("bot patch queue", () => {
connectorTools: patch.connectorTools ?? undefined,
connectorScopes: patch.connectorScopes ?? undefined,
phoneApps: patch.phoneApps ?? undefined,
+ liveOverride: patch.liveOverride ?? undefined,
defaultBot: patch.defaultBot ?? undefined,
});
},
diff --git a/src/state/bot-patch-queue.ts b/src/state/bot-patch-queue.ts
index 4c2b366d20..0a02734f2a 100644
--- a/src/state/bot-patch-queue.ts
+++ b/src/state/bot-patch-queue.ts
@@ -56,6 +56,7 @@ export type BotUpdatePatch = Partial<
connectorTools?: Bot["connectorTools"] | null;
connectorScopes?: Bot["connectorScopes"] | null;
phoneApps?: Bot["phoneApps"] | null;
+ liveOverride?: Bot["liveOverride"] | null;
/** null demotes a default bot to a regular one; the server clears the mark. Body only: bot state drops the field. */
defaultBot?: Bot["defaultBot"] | null;
/** The server's proof the local-auto warning was shown: wire-only, never folded into bot state. */
@@ -70,13 +71,14 @@ export type BotUpdatePatch = Partial<
export type BotStatePatch = Omit<
BotUpdatePatch,
- "computer" | "connectorTools" | "connectorScopes" | "phoneApps" | "defaultBot" | "acknowledgeLocalAuto" | "applyToAllThreads" | "keepThreadModels" | "threadId" | "mainThreadChoice"
+ "computer" | "connectorTools" | "connectorScopes" | "phoneApps" | "liveOverride" | "defaultBot" | "acknowledgeLocalAuto" | "applyToAllThreads" | "keepThreadModels" | "threadId" | "mainThreadChoice"
> & {
mainThreadId?: string;
computer?: Bot["computer"];
connectorTools?: Bot["connectorTools"];
connectorScopes?: Bot["connectorScopes"];
phoneApps?: Bot["phoneApps"];
+ liveOverride?: Bot["liveOverride"];
defaultBot?: Bot["defaultBot"];
};
@@ -136,6 +138,7 @@ const stateOverlay = (patch: BotUpdatePatch): BotStatePatch => {
connectorTools,
connectorScopes,
phoneApps,
+ liveOverride,
defaultBot,
...fields
} = patch;
@@ -150,6 +153,7 @@ const stateOverlay = (patch: BotUpdatePatch): BotStatePatch => {
else if (connectorScopes !== undefined) normalized.connectorScopes = connectorScopes;
if (phoneApps === null) normalized.phoneApps = undefined;
else if (phoneApps !== undefined) normalized.phoneApps = phoneApps;
+ if (liveOverride !== undefined) normalized.liveOverride = liveOverride ?? undefined;
// A pending choice shows as the bot's main thread, so a broadcast during the save does not revert it.
if (typeof mainThreadChoice === "string") normalized.mainThreadId = mainThreadChoice;
return normalized;
diff --git a/src/state/store.tsx b/src/state/store.tsx
index 7d97bc8cdb..ea04ec978d 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -274,7 +274,7 @@ export interface TaskUsage {
context?: { tokens: number; window?: number };
}
-export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" | "mascotBodyColor" | "mascotMaterial" | "access" | "yourAccess" | "onlyPeopleAdded"> {
+export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" | "mascotBodyColor" | "mascotMaterial" | "access" | "yourAccess" | "onlyPeopleAdded" | "liveOverride"> {
toolScope?: ToolScope;
waitingForTeammates?: boolean;
id: string;
@@ -1157,7 +1157,7 @@ function reduceApp(state: AppState, action: Action): AppState {
computer: action.bot.computer,
toolScope: action.bot.toolScope,
section: action.bot.section, managedSections: action.bot.managedSections,
- vpsAlias: action.bot.vpsAlias, phoneApps: action.bot.phoneApps, onlyPeopleAdded: action.bot.onlyPeopleAdded, liveVoice: action.bot.liveVoice,
+ vpsAlias: action.bot.vpsAlias, phoneApps: action.bot.phoneApps, onlyPeopleAdded: action.bot.onlyPeopleAdded, liveVoice: action.bot.liveVoice, liveOverride: action.bot.liveOverride,
tasks: action.bot.tasks ? mergeTaskStamps(b.tasks, action.bot.tasks) : b.tasks,
// Old approvals must never be sent to the replacement thread while its transcript loads.
messages: switchedThread ? [] : b.messages,
@@ -1537,12 +1537,12 @@ function reduceApp(state: AppState, action: Action): AppState {
keepThreadModels: _keepThreadModels, threadId: _threadId, mainThreadChoice,
computer,
connectorTools,
- connectorScopes, phoneApps,
+ connectorScopes, phoneApps, liveOverride,
defaultBot,
...rest
} = action.patch;
const next = action.patch.chiefOfStaff ? { ...animated, bots: withOneChief(animated.bots, { ...target, ...rest, id: action.botId }) } : animated;
- const botPatch: Partial<Bot> = { ...rest, ...(phoneApps !== undefined && { phoneApps: phoneApps ?? undefined }), ...(typeof mainThreadChoice === "string" && { mainThreadId: mainThreadChoice }) };
+ const botPatch: Partial<Bot> = { ...rest, ...(phoneApps !== undefined && { phoneApps: phoneApps ?? undefined }), ...(liveOverride !== undefined && { liveOverride: liveOverride ?? undefined }), ...(typeof mainThreadChoice === "string" && { mainThreadId: mainThreadChoice }) };
if (computer === null) botPatch.computer = undefined;
else if (computer !== undefined) botPatch.computer = computer;
if (defaultBot === null) botPatch.defaultBot = undefined;
@@ -1703,7 +1703,7 @@ function reduceApp(state: AppState, action: Action): AppState {
...action.bot,
computer: action.bot.computer,
toolScope: action.bot.toolScope, managedSections: action.bot.managedSections,
- vpsAlias: action.bot.vpsAlias, liveVoice: action.bot.liveVoice,
+ vpsAlias: action.bot.vpsAlias, liveVoice: action.bot.liveVoice, liveOverride: action.bot.liveOverride,
messages: action.bot.messages ?? [],
hasMore: action.bot.hasMore,
awaitingThreadSnapshot: false,