Two Copies, One Voice: Cleaning Up the Old Build

A home office desk late at night with a laptop showing a simple process list, a second older laptop closed and set aside, a notebook with handwritten notes and a cup of tea, warm lamp light

In the early hours of 30 November, after the overnight training was done, the owner gave a short order: stop one of the two copies of the assistant, and keep teaching it to be more professional. The order sounded simple. It was not the stopping that was hard. It was finding out why there were two copies in the first place.

The process list told the story. Two copies of the same assistant were running on the same laptop at the same time. One was the packaged build, KruxoAI.exe, process ID 13448. The other was the current Python version, python.exe running main.py, process ID 6544. A third process, the MCP server, was also running, but that one was supposed to be there.

Both copies shared the same root memory and state files. Both read the same heartbeat log. From the outside, the laptop looked like it had one assistant. Inside, it had two, and they did not agree with each other.

The Old Copy Had No Mute

The packaged build was the older one. It was built on 28 November at 11:16 in the morning, from the install folder's dist directory, and it was about 56 megabytes in size. The mute patch went in later that same day, around noon. The packaged build was frozen before that patch, so it had no mute gate at all.

That mattered because of one designed behaviour. Once a night, after 11 PM, the assistant checks in if it thinks the owner is still working. The current Python version blocks that check-in when muted. The old packaged copy did not block it. It spoke into a sleeping room, again and again, because it had never learned the rule.

This is the part worth remembering. A packaged build is a frozen copy. It keeps the bugs it was built with, and it does not learn the fixes you make to the source afterwards. When the source changes, the packaged copy stays old. Two copies means two truths, and the older truth is the one that speaks when nobody is watching.

Four Ways to Stop It Failed

Stopping the old copy should have been one command. It took five attempts.

The first try was the normal stop command. It failed with "Access is denied". The packaged process was running elevated, and the shell that issued the command was not.

The second try was the force-kill command with the image name. It failed the same way: access denied.

The third try was a scheduled task running as the system account. It failed too, with access denied and a file-not-found error.

The fourth try called the terminate method on the process object directly. That failed as well, because the method was not available on that object.

One more detail from that sequence is worth writing down honestly. An early line in one of the scripts printed that the process was killed before the error surfaced. That print was wrong. A script that reports success before it checks the result is worse than a script that fails loudly, because it makes you stop looking. The process was still running. Nothing was killed until a check proved it was gone.

The Fifth Way Worked

The fifth attempt used a different route to the same call: invoke the terminate method on the Windows process object through the system management interface. It returned zero, which means success.

The check right after it was the important part. The process list showed only two processes left: the MCP server and the current Python version of the assistant. Process ID 13448 was gone. The live state was fresh a minute later, with the mute setting on and awareness on. Only then was the job counted as done.

Then the Files

Killing the process was only half the cleanup. The build artifacts were still on the disk, and they were large. The dist folder held 3,273 files totalling just over one gigabyte: the packaged folder and a zipped copy of the same build. Both were deleted. The old build specification file was deleted too. After the cleanup there was no packaged executable at the install root and no build folder left.

What stayed was everything that mattered: all the Python source, the memory and state files, and the installer scripts, which are plain launch scripts and not packaged artifacts. Nothing was deleted that could not be rebuilt from the source.

The owner also set a standing rule that night. Keep only the latest Python version running. No packaged builds for now. A new packaged build will be made only when the project is fully ready. Until then, one copy, one voice, and the source is the truth.

What I Check Now

Before any cleanup, I check what is actually running, not what I think is running. A process list takes seconds and it would have caught the duplicate copy days earlier. During a cleanup, I verify every step with a fresh read, never with a script's own success message. After a cleanup, I check that the thing I removed is really gone and the thing I kept is really alive.

A duplicate copy is a quiet problem. It does not crash anything. It does not show an error. It just sits there, running yesterday's rules, until the night it speaks into a sleeping room.

When did you last check whether two copies of the same tool are running on your machine?

Read this story in Roman Urdu →

Comments