Commit Graph

3 Commits

Author SHA1 Message Date
teknium1
8860e1d78b fix(desktop): only Electron's singleton socket gets the short TMPDIR
The launcher replaced TMPDIR with /tmp for the whole Electron process tree, so
the Python backend inherited TMPDIR=/tmp while TMP/TEMP/HERMES_SCRATCH_DIR
still named the scratch dir; apply_scratch_tmp_env then treated /tmp as
user-set and the agent subtree wrote temp files to /tmp.

The launcher now passes the original in HERMES_DESKTOP_TMPDIR and Electron main
restores it right after requestSingleInstanceLock(), so every child gets the
profile scratch dir back.

The override threshold is Chromium's real budget instead of the shared 50-byte
socket constant: sun_path holds 107 bytes and Chromium appends
/scoped_dirXXXXXX/SingletonSocket (33 bytes, measured on Electron 40), so a
TMPDIR up to 74 bytes is kept.
2026-09-27 11:44:31 -07:00
teknium1
455ecbdc39 test(desktop): pin the Electron temp-root invariant without mocking launch options
Two invariants, red on base: a long scratch TMPDIR still leaves room for
Chromium's SingletonSocket, and a short caller TMPDIR passes through. The
salvaged tests stubbed _desktop_launch_options with a 4-tuple that main
has since grown to 5; the Windows no-op case is dropped.
2026-09-27 11:44:31 -07:00
funky-xamarin
4a4450c79c fix(desktop): give Linux Electron a socket-safe temp root 2026-09-27 11:44:31 -07:00