Keep computers' browser sessions across restarts and recreates

Each computer's Chrome profile now lives on the data volume
(DATA_DIR/computer-browsers/<id>, mounted at ~/.cobble-browser) and
Chrome is pointed at it with --user-data-dir. The sandbox image resets
its own profile's preferences to session-only cookies on every boot,
which signed every site out whenever Chrome exited. New profiles are
seeded with the image's preferences minus that rule, stale Singleton
links are removed before each provision, and existing computers are
recreated once (skipped while a job runs on them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-25 15:26:18 +01:00
co-authored by Claude Opus 5.5
parent 380d3ebb2f
commit b9c5311fde
12 changed files with 276 additions and 26 deletions
@@ -7,6 +7,7 @@ import computerNotReadyMessage from "@/src/utils/computer-not-ready-message";
import { decrypt } from "@/src/utils/crypt";
import notifyWatchEnsureCommand from "@/src/utils/notify-watch-ensure-command";
import grabComputerMcpUrl from "../computers/grab-computer-mcp-url";
import isComputerBusy from "../computers/is-computer-busy";
import callComputerApi from "./call-computer-api";
type Params = {
@@ -95,14 +96,7 @@ export default async function syncComputerNotifyWatch({ computer_id }: Params):
body: { file: `${dir}/notify-hooks`, content: `${urls.join("\n")}\n` },
});
const busy = Boolean(
(
await BunSQLite.sql<{ id: number }>({
sql: `SELECT id FROM bots_queue WHERE computer_id = ? AND status = 'processing' LIMIT 1`,
values: [computer_id],
})
).payload?.[0],
);
const busy = await isComputerBusy({ computer_id });
const res = await callComputerApi({
base_url,