import test from "node:test"; import assert from "node:assert/strict"; import { readFile } from "node:fs/promises"; test("master agent complete route does not block completion response on Telegram delivery", async () => { const source = await readFile( new URL("../src/app/api/v1/master-agent/tasks/[taskId]/complete/route.ts", import.meta.url), "utf8", ); assert.doesNotMatch( source, /await\s+deliverTelegramReplyForCompletedTask/, "task completion must not wait for Telegram delivery before returning to local-agent", ); assert.match( source, /void\s+deliverTelegramReplyForCompletedTask/, "expected Telegram delivery to be scheduled in the background after the task is persisted", ); });