A small automation page has a button that starts a local chat UI. Pressing it produced a traceback instead of a server. Fixing the first error exposed a second one, and the second one had nothing to do with the chat UI at all.
Two errors in sequence
The first failure was TypeError: type 'Choice' is not subscriptable. It appeared in both virtual environments that had the UI installed. A command-line library at version 0.25 had started using a generic form of a type that the 8.x line of its dependency did not support. Pinning the pair back to 0.15.4 and 8.1.8 cleared it. That was an ordinary version mismatch.
The second failure was ModuleNotFoundError: pydantic_core._pydantic_core, a compiled module that was definitely installed in the environment being launched. The environment ran Python 3.11. The automation API that handled the button set PYTHONPATH to a Python 3.9 user site-packages directory for every child process it spawned, not just the ones that needed it. The 3.11 interpreter found the 3.9 build of the compiled package first, and the import failed on the binary.
The fix in the start script was one line: unset PYTHONPATH before activating the environment. After that the UI booted, loaded its existing database with accounts and chat history, and answered on its port.
Where the responsibility belongs
The one-line fix lives in the script that was called, which means every other script launched from the same page inherits the same poisoned path and has to defend itself the same way. The alternative is to fix the caller so it only injects the path for the Python triggers that need it. That decision was recorded as open and had not been made by the end of the day.
The audit also turned up a second copy of the environment, 2.3GB, with no data in it and a broken dependency pair. Nobody could say why it existed. It was removed eight days later when the whole setup moved to an external drive and a container, which also changed the port the page was still displaying. Whether any other trigger on that page had been quietly failing for the same reason was not checked.