(requestId: string)
| 73 | } |
| 74 | |
| 75 | private finalizeComplete(requestId: string): void { |
| 76 | const state = this.requestStates.get(requestId) |
| 77 | if (!state || (state.status !== 'running' && state.status !== 'aborted')) { |
| 78 | return |
| 79 | } |
| 80 | |
| 81 | state.status = 'completed' |
| 82 | state.event.sender.send(state.eventChannel, { |
| 83 | requestId, |
| 84 | type: 'complete', |
| 85 | content: state.fullResponse, |
| 86 | reasoning_content: state.fullReasoning || undefined |
| 87 | } as AIStreamChunk) |
| 88 | |
| 89 | this.cleanupRequest(requestId) |
| 90 | } |
| 91 | |
| 92 | private finalizeError(requestId: string, error: string): void { |
| 93 | const state = this.requestStates.get(requestId) |
no test coverage detected