Skip to content

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

#5850: name the product with productName() in fill_login's answers

milind-sonib2e8ad1bc61d
diff --git a/server/host/fill-login-turn.test.ts b/server/host/fill-login-turn.test.ts
index bc26630b6f..181f8daced 100644
--- a/server/host/fill-login-turn.test.ts
+++ b/server/host/fill-login-turn.test.ts
@@ -58,7 +58,7 @@ describe("fill_login outside the bot's own browser", () => {
] as const)("says plainly why a saved login is not filled on a screen when the run %s", async (_case, over) => {
const { fill } = harness(over);
const answer = await fill(bot, turn, undefined, undefined);
- expect(answer.text).toMatch(/^Saved logins are filled only in your own browser, the one your browser tools drive, where OpenMausBot checks the page's site before it types a password\. On the screen of this computer it cannot prove which site a box belongs to, so it never types one there[,.]/);
+ expect(answer.text).toMatch(/^Saved logins are filled only in your own browser, the one your browser tools drive, where MausBot checks the page's site before it types a password\. On the screen of this computer it cannot prove which site a box belongs to, so it never types one there[,.]/);
});
it("names the person's own Chrome when the bot's profile is My Chrome", async () => {
diff --git a/server/host/fill-login-turn.ts b/server/host/fill-login-turn.ts
index 5da6716ed4..aaad0d6bab 100644
--- a/server/host/fill-login-turn.ts
+++ b/server/host/fill-login-turn.ts
@@ -1,6 +1,7 @@
// fill_login for one turn: filled by the server as one browser action, answered with a status in words, never a value.
import type { Surface } from "../../shared/wire.ts";
import type { BotLogins } from "../bot-logins.ts";
+import { productName } from "../brand.ts";
import { BROWSER_CONTROL_REFUSAL } from "../browser-runtime.ts";
import type { StepContext } from "../browser-steps.ts";
import { CODE_FROM_INBOX, fillLogin, type FillLoginDeps, type FillLoginOutcome } from "../login-fill.ts";
@@ -39,7 +40,7 @@ export interface FillLoginTurnDeps {
turnActive?(turn: Turn): boolean;
}
-const ONLY_IN_BROWSER = "Saved logins are filled only in your own browser, the one your browser tools drive, where OpenMausBot checks the page's site before it types a password";
+const onlyInBrowser = () => `Saved logins are filled only in your own browser, the one your browser tools drive, where ${productName()} checks the page's site before it types a password`;
export function createFillLoginTurn(deps: FillLoginTurnDeps) {
// Security: on a screen the server cannot prove which site a focused box belongs to, so a secret is never typed there.
@@ -52,22 +53,22 @@ export function createFillLoginTurn(deps: FillLoginTurnDeps) {
const why = current.browser === false || current.computer === "off" || !deps.builtInBrowserOn()
? "the built-in browser is off for you here"
: "your browser is not available here: it is not installed yet, or this AI model cannot use browser tools";
- return { ok: false, text: where ? `${ONLY_IN_BROWSER}${notHere}, and ${why}. ${signIn}` : `fill_login works in the built-in browser, and this conversation has none. ${signIn}` };
+ return { ok: false, text: where ? `${onlyInBrowser()}${notHere}, and ${why}. ${signIn}` : `fill_login works in the built-in browser, and this conversation has none. ${signIn}` };
}
if (!signsInByEmail && !deps.logins.sitesFor(bot.id).length) {
const trouble = deps.onePasswordTrouble();
return { ok: false, text: `You have no saved logins to fill${trouble ? ` (1Password could not be read just now: ${trouble})` : ""}. ${signIn}` };
}
if (!deps.moveToBrowser(turn)) {
- return { ok: false, text: `${ONLY_IN_BROWSER}${notHere}, and this run cannot move to your browser. ${signIn} For runs like this to sign in by themselves, the person can choose Browser under where this bot works.` };
+ return { ok: false, text: `${onlyInBrowser()}${notHere}, and this run cannot move to your browser. ${signIn} For runs like this to sign in by themselves, the person can choose Browser under where this bot works.` };
}
const chrome = deps.myChrome(current) ? ", which is the person's own Chrome (My Chrome), signed in as them" : "";
- return { ok: false, text: `${ONLY_IN_BROWSER}${notHere}. OpenMausBot is moving this conversation to your own browser${chrome}. End this turn now without using the screen tools: the request continues there with your browser tools. Open the site's sign-in page in that browser, then call fill_login.` };
+ return { ok: false, text: `${onlyInBrowser()}${notHere}. ${productName()} is moving this conversation to your own browser${chrome}. End this turn now without using the screen tools: the request continues there with your browser tools. Open the site's sign-in page in that browser, then call fill_login.` };
}
async function connectMailbox(bot: BotRecord, turn: Turn, outcome: FillLoginOutcome): Promise<Answer> {
const offer = await deps.mailCodes!.offerConnect(bot, turn).catch(() => ({ shown: false } as { shown: boolean; line?: string }));
- if (offer.shown) return { ok: outcome.ok, text: `${outcome.text} OpenMausBot showed the person a secure Connect card for Gmail. End this turn now: you continue automatically once it is connected, then call fill_login again.` };
+ if (offer.shown) return { ok: outcome.ok, text: `${outcome.text} ${productName()} showed the person a secure Connect card for Gmail. End this turn now: you continue automatically once it is connected, then call fill_login again.` };
return { ok: outcome.ok, text: `${outcome.text} ${offer.line ?? CODE_FROM_INBOX}` };
}