MCPcopy
hub / github.com/coder/mux / snapshotSideQuestionLiveStream

Function snapshotSideQuestionLiveStream

src/node/services/sideQuestionService.ts:151–164  ·  view source on GitHub ↗
(
  liveStream: ReturnType<AIService["getStreamInfo"]>
)

Source from the content-addressed store, hash-verified

149 * existing `onChat` subscription.
150 */
151export 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
166export async function askSideQuestion(
167 opts: AskSideQuestionOptions

Callers 2

askSideQuestionMethod · 0.90
askSideQuestionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected