fix(qa): declare delivery thread identity

This commit is contained in:
Dallin Romney
2026-08-21 01:19:06 -07:00
parent aaa5917619
commit 54a289000b
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -4,6 +4,7 @@
import path from "node:path";
import type { Command } from "commander";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { QaRunnerCliRegistration } from "./qa-runner-runtime.js";
import {
cleanupTempDirs,
expectPrivateQaLabRuntimeSurfaceLoad,
@@ -77,6 +78,21 @@ describe("plugin-sdk qa-runner-runtime", () => {
}
});
it("exposes structured thread identity to transport delivery adapters", () => {
type Adapter = Awaited<
ReturnType<NonNullable<QaRunnerCliRegistration["adapterFactory"]>["create"]>
>;
const buildAgentDelivery: Adapter["buildAgentDelivery"] = ({ target, threadId }) => ({
channel: "linked",
replyChannel: "linked",
replyTo: threadId ? `${target}:thread:${threadId}` : target,
});
expect(buildAgentDelivery({ target: "channel:room", threadId: "topic-1" }).replyTo).toBe(
"channel:room:thread:topic-1",
);
});
it("stays cold until runner discovery is requested", async () => {
await import("./qa-runner-runtime.js");
+1 -1
View File
@@ -154,7 +154,7 @@ type QaRunnerTransportAdapterDefinition = {
timeoutMs?: number;
pollIntervalMs?: number;
}) => Promise<void>;
buildAgentDelivery: (params: { target: string }) => {
buildAgentDelivery: (params: { target: string; threadId?: string }) => {
channel: string;
to?: string;
replyChannel: string;