Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 104 to 318

Compare

+20 −0 in 1 place
new file, 20 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { Api } from "../src/api.ts";
4+
5+test("a logical JSON write retains its UUID across connection retry and later writes get new IDs", async (t) => {
6+ const api = new Api({ server: "https://example.invalid", project: "test", agent: "alice" } as never);
7+ const ids: (string | null)[] = [];
8+ t.mock.method(api, "send", async (_url: string, init: RequestInit) => {
9+ ids.push(new Headers(init.headers).get("Idempotency-Key"));
10+ if (ids.length === 1) throw Object.assign(Error("not connected"), { cause: { code: "ECONNREFUSED" } });
11+ return Response.json({ ok: true });
12+ });
13+ await api.json("POST", "/a/alice/record", { files: {} });
14+ await api.json("POST", "/a/alice/record", { files: {} });
15+ await api.json("GET", "/status");
16+ assert.match(ids[0]!, /^[0-9a-f-]{36}$/);
17+ assert.equal(ids[1], ids[0]);
18+ assert.notEqual(ids[2], ids[0]);
19+ assert.equal(ids[3], null);
20+});
MCP
compare on this site's /mcp
CLI
abso diff 104 318 client/test/api-request-id.test.ts --json
JSON
/christopher/abso-core/compare/104..318?file=client%2Ftest%2Fapi-request-id.test.ts&format=json