Episode P1.6
Stressed by an imminent surprise inspection by Star Fleet and uncertain as to what is required of him, Alan has little time to repair a space robot adorably, if inexplicably, nicknamed ‘Peanut Hamper’ by his colleagues, which has malfunctioned (or been ‘naughty’ as the others say).
But a quick stab and twist of a Klingon ritual Mevak knife slices through its optical system (‘Out vile jelly!’ thinks Alan, for no reason, whistling while he works) probably ensuring it won’t ‘survive’ more than a century or three when he next has time to eject it into the utter loneliness of space.