MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / makeTestThread

Function makeTestThread

packages/bot/src/thread.test.ts:9–31  ·  view source on GitHub ↗
(overrides: {
  state: MemoryStore;
  conversationKey?: string;
})

Source from the content-addressed store, hash-verified

7import { InMemoryActionStore } from "./action-store.js";
8
9function makeTestThread(overrides: {
10 state: MemoryStore;
11 conversationKey?: string;
12}): Thread {
13 const adapter = new FakeAdapter();
14 const registry = new ActionRegistry({ store: new InMemoryActionStore() });
15 const deps: ThreadDeps = {
16 adapter,
17 replyTarget: {},
18 conversationKey: overrides.conversationKey ?? "c1",
19 registry,
20 agentFactory: (id) => {
21 throw new Error(`agentFactory not needed in this test: ${id}`);
22 },
23 tools: new Map(),
24 toolDescriptors: [],
25 context: [],
26 registerWaiter: () => {},
27 interruptHandlers: new Map(),
28 state: overrides.state,
29 };
30 return new Thread(deps);
31}
32
33describe("Thread.subscribe / unsubscribe / isSubscribed", () => {
34 it("subscribe marks the conversation as subscribed", async () => {

Callers 1

thread.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…