(provider, modelId)
| 34 | assert.deepEqual(model.headers, { "X-Existing": "kept" }); |
| 35 | }); |
| 36 | |
| 37 | test("handleMessage forwards the final agent_end after an automatic retry", async () => { |
| 38 | const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "skillpack-agent-")); |
| 39 | const listeners = new Set<(event: { type: string }) => void>(); |
| 40 | const session = { |
| 41 | _agentEventQueue: Promise.resolve(), |
| 42 | state: { messages: [] }, |
| 43 | systemPrompt: "", |
| 44 | subscribe(listener: (event: { type: string }) => void) { |
| 45 | listeners.add(listener); |
| 46 | return () => listeners.delete(listener); |
| 47 | }, |
| 48 | async prompt() { |
| 49 | for (const type of [ |
| 50 | "agent_start", |
| 51 | "agent_end", |
| 52 | "agent_start", |
| 53 | "agent_end", |
| 54 | ]) { |
| 55 | for (const listener of listeners) { |
| 56 | listener({ type }); |
| 57 | } |
| 58 | } |
| 59 | }, |
| 60 | }; |
| 61 | const channelSession = { |
| 62 | session, |
nothing calls this directly
no outgoing calls
no test coverage detected