()
| 3668 | } |
| 3669 | |
| 3670 | private async finalizeOwnedRun(): Promise<void> { |
| 3671 | const failures = new FailureCollector(); |
| 3672 | const interactionRun = this.interactionRun; |
| 3673 | if (interactionRun) { |
| 3674 | await failures.capture(async () => { |
| 3675 | await interactionRun.close(interactionClosureReason(this.run)); |
| 3676 | await interactionRun.settleLocalClosures(); |
| 3677 | }); |
| 3678 | } |
| 3679 | |
| 3680 | await failures.capture(() => this.run.finalize()); |
| 3681 | if (!failures.hasFailures && interactionRun) { |
| 3682 | await failures.capture(() => this.callbacks.releaseInteraction(interactionRun)); |
| 3683 | } |
| 3684 | const message = `Interaction and Run finalization failed for ${this.run.runId}`; |
| 3685 | try { |
| 3686 | failures.throwIfAny(message); |
| 3687 | } catch (error) { |
| 3688 | throw runtimeOwnerCleanupFailure(message, error); |
| 3689 | } |
| 3690 | } |
| 3691 | } |
| 3692 | |
| 3693 | function childActiveKey(sessionId: string, turnId: string): string { |
no test coverage detected