Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Home screen: publish the parked server's opening view at once; its offline screen never takes a team's name
AdityaUmale1ab21fe32424
diff --git a/electron/home-window.mjs b/electron/home-window.mjsindex b42a7bb0de..26ff068054 100644--- a/electron/home-window.mjs+++ b/electron/home-window.mjs@@ -590,6 +590,7 @@ export function createHomeWindow(deps) {if (!current.clean && parkedAt && !ownMove() && onOwnPage()) {clearRetry(); screen = null; status = null; shown = null; away = false;ensureWindow();+ tell();let slow = null;const mine = {}; recovering = mine;try {@@ -797,7 +798,7 @@ export function createHomeWindow(deps) {if (!place && parkedAt?.origin && at === parkedAt.origin) {++opens;if (ownMove()) tell();- else toScreen({ screen: "offline", name: parkedAt.place, reason: `Your bots are on ${parkedAt.place}.` });+ else { opening = null; toScreen({ screen: "offline", name: parkedAt.place, reason: `Your bots are on ${parkedAt.place}.` }); }later();return true;}diff --git a/electron/home-window.node-test.mjs b/electron/home-window.node-test.mjsindex 4c8e44e6fa..3a4cbde682 100644--- a/electron/home-window.node-test.mjs+++ b/electron/home-window.node-test.mjs@@ -96,12 +96,18 @@ test("a frozen copy left on this computer's own page goes back to the server itawait loading.home.show();assert.equal(loading.home.failed(`${garage}/chats`, -105), true, "the way back's load failure is answered here");assert.deepEqual(loading.home.view(), { screen: "offline", name: "Garage server", reason: "Your bots are on Garage server." });+ // A team asked for meanwhile (signed out, so it never opened) doesn't lend its name to the server's offline screen.+ const asked = world({ journal: null, marker, state: { status: "signed-out" }, url: `${LOCAL}${HOME_SCREEN_PATH}` });+ await asked.home.show({ place: { team: "t-1", name: "Studio", origin: "https://studio.example.test" } });+ assert.equal(asked.home.failed(`${garage}/chats`, -105), true);+ assert.deepEqual(asked.home.view(), { screen: "offline", name: "Garage server", reason: "Your bots are on Garage server." });// A recovery whose page never commits is bounded: the screen says where the bots are, with a retry, within OPEN_MS.const stuck = world({ journal: null, marker, state: { status: "signed-out" }, url: `${LOCAL}${HOME_SCREEN_PATH}` });stuck.reopenGate = new Promise(() => {});let back = false;const waiting = stuck.home.show().then(() => { back = true; });for (let i = 0; i < 200 && stuck.timers.length === 0; i++) await tick();+ assert.deepEqual(stuck.published.at(-1), { screen: "opening", name: "Garage server" }, "the screen is told the server's name while it waits");await stuck.later(OPEN_MS);await tick();assert.equal(back, true, "the deadline hands show() back");