From 54a289000b3fda07ed5cd8b414cea5542d1b522d Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 21 Aug 2026 01:19:06 -0700 Subject: [PATCH] fix(qa): declare delivery thread identity --- src/plugin-sdk/qa-runner-runtime.test.ts | 16 ++++++++++++++++ src/plugin-sdk/qa-runner-runtime.ts | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/plugin-sdk/qa-runner-runtime.test.ts b/src/plugin-sdk/qa-runner-runtime.test.ts index e46ceb6fed6f..82f983fe9257 100644 --- a/src/plugin-sdk/qa-runner-runtime.test.ts +++ b/src/plugin-sdk/qa-runner-runtime.test.ts @@ -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["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"); diff --git a/src/plugin-sdk/qa-runner-runtime.ts b/src/plugin-sdk/qa-runner-runtime.ts index 603baad197b8..e50470ec832e 100644 --- a/src/plugin-sdk/qa-runner-runtime.ts +++ b/src/plugin-sdk/qa-runner-runtime.ts @@ -154,7 +154,7 @@ type QaRunnerTransportAdapterDefinition = { timeoutMs?: number; pollIntervalMs?: number; }) => Promise; - buildAgentDelivery: (params: { target: string }) => { + buildAgentDelivery: (params: { target: string; threadId?: string }) => { channel: string; to?: string; replyChannel: string;