Skip to content

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

Live: let a paired phone report a Gemini call it runs itself (#7493)

Bugfixer 237fe9ae37858
diff --git a/companion/src/routes.ts b/companion/src/routes.ts
index 46a6ce67ec..0525ede66d 100644
--- a/companion/src/routes.ts
+++ b/companion/src/routes.ts
@@ -216,6 +216,8 @@ const ALLOWED: ReadonlyArray<{ method: string; path: RegExp }> = [
{ method: "POST", path: /^\/api\/live\/call\/end$/ },
{ method: "GET", path: /^\/api\/live\/call$/ },
{ method: "PATCH", path: /^\/api\/live\/settings$/ },
+ // A Gemini call the phone runs itself reports to the harness here; the harness checks the call's own session token.
+ { method: "POST", path: /^\/api\/live\/relay$/ },
// The phone's own apps as bot tools: it registers, long-polls for jobs, leases and answers them.
{ method: "PUT", path: /^\/api\/phones\/self$/ },
diff --git a/companion/test/routes.test.ts b/companion/test/routes.test.ts
index 281f7c423e..1bc65f3ac9 100644
--- a/companion/test/routes.test.ts
+++ b/companion/test/routes.test.ts
@@ -119,6 +119,7 @@ describe("what the app may do", () => {
["POST", "/api/live/call/end"],
["GET", "/api/live/call"],
["PATCH", "/api/live/settings"],
+ ["POST", "/api/live/relay"],
["GET", "/api/routines"],
["POST", "/api/routines"],
["PATCH", "/api/routines/routine_1"],
@@ -398,7 +399,7 @@ describe("what it may not", () => {
expect(ask("PATCH", "/api/config")?.error).toBe("this setting is changed on your computer");
});
- it("allows only the four Live call routes, never the key", () => {
+ it("allows only the five Live call routes, never the key", () => {
expect(ask("POST", "/api/live/summary")?.status).toBe(404);
expect(ask("PATCH", "/api/config")?.status).toBe(403);
expect(allowed("PUT", "/api/live/settings")).toBe(false);
@@ -406,6 +407,8 @@ describe("what it may not", () => {
expect(allowed("GET", "/api/live/session")).toBe(false);
expect(allowed("POST", "/api/live/call")).toBe(false);
expect(allowed("POST", "/api/live/call/end/extra")).toBe(false);
+ expect(allowed("GET", "/api/live/relay")).toBe(false);
+ expect(allowed("POST", "/api/live/relay/x")).toBe(false);
});
it("allows an app's document, rpc and context and nothing else of apps", () => {