(messageId: string, reason: string)
| 3710 | } |
| 3711 | |
| 3712 | private async clearFailedAssistantMessage(messageId: string, reason: string): Promise<void> { |
| 3713 | const [partialResult, deleteMessageResult] = await Promise.all([ |
| 3714 | this.historyService.deletePartial(this.workspaceId), |
| 3715 | this.historyService.deleteMessage(this.workspaceId, messageId), |
| 3716 | ]); |
| 3717 | |
| 3718 | if (!partialResult.success) { |
| 3719 | log.warn("Failed to clear partial before retry", { |
| 3720 | workspaceId: this.workspaceId, |
| 3721 | reason, |
| 3722 | error: partialResult.error, |
| 3723 | }); |
| 3724 | } |
| 3725 | |
| 3726 | if ( |
| 3727 | !deleteMessageResult.success && |
| 3728 | !( |
| 3729 | typeof deleteMessageResult.error === "string" && |
| 3730 | deleteMessageResult.error.includes("not found in history") |
| 3731 | ) |
| 3732 | ) { |
| 3733 | log.warn("Failed to delete failed assistant placeholder", { |
| 3734 | workspaceId: this.workspaceId, |
| 3735 | reason, |
| 3736 | error: deleteMessageResult.error, |
| 3737 | }); |
| 3738 | } |
| 3739 | } |
| 3740 | |
| 3741 | private async finalizeCompactionRetry(messageId: string): Promise<void> { |
| 3742 | this.activeCompactionRequest = undefined; |
no test coverage detected