* Consume the current runless run id (if any), forgetting it. Used when an * ignored, runId-less RUN_ERROR drains the run the client is still tracking.
()
| 291 | * ignored, runId-less RUN_ERROR drains the run the client is still tracking. |
| 292 | */ |
| 293 | takeRunlessRunId(): string | null { |
| 294 | const runId = this.currentRunlessRunId |
| 295 | if (!runId) return null |
| 296 | this.ignoredActiveRunIds.delete(runId) |
| 297 | this.clearedRunIds.delete(runId) |
| 298 | // Advance to another still-ignored run (mirroring `onRunSettled`) so that |
| 299 | // when two cleared runs drain concurrently, draining one via a runId-less |
| 300 | // RUN_ERROR doesn't stop suppressing the other's runless content. |
| 301 | this.currentRunlessRunId = |
| 302 | this.ignoredActiveRunIds.values().next().value ?? null |
| 303 | return runId |
| 304 | } |
| 305 | |
| 306 | private markIgnoredChunkIds(chunk: StreamChunk): void { |
| 307 | const messageId = getChunkMessageId(chunk) |
no test coverage detected