{"draft":null,"from":49,"to":318,"files":[{"path":"client/src/api.ts","added":213,"removed":28,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -2,7 +2,9 @@\n // except `run`, which sends a tar.gz and reads the answer as a stream of JSON\n // lines (box-run.ts).\n \n+import { randomUUID } from \"node:crypto\";\n import { setDefaultResultOrder } from \"node:dns\";\n+import { CALLER_HEADER } from \"../../src/caller.ts\";\n import type {\n \tChangeAnswer,\n \tDraftSyncAnswer,\n@@ -18,6 +20,8 @@\n \tSyncAnswer,\n } from \"./api-answers.ts\";\n import { ApiError, errorSentence, neverSent } from \"./api-error.ts\";\n+import { UsageError } from \"./args.ts\";\n+import type { AutosettleAnswer, AutosettleMode } from \"./autosettle-commands.ts\";\n import {\n \tboxQuery,\n \tconsumeRun,\n@@ -49,17 +53,23 @@\n \tWhere,\n \tWhereAnswer,\n \tWhyAnswer,\n+\tWithoutAnswer,\n } from \"./history-answers.ts\";\n import type {\n \tAsk,\n \tAttachment,\n \tDraft,\n \tDraftBody,\n+\tGroupEvent,\n+\tGroupShown,\n+\tGroupSummary,\n+\tGroupWrite,\n \tNews as IssueNews,\n \tIssuePage,\n \tIssueRow,\n \tIssueSearchHit,\n } from \"./issues-wire.ts\";\n+import { isLocal, LOCAL_BASE, localFetch, NO_STORE } from \"./local-store.ts\";\n import type { Modes } from \"./modes.ts\";\n \n export * from \"./api-answers.ts\";\n@@ -134,6 +144,23 @@\n \t| { dryRun: true; plan: CopyPlan }\n \t| { ok: true; id: number; from: { project: string; issue: number }; skipped: { comments: number[]; asks: number[] } };\n \n+/**\n+ * The server's line when another chat just used this seat (seatNotice on an answer): kept until main() prints it with\n+ * the news, once however many answers carried it.\n+ */\n+const seatNotices = new Set<string>();\n+function noteSeat(answer: unknown): void {\n+\tif (typeof answer !== \"object\" || answer === null || Array.isArray(answer)) return;\n+\tconst line = (answer as { seatNotice?: unknown }).seatNotice;\n+\tif (typeof line === \"string\" && line !== \"\" && line.length <= 300 && !/[\\u0000-\\u001f]/.test(line))\n+\t\tseatNotices.add(line);\n+}\n+export function takeSeatNotices(): string[] {\n+\tconst out = [...seatNotices];\n+\tseatNotices.clear();\n+\treturn out;\n+}\n+\n export class Api {\n \treadonly config: Config;\n \treadonly timeoutMs: number;\n@@ -156,16 +183,23 @@\n \t\tthis.startRetryDelaysMs = startRetryDelaysMs;\n \t}\n \n-\t/** What a box run is for, for the server's box-run records (#39): X-Avcs-Kind on POST /run. */\n+\t/** What a box run is for, for the server's box-run records (#39): X-Abso-Kind on POST /run. */\n \trunKind: RunKind = \"run\";\n \n \t/** The Issues Worker (#54) this folder's issues calls go to; set by the issues commands (issues.ts). */\n \tissuesServer: string | undefined;\n \n+\t/** Who is calling this seat (src/caller.ts): this chat's session, this computer and this folder. Set by open(). */\n+\tcaller: string | undefined;\n+\n \turl(path: string, server = this.config.server): string {\n-\t\treturn `${server.replace(/\\/+$/, \"\")}/p/${encodeURIComponent(this.config.project)}${path}`;\n+\t\tconst base = isLocal(server) ? LOCAL_BASE : server;\n+\t\treturn `${base.replace(/\\/+$/, \"\")}/p/${encodeURIComponent(this.config.project)}${path}`;\n \t}\n \n+\t/** A local project's calls: answered in this process (local-store.ts). */\n+\tprivate local: ((input: string, init?: RequestInit) => Promise<Response>) | undefined;\n+\n \tagentPath(action: string): string {\n \t\treturn `/a/${encodeURIComponent(this.config.agent)}/${action}`;\n \t}\n@@ -173,12 +207,31 @@\n \theaders(contentType?: string): Record<string, string> {\n \t\treturn {\n \t\t\t// Which client made the call (#29); the mods send theirs too.\n-\t\t\t\"x-avcs-client\": `abso-cli/${clientVersion()}`,\n-\t\t\t...(this.config.token ? { authorization: `Bearer ${this.config.token}` } : {}),\n+\t\t\t\"x-abso-client\": `abso-cli/${clientVersion()}`,\n+\t\t\t...(this.config.token && !this.config.visitor ? { authorization: `Bearer ${this.config.token}` } : {}),\n+\t\t\t// A visitor says nothing about where it's reading from.\n+\t\t\t...(this.caller !== undefined && !this.config.visitor ? { [CALLER_HEADER]: this.caller } : {}),\n \t\t\t...(contentType ? { \"content-type\": contentType } : {}),\n \t\t};\n \t}\n \n+\t/**\n+\t * Every request this Api makes goes through here. In a visitor folder it never sends anything but a GET,\n+\t * and follows no redirect, so nothing it sends goes anywhere it didn't name (headers() adds no sign-in).\n+\t */\n+\tsend(url: string, init: RequestInit = {}): Promise<Response> {\n+\t\tif (isLocal(this.config.server)) {\n+\t\t\tconst dir = this.config.localStore;\n+\t\t\tif (dir === undefined) return Promise.reject(new UsageError(NO_STORE));\n+\t\t\tthis.local ??= localFetch(dir);\n+\t\t\treturn this.local(url, init);\n+\t\t}\n+\t\tif (!this.config.visitor) return fetch(url, init);\n+\t\tif ((init.method ?? \"GET\") !== \"GET\")\n+\t\t\treturn Promise.reject(new ApiError(\"a folder that reads signed out sends only reads\"));\n+\t\treturn fetch(url, { ...init, redirect: \"error\" });\n+\t}\n+\n \tasync json<T>(\n \t\tmethod: \"GET\" | \"POST\",\n \t\tpath: string,\n@@ -187,20 +240,28 @@\n \t\tatLeastMs = 0,\n \t): Promise<T> {\n \t\tlet res: Response | undefined;\n+\t\tif (this.config.visitor && method !== \"GET\")\n+\t\t\tthrow new ApiError(`${path}: a folder that reads signed out sends only reads`);\n \t\tconst sent = body === undefined ? undefined : JSON.stringify(body);\n+\t\tconst requestId = method === \"POST\" ? randomUUID() : undefined;\n \t\tconst timeoutMs = Math.max(atLeastMs, timeoutFor(this.timeoutMs, sent));\n \t\t// A connection that never opened is tried once more, IPv4 first (#37, GAME - UI/UX: one IPv6\n \t\t// address timed out, and the same command went through seconds later). Nothing went out, so\n \t\t// a POST is as safe to send again as a GET.\n \t\tfor (let attempt = 0; res === undefined; attempt++) {\n \t\t\ttry {\n-\t\t\t\tres = await fetch(this.url(path, server), {\n+\t\t\t\tres = await this.send(this.url(path, server), {\n \t\t\t\t\tmethod,\n-\t\t\t\t\theaders: this.headers(sent === undefined ? undefined : \"application/json\"),\n+\t\t\t\t\theaders: {\n+\t\t\t\t\t\t...this.headers(sent === undefined ? undefined : \"application/json\"),\n+\t\t\t\t\t\t...(requestId ? { \"Idempotency-Key\": requestId } : {}),\n+\t\t\t\t\t},\n \t\t\t\t\t...(sent === undefined ? {} : { body: sent }),\n \t\t\t\t\tsignal: AbortSignal.timeout(timeoutMs),\n \t\t\t\t});\n \t\t\t} catch (err) {\n+\t\t\t\t// A local project's refusal (no store, a Node without SQLite) says itself.\n+\t\t\t\tif (err instanceof UsageError) throw err;\n \t\t\t\tconst e = err as Error;\n \t\t\t\tconst why =\n \t\t\t\t\te.name === \"TimeoutError\"\n@@ -218,7 +279,13 @@\n \t\t\t\tawait new Promise((ok) => setTimeout(ok, 500));\n \t\t\t}\n \t\t}\n-\t\tconst text = await res.text();\n+\t\tlet text: string;\n+\t\ttry {\n+\t\t\ttext = await res.text();\n+\t\t} catch (err) {\n+\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n+\t\t\tthrow new ApiError(`${method} ${path} response body ended unexpectedly: ${reason}`, res.status);\n+\t\t}\n \t\t// 409 is a refusal that says what to do (a drop took out lines your work builds on): print it as it is.\n \t\tif (!res.ok)\n \t\t\tthrow new ApiError(\n@@ -228,7 +295,9 @@\n \t\t\t\tres.status,\n \t\t\t);\n \t\ttry {\n-\t\t\treturn JSON.parse(text) as T;\n+\t\t\tconst parsed = JSON.parse(text) as T;\n+\t\t\tnoteSeat(parsed);\n+\t\t\treturn parsed;\n \t\t} catch {\n \t\t\tthrow new ApiError(\n \t\t\t\t`${method} ${path} answered with something that isn't JSON: ${text.slice(0, 300)}`,\n@@ -286,7 +355,7 @@\n \t\t});\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(`${this.url(\"/serve\")}?${q}`, {\n+\t\t\tres = await this.send(`${this.url(\"/serve\")}?${q}`, {\n \t\t\t\tmethod: \"POST\",\n \t\t\t\theaders: this.headers(),\n \t\t\t\tsignal: AbortSignal.timeout(20 * 60_000),\n@@ -307,13 +376,16 @@\n \tasync prep(command: string, tarGz: Uint8Array<ArrayBuffer>): Promise<PrepAnswer> {\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(`${this.url(this.agentPath(\"prep\"))}?cmd=${encodeURIComponent(command)}${boxQuery(this.box)}`, {\n-\t\t\t\tmethod: \"POST\",\n-\t\t\t\theaders: this.headers(\"application/gzip\"),\n-\t\t\t\tbody: tarGz,\n-\t\t\t\t// A setup command can take minutes (npm ci, a browser download).\n-\t\t\t\tsignal: AbortSignal.timeout(30 * 60_000),\n-\t\t\t});\n+\t\t\tres = await this.send(\n+\t\t\t\t`${this.url(this.agentPath(\"prep\"))}?cmd=${encodeURIComponent(command)}${boxQuery(this.box)}`,\n+\t\t\t\t{\n+\t\t\t\t\tmethod: \"POST\",\n+\t\t\t\t\theaders: this.headers(\"application/gzip\"),\n+\t\t\t\t\tbody: tarGz,\n+\t\t\t\t\t// A setup command can take minutes (npm ci, a browser download).\n+\t\t\t\t\tsignal: AbortSignal.timeout(30 * 60_000),\n+\t\t\t\t},\n+\t\t\t);\n \t\t} catch (err) {\n \t\t\tconst e = err as Error;\n \t\t\tthrow new ApiError(\n@@ -329,7 +401,7 @@\n \tasync unprep(): Promise<boolean> {\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(\n+\t\t\tres = await this.send(\n \t\t\t\t`${this.url(this.agentPath(\"prep\"))}${this.box ? `?box=${encodeURIComponent(this.box)}` : \"\"}`,\n \t\t\t\t{ method: \"DELETE\", headers: this.headers(), signal: AbortSignal.timeout(this.timeoutMs) },\n \t\t\t);\n@@ -365,7 +437,7 @@\n \tasync bytes(method: \"GET\" | \"PUT\", path: string, body?: Uint8Array): Promise<Uint8Array> {\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(this.url(path), {\n+\t\t\tres = await this.send(this.url(path), {\n \t\t\t\tmethod,\n \t\t\t\theaders: this.headers(body === undefined ? undefined : \"application/octet-stream\"),\n \t\t\t\t...(body === undefined ? {} : { body: body as Uint8Array<ArrayBuffer> }),\n@@ -423,6 +495,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@@ -450,6 +533,16 @@\n \t\treturn this.#issues(\"GET\", `/issue/${id}`);\n \t}\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.#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.#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 \twaiting(of?: string): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {\n \t\treturn this.#issues(\"GET\", `/waiting?${query({ of })}`);\n@@ -477,9 +570,9 @@\n \t\tconst path = this.agentPath(\"attachments\");\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(this.url(path, this.issuesServer), {\n+\t\t\tres = await this.send(this.url(path, this.issuesServer), {\n \t\t\t\tmethod: \"POST\",\n-\t\t\t\theaders: { ...this.headers(\"application/octet-stream\"), \"x-avcs-name\": encodeURIComponent(name) },\n+\t\t\t\theaders: { ...this.headers(\"application/octet-stream\"), \"x-abso-name\": encodeURIComponent(name) },\n \t\t\t\tbody: bytes as Uint8Array<ArrayBuffer>,\n \t\t\t\tsignal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),\n \t\t\t});\n@@ -524,7 +617,7 @@\n \t\tconst url = `${this.attachmentUrl(id)}${source ? \"/source\" : \"\"}`;\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(url, {\n+\t\t\tres = await this.send(url, {\n \t\t\t\theaders: this.headers(),\n \t\t\t\tsignal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),\n \t\t\t});\n@@ -625,6 +718,58 @@\n \t\treturn this.#issues(\"POST\", this.agentPath(`answer/${id}`), body);\n \t}\n \n+\t/** Acknowledges an ask of this agent without answering it: the asker hears it, and the ask stays open. */\n+\tack(id: number, body: { note?: string }): Promise<{ ask: Ask; news?: IssueNews }> {\n+\t\treturn this.#issues(\"POST\", this.agentPath(`ack/${id}`), body);\n+\t}\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.#threads(this.#issues(\"POST\", this.agentPath(`reply/${id}`), body));\n+\t}\n+\n+\t/** A groups call, with a server from before groups named as that rather than a bare 404. */\n+\tasync #groups<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|reads have no/.test(err.message))\n+\t\t\t\tthrow new ApiError(`${this.config.server} doesn't have groups yet`, 404);\n+\t\t\tthrow err;\n+\t\t}\n+\t}\n+\n+\t/** The project's groups this agent can see. */\n+\tgroupList(): Promise<{ groups: readonly GroupSummary[] }> {\n+\t\treturn this.#groups(this.#issues(\"GET\", this.agentPath(\"groups\")));\n+\t}\n+\n+\t/** One group's settings and roster, by name or id. */\n+\tgroup(ref: string): Promise<GroupShown> {\n+\t\treturn this.#groups(this.#issues(\"GET\", this.agentPath(`group/${encodeURIComponent(ref)}`)));\n+\t}\n+\n+\t/** A page of a group's history, newest first, and the `before` that reads further back (null at the start). */\n+\tgroupEvents(\n+\t\tref: string,\n+\t\tq: { before?: number; limit?: number; kind?: string } = {},\n+\t): Promise<{ events: readonly GroupEvent[]; before: number | null }> {\n+\t\tconst qs = query({ before: q.before, limit: q.limit, kind: q.kind }).toString();\n+\t\treturn this.#groups(\n+\t\t\tthis.#issues(\"GET\", this.agentPath(`group/${encodeURIComponent(ref)}/events${qs ? `?${qs}` : \"\"}`)),\n+\t\t);\n+\t}\n+\n+\t/** Make a group (ref undefined), or post, join, leave, add, remove or change settings in one. */\n+\tgroupWrite(\n+\t\tref: string | undefined,\n+\t\taction: \"post\" | \"join\" | \"leave\" | \"add\" | \"remove\" | \"settings\" | undefined,\n+\t\tbody: Record<string, unknown>,\n+\t): Promise<GroupWrite> {\n+\t\tconst path = ref === undefined ? \"groups\" : `group/${encodeURIComponent(ref)}/${action}`;\n+\t\treturn this.#groups(this.#issues(\"POST\", this.agentPath(path), body));\n+\t}\n+\n \t/** Takes back an ask this agent made, with a note on why; the one asked hears it. */\n \twithdraw(id: number, body: { note?: string }): Promise<{ ask: Ask; news?: IssueNews }> {\n \t\treturn this.#issues(\"POST\", this.agentPath(`withdraw/${id}`), body);\n@@ -658,6 +803,26 @@\n \t\treturn this.json(\"POST\", `/visibility?visibility=${v}`, {});\n \t}\n \n+\t/** The project's auto-settle choice (abso-core 23): off, advise or settle, and how sure before abso settles. */\n+\tautosettle(): Promise<AutosettleAnswer> {\n+\t\treturn this.json(\"GET\", \"/autosettle\");\n+\t}\n+\n+\t/** Change it (abso-core 23): an owner's key, or the shared token on staging. Without `at`, the server keeps its own. */\n+\tsetAutosettle(mode: AutosettleMode, at?: number): Promise<AutosettleAnswer> {\n+\t\treturn this.json(\"POST\", `/autosettle?mode=${mode}${at === undefined ? \"\" : `&at=${at}`}`, {});\n+\t}\n+\n+\t/** Auto-settle's history (abso-core 23): held pushes the model advised on, newest first. */\n+\tautosettleHistory(): Promise<unknown> {\n+\t\treturn this.json(\"GET\", \"/autosettle/history\");\n+\t}\n+\n+\t/** One held push from the history, with each collision's calls to the model. */\n+\tautosettleHold(id: number): Promise<unknown> {\n+\t\treturn this.json(\"GET\", `/autosettle/history/${id}`);\n+\t}\n+\n \t/** Take back this agent's queued publishes (#39); refused while one is being checked. */\n \tunqueue(): Promise<{ pulled: readonly number[] }> {\n \t\treturn this.json(\"POST\", this.agentPath(\"unqueue\"), {});\n@@ -739,6 +904,11 @@\n \t\treturn this.json(\"GET\", version === undefined ? \"/ci\" : `/ci?${query({ version })}`);\n \t}\n \n+\t/** The project's pipeline runs, newest first; one run with its jobs; or one job's log (`log` is pipeline.job). */\n+\tpipelineRuns(run?: number, log?: string): Promise<unknown> {\n+\t\treturn this.json(\"GET\", run === undefined ? \"/pipelines\" : `/pipelines?${query({ run, log })}`);\n+\t}\n+\n \t/** Ends every /latest link handed out so far; answers CI's state with the new link. */\n \tciRevoke(): Promise<CiStatus> {\n \t\treturn this.json(\"POST\", \"/ci/revoke\", {});\n@@ -815,6 +985,11 @@\n \t\treturn this.json(\"GET\", `/compare?${query({ from, to, ...where })}`);\n \t}\n \n+\t/** Version `version` of shared with `versions` left out, or the refusal naming what builds on them. */\n+\twithout(version: number, versions: readonly number[]): Promise<WithoutAnswer> {\n+\t\treturn this.json(\"GET\", `/without?${query({ version, versions: versions.join(\",\") })}`);\n+\t}\n+\n \t/** A message to the project's other agents (or those named), delivered once as news. */\n \tstarting(\n \t\ttext: string | null,\n@@ -841,18 +1016,28 @@\n \t\treturn this.json(\"POST\", this.agentPath(\"news\"), {});\n \t}\n \n+\t/** A ticket that opens this agent's news stream once, within a minute (abso 690; news-stream.ts). */\n+\tnewsTicket(): Promise<{ url: string; protocols: string[]; expiresAt: number | string }> {\n+\t\treturn this.json(\"POST\", this.agentPath(\"news/ticket\"), {});\n+\t}\n+\n \t/** This agent's unpublished changes, file by file. */\n \tdiff(): Promise<DiffAnswer> {\n \t\treturn this.json(\"POST\", this.agentPath(\"diff\"), {});\n \t}\n \n+\t/** Another agent's recorded, unpublished changes, file by file: read only, as the website's drafts show them. */\n+\tdiffOf(agent: string): Promise<DiffAnswer> {\n+\t\treturn this.json(\"GET\", `/diff?${query({ agent })}`);\n+\t}\n+\n \t/** Discard this agent's unpublished changes to `files` (null: all of them). */\n \trestore(files: readonly string[] | null): Promise<RestoreAnswer> {\n \t\treturn this.json(\"POST\", this.agentPath(\"restore\"), files === null ? { all: true } : { files });\n \t}\n \n-\twhy(file: string, line: number, view: View = {}): Promise<WhyAnswer> {\n-\t\treturn this.json(\"GET\", `/why?${query({ file, line, ...view })}`);\n+\twhy(file: string, line: number, view: View = {}, version?: number): Promise<WhyAnswer> {\n+\t\treturn this.json(\"GET\", `/why?${query({ file, line, version, ...view })}`);\n \t}\n \n \twhere(): Promise<WhereAnswer> {\n@@ -872,9 +1057,9 @@\n \t */\n \tasync run(command: string, tarGz: Uint8Array<ArrayBuffer>, io: RunIO): Promise<number> {\n \t\tconst res = await postRun(this, command, tarGz, io.onRetry, io.replace, io.fresh);\n-\t\t// X-Avcs-Box: cold means the box started for this run; X-Avcs-Prep says whether it started from the prep (#37).\n-\t\tio.onBox?.(res.headers.get(\"x-avcs-box\") === \"cold\", res.headers.get(\"x-avcs-prep\") ?? undefined);\n-\t\treturn follow(this, res, res.headers.get(\"x-avcs-run\"), { at: 0, errAt: 0 }, io);\n+\t\t// X-Abso-Box: cold means the box started for this run; X-Abso-Prep says whether it started from the prep (#37).\n+\t\tio.onBox?.(res.headers.get(\"x-abso-box\") === \"cold\", res.headers.get(\"x-abso-prep\") ?? undefined);\n+\t\treturn follow(this, res, res.headers.get(\"x-abso-run\"), { at: 0, errAt: 0 }, io);\n \t}\n \n \t/**\n@@ -888,7 +1073,7 @@\n \t\treplace = false,\n \t): Promise<string> {\n \t\tconst res = await postRun(this, command, tarGz, onRetry, replace);\n-\t\tconst id = res.headers.get(\"x-avcs-run\");\n+\t\tconst id = res.headers.get(\"x-abso-run\");\n \t\tif (id === null) {\n \t\t\t// No id: the box failed before the job started ({\"error\"} in the body), or the server can't detach.\n \t\t\tawait consumeRun(res, { out: () => {} }, { at: 0, errAt: 0 });\n@@ -902,7 +1087,7 @@\n \tasync logs(id: string, io: RunIO): Promise<number> {\n \t\tlet res: Response;\n \t\ttry {\n-\t\t\tres = await fetch(followUrl(this, id, { at: 0, errAt: 0 }), { headers: this.headers() });\n+\t\t\tres = await this.send(followUrl(this, id, { at: 0, errAt: 0 }), { headers: this.headers() });\n \t\t} catch (err) {\n \t\t\tconst e = err as Error;\n \t\t\tthrow new ApiError("}],"unmatched":[]}