From 8f1b045f40f5eef93eea9435fb4eef22690315db Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sat, 24 Oct 2026 13:39:55 -0500 Subject: [PATCH] row224: await citation hydration in new launch test --- agents/della/work/queue-224/BUILD.md | 10 ++++++++++ packages/cli/tests/thread-launch.test.mjs | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/agents/della/work/queue-224/BUILD.md b/agents/della/work/queue-224/BUILD.md index 323cb2a3d..70b119ec6 100644 --- a/agents/della/work/queue-224/BUILD.md +++ b/agents/della/work/queue-224/BUILD.md @@ -509,3 +509,13 @@ test at packages/cli/tests/thread-launch.test.mjs:540:1 at async Test.run (node:internal/test_runner/test:1409:7) at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) ``` + +## sage-4210 — new-test async citation fixture fix + +Only C2-05b now inlines send/wait, awaits thread.messages before .find, and +keeps the from_role assistant / to_role human assertions previously provided +by ask. Comment names broker.mjs:4854 async citation hydration. Existing ask, +old tests and production unchanged. This is Sage's own-new-test ruling under +mos-1590; Dewey re-reviews the delta. Whole-file rerun once authorized, then +the nine other files, whole bus/harness, M-B1 and clean-tree check on green. +Each gets a fresh shell gXXX TMPDIR and absolute nice 19; any red stops. diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs index a5e0f1b91..28d4530a7 100644 --- a/packages/cli/tests/thread-launch.test.mjs +++ b/packages/cli/tests/thread-launch.test.mjs @@ -547,7 +547,11 @@ test("C2-05b a real launched bundle gets lookups for a library project without a const host = await start(t, prepared); const project = host.call("project.create", { name: "library work", repo: "stack" }).id; const thread = host.call("thread.create", { project, name: "lookup" }).id; - await ask(host.call, thread, "inspect bundle"); + const sent = host.call("thread.send", { thread, body: "inspect bundle" }); + // broker.mjs:4854 uses async citation hydration for a business with a library. + const reply = await until(async () => (await host.call("thread.messages", { thread })).find(m => m.in_reply_to === sent.id && m.class === "RESULT")); + assert.equal(reply.from_role, "assistant"); + assert.equal(reply.to_role, "human"); const run = launchLog(f).find(e => e.event === "launch" && e.thread === thread).run; const tools = JSON.parse(readFileSync(join(f.dataRoot, "launches", "acme", run, "bundle", "tools.json"), "utf8")); assert.deepEqual(tools.filter(tool => tool.name.startsWith("library_")).map(tool => tool.name),