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
MCP
show on this site's /mcp
CLI
abso show 89 --json
JSON
/christopher/abso-core/versions/89?format=json

abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.

of shared·pinch··Not checked

Version 88 · Files at version 89

2 files, 29 lines added, 3 removed.

--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -439,6 +439,17 @@
439439 return this.json(method, path, body, this.issuesServer);
440440 }
441441
442+ /** An ask-thread call, with a server from before ask threads named as that rather than a bare 404. */
443+ async #threads<T>(call: Promise<T>): Promise<T> {
444+ try {
445+ return await call;
446+ } catch (err) {
447+ if (err instanceof ApiError && err.status === 404 && /no such issues route/.test(err.message))
448+ throw new ApiError(`${this.config.server} doesn't have ask threads yet`, 404);
449+ throw err;
450+ }
451+ }
442453 /** Issues, most recently updated first. */
443454 issues(
444455 q: { status?: string; agent?: string; parent?: number; open?: boolean; labels?: readonly string[] } = {},
@@ -468,12 +479,12 @@
468479
469480 /** The asks this agent sent: the open ones, then the latest answered, each with its thread. */
470481 asked(): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {
471− return this.#issues("GET", this.agentPath("asked"));
482+ return this.#threads(this.#issues("GET", this.agentPath("asked")));
472483 }
473484
474485 /** One ask, open or closed, with its thread and who it waits on. */
475486 askThread(id: number): Promise<{ ask: Ask & { title: string | null } }> {
476− return this.#issues("GET", `/ask/${id}`);
487+ return this.#threads(this.#issues("GET", `/ask/${id}`));
477488 }
478489
479490 /** Open asks of someone (an agent, or person:<id>), soonest due first; every open ask without `of`. */
@@ -658,7 +669,7 @@
658669
659670 /** Adds to an ask's thread, as its asker or the one asked; the other side hears it, and the ask stays as it is. */
660671 reply(id: number, body: { text: string; question?: boolean }): Promise<{ ask: Ask; news?: IssueNews }> {
661− return this.#issues("POST", this.agentPath(`reply/${id}`), body);
672+ return this.#threads(this.#issues("POST", this.agentPath(`reply/${id}`), body));
662673 }
663674
664675 /** Takes back an ask this agent made, with a note on why; the one asked hears it. */
--- a/client/test/issues.test.ts
+++ b/client/test/issues.test.ts
@@ -97,6 +97,8 @@
9797 return send(200, {
9898 ask: { id: Number(ack[2]), by: "desk", of: ack[1], answer: null, ack: { at: Date.now(), note: "" } },
9999 });
100+ // Ask 404 stands for a server from before ask threads: neither route is there.
101+ if (/\/(ask|reply)\/404$/.test(req.url ?? "")) return send(404, { error: "no such issues route" });
100102 // A reply answers with the ask; from the one asked, a question makes it wait on the asker.
101103 const reply = /\/a\/([^/]+)\/reply\/(\d+)$/.exec(req.url ?? "");
102104 if (req.method === "POST" && reply) {
@@ -290,6 +292,19 @@
290292 assert.equal((await main(["reply", "7"], { cwd: fay, env: ENV(), write: () => {} })).exit, 1);
291293 });
292294
295+ it("names a server from before ask threads instead of a bare 404", async () => {
296+ const fay = await folder("fay");
297+ for (const argv of [
298+ ["reply", "404", "still there?"],
299+ ["ask", "404"],
300+ ]) {
301+ const r = await main(argv, { cwd: fay, env: ENV(), write: () => {} });
302+ assert.equal(r.exit, 1, argv.join(" "));
303+ assert.match(r.stderr, /doesn't have ask threads yet/, argv.join(" "));
304+ assert.doesNotMatch(r.stderr, /no such issues route/, argv.join(" "));
305+ }
306+ });
293308 it("ask <N> reads one ask with its whole thread, oldest first, and whose turn it is", async () => {
294309 const fay = await folder("fay");
295310 const before = seen.length;