{"draft":null,"from":203,"to":204,"files":[{"path":"server/src/router.ts","added":2,"removed":18,"diff":"--- a/server/src/router.ts\n+++ b/server/src/router.ts\n@@ -18,7 +18,7 @@\n // ABSO_TOKEN set, the server refuses every call.\n \n import { type Answer, validName } from \"../../worker/project/http.ts\";\n-import { adviseHeld } from \"./autosettle.ts\";\n+import { withAdvice } from \"./autosettle.ts\";\n import { artifactsOf, type Env, secret } from \"./env.ts\";\n import type { IssuesAuth, issuesFetch } from \"./issues-entry.ts\";\n import { isAgentKey, type KeyRole, keyAllows, keysEnabled, timingSame } from \"./keys.ts\";\n@@ -270,23 +270,7 @@\n \t\t\trequest.headers.get(\"Idempotency-Key\") ?? undefined,\n \t\t)) as unknown as Answer;\n \t\t// A held push gets a first opinion on each collision (#19), when the server is set up for it.\n-\t\tif (op === \"publish\" && env.AUTOSETTLE === \"on\" && env.AI && agent) {\n-\t\t\tconst held = a.body as { ok?: boolean; collisions?: Parameters<typeof adviseHeld>[1] };\n-\t\t\tif (held.ok === false && held.collisions && held.collisions.length > 0) {\n-\t\t\t\tconst message = String((body as { message?: unknown } | undefined)?.message ?? \"\");\n-\t\t\t\tconst advice = await adviseHeld(\n-\t\t\t\t\tenv.AI,\n-\t\t\t\t\theld.collisions,\n-\t\t\t\t\t{ agent, message },\n-\t\t\t\t\t{\n-\t\t\t\t\t\t...(env.AUTOSETTLE_MODEL ? { model: env.AUTOSETTLE_MODEL } : {}),\n-\t\t\t\t\t\t...(Number(env.AUTOSETTLE_AT) > 0 ? { at: Number(env.AUTOSETTLE_AT) } : {}),\n-\t\t\t\t\t},\n-\t\t\t\t);\n-\t\t\t\tif (advice.some((x) => x !== null)) return json(a.status, { ...held, advice });\n-\t\t\t}\n-\t\t}\n-\t\treturn json(a.status, a.body);\n+\t\treturn json(a.status, await withAdvice(env, op, agent, body, a.body));\n \t} catch (e) {\n \t\tconst error = `the project object failed: ${e instanceof Error ? e.message : String(e)}`;\n \t\tconsole.error(`${project} ${op ?? top}: ${error}`);"}],"unmatched":[]}