* Cancels the current HTTP request if one is in progress. * This immediately aborts the underlying stream rather than waiting for the next chunk.
()
| 2178 | * This immediately aborts the underlying stream rather than waiting for the next chunk. |
| 2179 | */ |
| 2180 | public cancelCurrentRequest(): void { |
| 2181 | if (this.currentRequestAbortController) { |
| 2182 | console.log(`[Task#${this.taskId}.${this.instanceId}] Aborting current HTTP request`) |
| 2183 | this.currentRequestAbortController.abort() |
| 2184 | this.currentRequestAbortController = undefined |
| 2185 | } |
| 2186 | } |
| 2187 | |
| 2188 | /** |
| 2189 | * Force emit a final token usage update, ignoring throttle. |
no test coverage detected