(controller)
| 259 | |
| 260 | const stream = new ReadableStream({ |
| 261 | async start(controller) { |
| 262 | // Re-enter the root OTel context so any `withCopilotSpan` call below |
| 263 | // (inside flushEvents/checkForReplayGap/etc.) parents under |
| 264 | // copilot.resume.request instead of becoming an orphan. |
| 265 | return otelContext.with(rootContext, () => startInner(controller)) |
| 266 | }, |
| 267 | }) |
| 268 | |
| 269 | async function startInner(controller: ReadableStreamDefaultController) { |
nothing calls this directly
no test coverage detected