mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
fix(qa): declare delivery thread identity
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user