Repository navigation
refactor(windows): replace wallpaper helper with isolated Python runtime - #269
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and resulting behavior
Replace the self-contained .NET Windows wallpaper helper with an independent, standard-library Python helper shipped with Electron. All helper entry points use
-I -Swith the backend runtime selected bypythonRuntime.ts; the selected environment's site initialization and.pthhooks do not execute. Windows sessions preferpythonw.exebeside the selectedpython.exeto avoid a detached venv interpreter allocating a console. Remove the replaced C# projects, runtime-only notices and .NET build/CI prerequisites.Electron retains lifecycle/status ownership. Existing PascalCase journals, string phases, exact .NET UTC creation ticks and Settings field bytes remain compatible. Only Settings fields 28/48/49 are rewritten. The actual Set pipe receiver is persisted before any request bytes. Known Lively reporting/close limitations in #233 remain.
Refs #264; based after merged #261.
Review fixes
Current follow-up commit:
482f2365.-I -Sin Electron, setup, smoke and lifecycle helper invocations. Source/packaged resource tests use a controlled temporary-venv.pthhook, including a positive control proving that-Ialone executes it.detached: truewhile keeping pipes and normal shutdown waiting. Actual Electron parent tests exercise a Windows venv launcher and the real helper main/Session/journal lock with a synthetic desktop. A non-detached control reproduces interrupted recovery; the fixed launch restores aftertaskkill /Fwithout/Tand removes the journal. Normal shutdown passes too.windowsHide. Reproduced before production repair by addingGetConsoleWindow() == NULLto the real Electron fixture. Sessions now use the same-directorypythonw.exewhen present; setup keeps the original interpreter. All three parent modes verify no associated console, usable standard pipes, isolated mode and absent site initialization. Source and packaged tests verify the windowed runtime path and mounted/stdin/exit round trip.The independent agent reviewed N1 without edits and independently passed 25 Electron isolation/lifecycle/parent-exit cases. It also verified actual
pythonw.exestderr failure propagation and missing-sibling/custom-name selection, finding no actionable defect. The earlier F1/F2/F3 review independently passed 95 helper tests. These are advisory reviews, not GitHub approval.The earlier “actual parent death” claim tested a Python parent, which does not cover Electron/libuv's kill-on-parent-exit Job. Documentation and evidence now distinguish those scenarios. Detachment does not guarantee survival after explicit tree termination, logoff or power loss.
Validation
Current follow-up:
482f2365: 4,288 selected files, 161 excluded, 0 errors/warnings; code-only source archive created.Historical full Python coverage at initial candidate
f7408163: 503 files, 6,703 passed, 19 skipped, 5 expected failures. This was a split/resumed run; only the stalled 55-case profile-contract file usedUV_OFFLINE=1, retaining assertions and--locked. It is not a fresh full-Python run at the current head. The previous head78b48a9ccompleted all 16 hosted checks successfully; new-head CI is evaluated separately. That head also passed installed-Lively normal exit, pipe loss, helper-crash recovery, Python-parent death and fresh-settings cold start.Helper resources excluding the common setup script: 74,922,671 → 58,761 bytes. Ten alternating read-only samples at
78b48a9cmeasured local medians of 239.5 ms (-I) and 218 ms (-I -S). These measurements do not attribute the initial .NET-to-Python timing difference entirely to site initialization.Commands, review repairs, evidence and limitations.
Draft / remaining qualification