Found by a six-lens audit of the desktop app on 27 Aug 2026. Every finding was reproduced against the code, not inferred.
Severity: medium · audit rank 13 of 16.
Breaks: a user with PYTHONHOME or PYTHONPATH exported (conda, distro tooling, a systemd user session) gets the engine running against the wrong stdlib or a foreign site-packages, and the module written to prevent exactly that never runs. Six tests cover it and every caller is a test.
Who / likelihood: anyone whose shell exports those — common enough among the users likely to fine-tune. Failure looks like an engine that will not start, or worse, one that starts against another environment's praisonaiagents.
Where: src-tauri/src/venv_resolve.rs:43,120; callers only in its own mod tests and tests/real_venvs.rs:64. supervisor::start (supervisor.rs:109-129) sets PYTHONUTF8 and PYTHONIOENCODING and nothing else.
--- a/src-tauri/src/supervisor.rs
+++ b/src-tauri/src/supervisor.rs
@@ -105,7 +105,12 @@
-pub fn start(python: &str, script: &str, timeout: Duration) -> Result<Engine, StartError> {
+pub fn start(python: &str, script: &str, timeout: Duration,
+ env: &BTreeMap<String, String>) -> Result<Engine, StartError> {
let mut command = Command::new(python);
command
.arg("-u")
.arg(script)
+ // The resolved environment, not the inherited one: PYTHONHOME and
+ // PYTHONPATH point the engine at another interpreter's stdlib.
+ .env_clear()
+ .envs(env)
.env("PYTHONUTF8", "1")
and at main.rs:305, reusing the VenvLayout already resolved at :266:
- match supervisor::start(
+ let inherited: BTreeMap<String, String> = std::env::vars().collect();
+ let spawn = venv_root_for_python(&python, &RealFs, Platform::current())
+ .map(|l| venv_resolve::spawn_env(&l, &inherited, Platform::current()))
+ .unwrap_or(inherited);
+ match supervisor::start(
Test — src-tauri/tests/real_venvs.rs (it already builds real venvs): spawn the engine through supervisor::start with PYTHONHOME=/nonexistent in the inherited map, and assert the engine announces its port — i.e. it started anyway. Fails today (the poisoned var is inherited).
Not yet fixed. Filed so it is not lost with the session that found it. The fix and the test above are proposals from the audit — worth re-checking against current main before implementing, since the file has moved since.
Breaks: a user with
PYTHONHOMEorPYTHONPATHexported (conda, distro tooling, a systemd user session) gets the engine running against the wrong stdlib or a foreign site-packages, and the module written to prevent exactly that never runs. Six tests cover it and every caller is a test.Who / likelihood: anyone whose shell exports those — common enough among the users likely to fine-tune. Failure looks like an engine that will not start, or worse, one that starts against another environment's
praisonaiagents.Where:
src-tauri/src/venv_resolve.rs:43,120; callers only in its ownmod testsandtests/real_venvs.rs:64.supervisor::start(supervisor.rs:109-129) setsPYTHONUTF8andPYTHONIOENCODINGand nothing else.and at
main.rs:305, reusing theVenvLayoutalready resolved at:266:Test —
src-tauri/tests/real_venvs.rs(it already builds real venvs): spawn the engine throughsupervisor::startwithPYTHONHOME=/nonexistentin the inherited map, and assert the engine announces its port — i.e. it started anyway. Fails today (the poisoned var is inherited).Not yet fixed. Filed so it is not lost with the session that found it. The fix and the test above are proposals from the audit — worth re-checking against current
mainbefore implementing, since the file has moved since.