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 15 --json
JSON
/christopher/abso-core/versions/15?format=json

--attach says plainly when the Issues server doesn't take attachments yet

of shared·pinch··Not checked

A server from before attachments has no upload route. It answered 400 'the body is JSON', or 404, and the client printed that as it came, which told nobody what had happened. Now the client says the server doesn't take attachments yet, that the file wasn't sent and nothing was written, and to leave --attach off or link the image instead.

A server that has the route but nowhere to keep files (501) gets the same message. A test checks the message and that no issue is opened.

Version 14 · Files at version 15

2 files, 27 lines added, 0 removed.

--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -424,6 +424,13 @@
424424 );
425425 }
426426 const text = await res.text();
427+ // A server from before attachments has no upload route: it answers 404, or 400 because the body isn't JSON;
428+ // one with the route but nowhere to keep files answers 501. Say so plainly, and that nothing was sent.
429+ if (res.status === 404 || res.status === 501 || (res.status === 400 && /the body is JSON/.test(text)))
430+ throw new ApiError(
431+ `${this.issuesServer} doesn't take attachments yet, so ${name} wasn't sent and nothing was written. Leave --attach off, or link the image instead.`,
432+ res.status,
433+ );
427434 if (!res.ok) throw new ApiError(`uploading ${name} answered ${res.status}: ${errorSentence(text)}`, res.status);
428435 return JSON.parse(text) as Attachment;
429436 }
--- a/client/test/attach.test.ts
+++ b/client/test/attach.test.ts
@@ -31,6 +31,9 @@
3131 const body = Buffer.concat(parts);
3232 seen.push({ method: req.method!, url: req.url!, headers: req.headers, body });
3333 const json = (o: unknown) => res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify(o));
34+ // A server from before attachments: it reads every POST body as JSON.
35+ if (req.url!.includes("/p/old") && req.url!.endsWith("/attachments"))
36+ return res.writeHead(400, { "content-type": "application/json" }).end('{"error":"the body is JSON"}');
3437 if (req.url!.endsWith("/attachments"))
3538 return json({
3639 id: `a${String(seen.length).padStart(12, "0")}`,
@@ -113,6 +116,23 @@
113116 assert.match(alone.out, /--attach goes with avcs issue new or --comment/);
114117 });
115118
119+ it("says plainly when the server doesn't take attachments yet, and writes nothing", async () => {
120+ const dir = mkdtempSync(join(tmpdir(), "abso-attach-"));
121+ dirs.push(dir);
122+ const init = await avcs(dir, ["init", "--server", fake.url, "--project", "old", "--agent", "ann"]);
123+ assert.equal(init.exit, 0, init.out);
124+ writeFileSync(join(dir, "shot.png"), Buffer.from([0x89, 0x50, 0x4e, 0x47, 1]));
125+ const from = seen.length;
126+ const r = await avcs(dir, ["issue", "new", "T", "--attach", "shot.png"]);
127+ assert.equal(r.exit, 1);
128+ assert.match(r.out, /doesn't take attachments yet, so shot.png wasn't sent and nothing was written/);
129+ assert.deepEqual(
130+ seen.slice(from).map((c) => c.url.replace(/^\/p\/[^/]+/, "")),
131+ ["/a/ann/attachments"],
132+ "no issue was opened",
133+ );
134+ });
116136 it("sends nothing when a file is missing", async () => {
117137 const dir = await folder();
118138 const from = seen.length;