Skip to content

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

Tell bots the built-in browser and the computer's browser keep separate sign-ins

Bugfixer 235e159d09382
diff --git a/server/surface.test.ts b/server/surface.test.ts
index 92463ae2d4..0224fccedd 100644
--- a/server/surface.test.ts
+++ b/server/surface.test.ts
@@ -204,6 +204,19 @@ describe("surfacePrompt", () => {
expect(text).toMatch(/say which surface — the Browser tab or the cloud computer/);
});
+ it("tells the bot the two browsers keep separate sign-ins, so a site signed in on the computer is used there", () => {
+ for (const computer of ["vm", "cloud"] as const) {
+ const text = surfacePrompt({ computer, browser: true });
+ const label = computer === "vm" ? "the Local VM" : "the cloud computer";
+ expect(text).toContain("The two browsers keep separate sign-ins: a site signed in on one is not signed in on the other.");
+ expect(text).toContain(`When a web task needs a site that is already signed in on ${label}, do it there instead of asking the user to sign in again in the Browser tab, and keep that task there.`);
+ }
+ // One surface only, or the person's own computer: nothing to tell apart, wording unchanged.
+ expect(surfacePrompt({ computer: "vm", browser: false })).not.toContain("separate sign-ins");
+ expect(surfacePrompt({ computer: null, browser: true })).not.toContain("separate sign-ins");
+ expect(surfacePrompt({ computer: "local", browser: true })).not.toContain("separate sign-ins");
+ });
+
it("names only the computer when it is the only surface", () => {
const text = surfacePrompt({ computer: "vm", browser: false });
expect(text).toMatch(/happens on the Local VM, web pages included/);
diff --git a/server/surface.ts b/server/surface.ts
index ef3ac25c0d..f8144d8edb 100644
--- a/server/surface.ts
+++ b/server/surface.ts
@@ -225,8 +225,10 @@ export function surfacePrompt(
? ` Two surfaces are mounted this turn: the built-in browser (the browser server's browser_navigate, browser_snapshot, browser_click, browser_fill and friends) and this computer (the computer server's tools). Web tasks → the built-in browser. Desktop apps, files and shell → this computer tools. Pick one surface for a task and stay on it; if you need the user to sign in, say which surface — the Browser tab or this computer.${YOUR_COMPUTER_BESIDE_BROWSER}`
: YOUR_COMPUTER_ALONE;
} else if (computer && mounted.browser) {
+ // The two browsers share no cookies: "Web tasks → the built-in browser" alone sent a bot whose site was signed in on
+ // the computer to a signed-out tab, where it asked the person to sign in again.
text =
- ` Two surfaces are mounted this turn: the built-in browser (the browser server's browser_navigate, browser_snapshot, browser_click, browser_fill and friends) and ${computer} (the computer server's tools). Web tasks → the built-in browser. Desktop apps, files and shell → ${computer} tools. Pick one surface for a task and stay on it; if you need the user to sign in, say which surface — the Browser tab or ${computer}.`;
+ ` Two surfaces are mounted this turn: the built-in browser (the browser server's browser_navigate, browser_snapshot, browser_click, browser_fill and friends) and ${computer} (the computer server's tools). Web tasks → the built-in browser. Desktop apps, files and shell → ${computer} tools. Pick one surface for a task and stay on it; if you need the user to sign in, say which surface — the Browser tab or ${computer}. The two browsers keep separate sign-ins: a site signed in on one is not signed in on the other. When a web task needs a site that is already signed in on ${computer}, do it there instead of asking the user to sign in again in the Browser tab, and keep that task there.`;
} else if (computer) {
text =
` Everything you do on screen happens on ${computer}, web pages included, through its own browser; there is no separate built-in browser this turn. If you need the user to sign in, tell them it is on ${computer}.`;