Broken fork bearing crown race stays this is my diy electric bike, but in the latest headset servicing (I had to change the seal of the top bearing), I noticed that I've a broken part on the top of the &quot;bearing crown race stays&quot;.

The funny thing is that I found this picture of 2 years ago where the damage was already there, but since I was a noob about bike maintenance (and still I'm, but a bit less), I ignored that. The picture was made even before the conversion.

I did 5000km since then, and I didn't noticed any play in the headset, but is it safe to ride? What I should do to mitigate/fix this? Can this broke catastrophically someday? the bike is 10 years old.

This is the bearing crown race that goes on the bottom of the fork, and I can slide with my fingers easily, but still no play in there, as far as I can feel. This would need a replacement as well but I cannot find in the internet, this is a weird 1 1/8 threaded fork.
The broken section of the crown race seat suggests there is an air gap between the crown race seat and the steerer.
There's not enough information present in the photos to answer the question of the risk of failure.
Many unicrown forks have the blades welded to the steerer directly. Because yours seems to show a continuous diameter from the crown race seat down, it's hard to tell whether its got a crown race ring of this style:

or if the &quot;crown&quot; is one big sleeve for the steerer with the legs welded to the sleeve, the race seat machined into the top of it, and the steerer brazed into it.
If the steerer is one piece with whatever the legs are welded to and the part with the bad/broken joint is a separate crown race ring, then complete failure would be something along the lines of a very loose headset. Losing control of the bike in a dangerous way is conceivable if that happened.
If you do have a sleeve type design and this break has resulted from a gappy or incomplete braze/weld/bond between the steerer and the sleeve, that's pretty sketchy.
Your options are:

Try to find a suitable replacement, which could be difficult.
Just have a framebuilder make you a fork or fix this one. Normally this would be pretty crazy, but I don't know how much your motor kit costs, so maybe it's worth considering.
Transplant the motor kit on to a different basic folder. Might be the most economical.