* Fake AIService for side-question tests. `getStreamInfo` defaults to * "no main-agent stream is in flight" so the side question records no * interruption metadata; callers that want to exercise the split path * override it with a `streamInfo` arg.
( model: LanguageModel, streamInfo?: ReturnType<AIService["getStreamInfo"]> )
| 36 | * override it with a `streamInfo` arg. |
| 37 | */ |
| 38 | function createFakeAIService( |
| 39 | model: LanguageModel, |
| 40 | streamInfo?: ReturnType<AIService["getStreamInfo"]> |
| 41 | ): SideQuestionAIService { |
| 42 | return { |
| 43 | createModel: () => Promise.resolve(Ok(model)), |
| 44 | getStreamInfo: () => streamInfo, |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | /** Fake textStream that emits a fixed sequence of chunks. */ |
| 49 | function fakeTextStream(chunks: readonly string[]) { |
no test coverage detected