cleanupai.dll Error in Windows 10 and 11: Windows servicing cleanup stage

A feature update or component cleanup fails, and a Windows servicing log names cleanupai.dll. Keep the first error before attempting another cleanup.
The Windows file inventory identifies cleanupai.dll as CMI Cleanup plug-in. Capture the actual error, file path and Windows build before making changes.
Check where the error occurs
Find the original operation and its corresponding CBS or DISM log timestamp. Check free disk space and pending restart state before following the error-specific servicing guidance.
Repair the affected feature
Use Windows' supported storage cleanup and Microsoft servicing routines. Keep the files needed for rollback, and leave the component store under Windows servicing control.
If Windows reports corruption of a protected system file, use Microsoft’s system file repair procedure. Obtain software and drivers through Windows Update or the applicable publisher.
Verify the repair
Repeat the approved cleanup and confirm completion. If an update preceded it, verify the installed build and the operation's final servicing result.
See the publisher’s guidance, the exact Windows file record, and the related PC Repair Atlas guide.