From a plane landing to a pull request

From a plane landing to a pull request

Oct 15, 2026

One evening in my career game I took off from the KSC in a plane and flew to the Island Airfield. Nothing exploded, nothing looked wrong. Then I opened the log: 7,830 exceptions from RoverScience in a few minutes, with only three flight scene loads.

What was going on

RoverScience has a small class that listens for "this vessel just landed". It signs up for that event when a flight starts, but never signs off. So every scene change (a launch, a revert, a quickload) leaves the old, already destroyed copy still listening. And a plane bouncing on a runway "lands" many times. Every bounce woke up every dead copy, and every one of them threw an error.

The fix

Six lines: sign off when the class is destroyed, the same way the rest of the mod already does. To prove it, I ran the game twice without a screen, with only the mod's DLL different: 20 errors before, 0 after. Then I played it by hand, because a headless run can't show everything: launched a rover, reverted twice, switched to it from the Tracking Station, recovered it and launched it again. Five flight scene loads, zero errors.

linuxgurugamer merged it and released RoverScience 2.3.5.11 the same morning, my second fix in that mod in four days. Before that came a fair question: wouldn't KSPCommunityFixes already clean this up? I had it installed, so we checked its code and my log. It cleans up after stock parts, but leaves mod add-ons alone on purpose, and it had logged 36 warnings about this exact class. The fix was still needed.

One more, found on the way

During that manual test, putting the RoverScience brain on a craft in the VAB threw a different error, unrelated to the fix: a check that only makes sense in flight was also running in the editor, where there is no vessel. This time the before/after ran on my own GPU, two runs of about two minutes each: 1 error with the current version, 0 with the fix. It's now waiting for review as PR #13.

What the AI got wrong (and who caught it)

I did this with Claudinho, my AI intern (Claude, by Anthropic). He read the code, wrote the fix and ran the headless tests. He also made three mistakes, all caught before anything went out:

  • His first test "passed" without testing anything: without a screen, the ship never loads, so the event never fired.

  • His log summary counted every error twice (15,660 instead of 7,830). It didn't match my count by hand.

  • His first before/after comparison buried the real result in tenth place.

That's why a new rule came out of this one: every fix gets a manual test in the game before the commit, and every commit waits for my OK. I answer for what goes out.

The whole story, with the commands, is in the ksp-moddev docs (the tools I used for the headless runs).

If you like this kind of bug hunt, a coffee keeps the hunter awake. ☕🚀

🇧🇷 Em português: num voo de avião até a Island Airfield, na minha carreira, o RoverScience encheu o log com 7.830 erros. Uma parte do mod se inscrevia no evento de pouso e nunca saía; a cada troca de cena sobrava uma cópia "morta", e cada quique do avião na pista acordava todas elas. A correção tem seis linhas, foi testada sem tela (20 → 0 erros) e à mão no jogo, e já está na versão 2.3.5.11. No mesmo teste apareceu um segundo erro, no editor (VAB); a correção está no PR #13, esperando revisão. O Claudinho, meu estagiário de IA, errou três vezes no caminho; todas foram pegas antes de publicar.

RoverScience 2.3.5.11: https://github.com/linuxgurugamer/RoverScience-Continued/releases/tag/2.3.5.11

The fix (PR #12): https://github.com/linuxgurugamer/RoverScience-Continued/pull/12

The editor error (PR #13, in review): https://github.com/linuxgurugamer/RoverScience-Continued/pull/13

The whole story (ksp-moddev): https://github.com/celino/ksp-moddev/blob/main/docs/ai-workflow.md

Ti piace questo post?

Offri un caffè a Fogueteiro da Holanda

Altro da Fogueteiro da Holanda

PrivacyTerminiRapporto