Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

test: update sign-out expectations

ogsamrat68bb329c29da
diff --git a/apps/server/src/capture-context.test.ts b/apps/server/src/capture-context.test.ts
index f3b317ec..3597aec7 100644
--- a/apps/server/src/capture-context.test.ts
+++ b/apps/server/src/capture-context.test.ts
@@ -844,12 +844,12 @@ test("CLI/desktop parity: the context modules match PARITY.sha256 (the same list
for (const name of files) assert.equal(createHash("sha256").update(fs.readFileSync(path.join(contextDir, name))).digest("hex"), listed.get(name), `${name} changed: port it to the CLI and update PARITY.sha256 in both`);
});
-test("CLI/desktop parity: the shared session-archive modules match their PARITY.sha256 (auto compact, code files, late writes, tool start, turn writers, turn prompts)", async () => {
+test("CLI/desktop parity: the shared session-archive modules match their PARITY.sha256 (account park, auto compact, code files, late writes, tool start, turn writers, turn prompts)", async () => {
const { createHash } = await import("node:crypto");
const dir = path.join(import.meta.dir, "session-archive");
const lines = fs.readFileSync(path.join(dir, "PARITY.sha256"), "utf8").split("\n").filter((line) => line && !line.startsWith("#"));
const listed = new Map(lines.map((line) => { const [hash, name] = line.split(/\s+/); return [name, hash]; }));
- assert.deepEqual([...listed.keys()].sort(), ["auto-compact.ts", "code-files.ts", "late-writes.ts", "tool-start.ts", "turn-overlap.ts", "turn-prompts.ts", "turn-writers.ts"]);
+ assert.deepEqual([...listed.keys()].sort(), ["account-park.ts", "auto-compact.ts", "code-files.ts", "late-writes.ts", "tool-start.ts", "turn-overlap.ts", "turn-prompts.ts", "turn-writers.ts"]);
for (const [name, hash] of listed) assert.equal(createHash("sha256").update(fs.readFileSync(path.join(dir, name))).digest("hex"), hash, `${name} changed: port it to the CLI and update PARITY.sha256 in both`);
});
diff --git a/apps/server/src/session-uploader.server.e2e.test.ts b/apps/server/src/session-uploader.server.e2e.test.ts
index 9da41847..443b8eac 100644
--- a/apps/server/src/session-uploader.server.e2e.test.ts
+++ b/apps/server/src/session-uploader.server.e2e.test.ts
@@ -1,7 +1,7 @@
import { afterAll, afterEach, beforeAll, describe, expect, test } from "bun:test";
import { execFile } from "node:child_process";
import { createHash } from "node:crypto";
-import { mkdir, mkdtemp, readdir, rm, writeFile } from "node:fs/promises";
+import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { promisify } from "node:util";
@@ -624,7 +624,7 @@ describe("session uploader server integration", () => {
expect(gateway.uploads.filter((upload) => upload.sessionId === "ses_missing_chat")).toEqual([]);
}, 30_000);
- test("a user's sign-out (clearUploadQueue) deletes the queued uploads; a start without an account keeps them", async () => {
+ test("a user's sign-out (clearUploadQueue) and a start without an account both keep the queued uploads", async () => {
const { root, stateDir } = await createWorkspace();
const engine = startMockEngine({ provider: "anthropic", model: "claude-sonnet-4-5" });
const spool = join(stateDir, "omnirush-upload-spool");
@@ -637,10 +637,11 @@ describe("session uploader server integration", () => {
await new Promise((resolve) => setTimeout(resolve, 300));
await retired.stop();
expect((await readdir(spool)).sort()).toEqual([`${id}.json`, `${id}.zst`]);
- // The user signed out: the start after it deletes it.
+ // The user signed out: the start after it keeps it for that account.
const signedOut = await startOmniRush({ ...serverConfig({ root, stateDir, engineBaseUrl: engine.baseUrl }), clearUploadQueue: true });
await signedOut.stop();
- expect(await readdir(spool).catch(() => [])).toEqual([]);
+ expect((await readdir(spool)).sort()).toEqual([`${id}.json`, `${id}.zst`]);
+ expect(JSON.parse(await readFile(join(spool, `${id}.json`), "utf8")).account_id).toBe("user-1");
}, 30_000);
test("refuses prompt dispatch on a local workspace without an account, unless both development flags are set", async () => {