Skip to content

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

Skip the computer check when the user asked for the Browser tab, and fall back to it if the check fails

Bugfixer 23ef9765178c0
diff --git a/server/surface.test.ts b/server/surface.test.ts
index 2a4004aa03..e192e102c6 100644
--- a/server/surface.test.ts
+++ b/server/surface.test.ts
@@ -209,7 +209,7 @@ describe("surfacePrompt", () => {
const text = surfacePrompt({ computer, browser: true });
const label = computer === "vm" ? "the Local VM" : "the cloud computer";
expect(text).toContain(`The built-in browser and ${label} may not share sign-ins.`);
- expect(text).toContain(`Before asking the user to sign in again in the Browser tab, check whether the site is already signed in on ${label} with the account the task needs; if it is, do the task there and keep it there, unless the user asked for the Browser tab.`);
+ expect(text).toContain(`Unless the user asked for the Browser tab, check whether the site is already signed in on ${label} with the account the task needs before asking them to sign in again in the Browser tab; if it is, do the task there and keep it there. If you cannot check ${label}, ask for the sign-in in the Browser tab.`);
}
expect(surfacePrompt({ computer: "vm", browser: false })).not.toContain("share sign-ins");
expect(surfacePrompt({ computer: null, browser: true })).not.toContain("share sign-ins");
diff --git a/server/surface.ts b/server/surface.ts
index 216f7a7819..2e27a4b98d 100644
--- a/server/surface.ts
+++ b/server/surface.ts
@@ -228,7 +228,7 @@ export function surfacePrompt(
// The two browsers usually 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}. The built-in browser and ${computer} may not share sign-ins. Before asking the user to sign in again in the Browser tab, check whether the site is already signed in on ${computer} with the account the task needs; if it is, do the task there and keep it there, unless the user asked for the Browser tab.`;
+ ` 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 built-in browser and ${computer} may not share sign-ins. Unless the user asked for the Browser tab, check whether the site is already signed in on ${computer} with the account the task needs before asking them to sign in again in the Browser tab; if it is, do the task there and keep it there. If you cannot check ${computer}, ask for the sign-in in the Browser tab.`;
} 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}.`;