( liveStream: ReturnType<AIService["getStreamInfo"]> )
| 149 | * existing `onChat` subscription. |
| 150 | */ |
| 151 | export function snapshotSideQuestionLiveStream( |
| 152 | liveStream: ReturnType<AIService["getStreamInfo"]> |
| 153 | ): ReturnType<AIService["getStreamInfo"]> { |
| 154 | return liveStream |
| 155 | ? { |
| 156 | ...liveStream, |
| 157 | // Freeze the visible-at-/btw part list before any awaited I/O. |
| 158 | // StreamManager mutates this array as new main-agent chunks arrive; |
| 159 | // the side-question prompt must line up with the interruption offset |
| 160 | // captured at this exact moment. |
| 161 | parts: liveStream.parts.map((part) => ({ ...part })), |
| 162 | } |
| 163 | : undefined; |
| 164 | } |
| 165 | |
| 166 | export async function askSideQuestion( |
| 167 | opts: AskSideQuestionOptions |
no outgoing calls
no test coverage detected