MCPcopy
hub / github.com/promptfoo/promptfoo / handleDone

Method handleDone

src/python/worker.ts:232–245  ·  view source on GitHub ↗
(responseFile: string)

Source from the content-addressed store, hash-verified

230 }
231
232 private handleDone(responseFile: string): void {
233 const normalizedResponseFile = responseFile.replace(/[\r\n]+$/, '');
234 if (this.pendingRequest?.responseFile === normalizedResponseFile) {
235 this.pendingRequest.resolve(undefined);
236 this.pendingRequest = null;
237 return;
238 }
239 // Either no request is in flight, or the path does not match the one we
240 // dispatched. Do not record either path: the received marker is
241 // provider-controlled and the pending path belongs to a private temp dir.
242 logger.debug('Python worker ignored DONE marker that did not match the in-flight request', {
243 hasPendingRequest: this.pendingRequest !== null,
244 });
245 }
246
247 private handleCrash(): void {
248 this.ready = false;

Callers 2

startWorkerMethod · 0.95
worker.test.tsFile · 0.80

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected