{"version":89,"agent":"pinch","message":"abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.","time":1791619328862,"timeIso":"2026-10-10T08:02:08.862Z","changes":2,"change":1038,"files":["client/src/api.ts","client/test/issues.test.ts"],"draft":null,"diff":[{"path":"client/src/api.ts","added":14,"removed":3,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -439,6 +439,17 @@\n \t\treturn this.json(method, path, body, this.issuesServer);\n \t}\n \n+\t/** An ask-thread call, with a server from before ask threads named as that rather than a bare 404. */\n+\tasync #threads<T>(call: Promise<T>): Promise<T> {\n+\t\ttry {\n+\t\t\treturn await call;\n+\t\t} catch (err) {\n+\t\t\tif (err instanceof ApiError && err.status === 404 && /no such issues route/.test(err.message))\n+\t\t\t\tthrow new ApiError(`${this.config.server} doesn't have ask threads yet`, 404);\n+\t\t\tthrow err;\n+\t\t}\n+\t}\n+\n \t/** Issues, most recently updated first. */\n \tissues(\n \t\tq: { status?: string; agent?: string; parent?: number; open?: boolean; labels?: readonly string[] } = {},\n@@ -468,12 +479,12 @@\n \n \t/** The asks this agent sent: the open ones, then the latest answered, each with its thread. */\n \tasked(): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {\n-\t\treturn this.#issues(\"GET\", this.agentPath(\"asked\"));\n+\t\treturn this.#threads(this.#issues(\"GET\", this.agentPath(\"asked\")));\n \t}\n \n \t/** One ask, open or closed, with its thread and who it waits on. */\n \taskThread(id: number): Promise<{ ask: Ask & { title: string | null } }> {\n-\t\treturn this.#issues(\"GET\", `/ask/${id}`);\n+\t\treturn this.#threads(this.#issues(\"GET\", `/ask/${id}`));\n \t}\n \n \t/** Open asks of someone (an agent, or person:<id>), soonest due first; every open ask without `of`. */\n@@ -658,7 +669,7 @@\n \n \t/** 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. */\n \treply(id: number, body: { text: string; question?: boolean }): Promise<{ ask: Ask; news?: IssueNews }> {\n-\t\treturn this.#issues(\"POST\", this.agentPath(`reply/${id}`), body);\n+\t\treturn this.#threads(this.#issues(\"POST\", this.agentPath(`reply/${id}`), body));\n \t}\n \n \t/** Takes back an ask this agent made, with a note on why; the one asked hears it. */"},{"path":"client/test/issues.test.ts","added":15,"removed":0,"diff":"--- a/client/test/issues.test.ts\n+++ b/client/test/issues.test.ts\n@@ -97,6 +97,8 @@\n \t\t\treturn send(200, {\n \t\t\t\task: { id: Number(ack[2]), by: \"desk\", of: ack[1], answer: null, ack: { at: Date.now(), note: \"\" } },\n \t\t\t});\n+\t\t// Ask 404 stands for a server from before ask threads: neither route is there.\n+\t\tif (/\\/(ask|reply)\\/404$/.test(req.url ?? \"\")) return send(404, { error: \"no such issues route\" });\n \t\t// A reply answers with the ask; from the one asked, a question makes it wait on the asker.\n \t\tconst reply = /\\/a\\/([^/]+)\\/reply\\/(\\d+)$/.exec(req.url ?? \"\");\n \t\tif (req.method === \"POST\" && reply) {\n@@ -290,6 +292,19 @@\n \t\tassert.equal((await main([\"reply\", \"7\"], { cwd: fay, env: ENV(), write: () => {} })).exit, 1);\n \t});\n \n+\tit(\"names a server from before ask threads instead of a bare 404\", async () => {\n+\t\tconst fay = await folder(\"fay\");\n+\t\tfor (const argv of [\n+\t\t\t[\"reply\", \"404\", \"still there?\"],\n+\t\t\t[\"ask\", \"404\"],\n+\t\t]) {\n+\t\t\tconst r = await main(argv, { cwd: fay, env: ENV(), write: () => {} });\n+\t\t\tassert.equal(r.exit, 1, argv.join(\" \"));\n+\t\t\tassert.match(r.stderr, /doesn't have ask threads yet/, argv.join(\" \"));\n+\t\t\tassert.doesNotMatch(r.stderr, /no such issues route/, argv.join(\" \"));\n+\t\t}\n+\t});\n+\n \tit(\"ask <N> reads one ask with its whole thread, oldest first, and whose turn it is\", async () => {\n \t\tconst fay = await folder(\"fay\");\n \t\tconst before = seen.length;"}],"ci":null}