mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3542] [CLOSED] [TUI] recognise interpreter readiness behind Windows venv launchers #4678
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3542
Author: @Thymos2027
Created: 10/21/2026
Status: ❌ Closed
Base:
main← Head:fix/windows-venv-ready-pid📝 Commits (1)
41e534bfix(tui): recognize Windows venv interpreter readiness📊 Changes
4 files changed (+115 additions, -2 deletions)
View changed files
📝
strata_control/runtime.py(+9 -2)📝
strata_control/winproc.py(+42 -0)📝
tests/terminal/test_runtime.py(+19 -0)➕
tests/terminal/test_winproc_parent.py(+45 -0)📄 Description
Problem and result
On Windows, the Python executable inside a venv can be a redirector.
Popen.pidthen belongs to the launcher, while the interpreter writes its own PID to the server's ready file. Both readiness checks require exact PID equality, so an already healthy model staysstartingand a managed start/update times out.This accepts the ready PID when it is either the owned process or its direct Windows child. Instance identity, launch attestation and the generation probe are still required. The runtime continues to stop its original owned process/job, not a PID taken from the ready file.
Related discussion
No matching redirector-PID issue or PR found after searching open and closed discussions for Anaconda, redirector, child.pid and virtual environment. This is a focused lifecycle bug fix; no engine default changes.
The separate Windows default-DACL problem discussed in #3428 affects one existing test below and is not changed here.
Approach
Use a Tool Help process snapshot to check the direct parent without requiring a query handle to the interpreter. Apply the same check at initial readiness and explicit verification. Snapshot failures and unrelated PIDs do not qualify. Same-PID and non-Windows behavior retain the existing path.
References: CPython venv redirectors, Microsoft process snapshots.
Validation
Tested diff committed as
41e534b3, based on9de04cd4. Windows 11 Pro 26200, Python 3.12.7 venv created by Anaconda, i7-12700, RTX 5060 Ti 16 GB, 128 GB RAM.Passed:
python -m unittest discover -s tests/terminal -p test_winproc_parent.py -v: 4/4. Includes an actual venv interpreter whose PID differs from its launcher's, invalid IDs and snapshot failure.python -m unittest discover -s tests/terminal -p test_runtime.py -k test_start_profile_revision_restart_and_stop -v: passes; the same existing test fails on unmodified base with exit code 8 at start.python -m unittest discover -s tests/terminal -p test_updater.py -k test_update_downloads_verifies_test_starts_then_switches -v: passes.test_runtime.py: 38 pass, 2 platform skips, 1 existing failure detailed below. The new unrelated-PID test, changed-config attestation rejection, zero-token rejection and lifecycle/restart checks pass.git diff --check.Failed:
python -m unittest discover -s tests/terminal -p test_runtime.py -v: 41 run, one failure intest_liveness_check_does_not_end_the_process_it_asks_about(_pid_existsremains true after killing the victim), two skips.9de04cd4afterprivate_files.adopt_user_defaults(), as CLI entry does. It passes in isolation before that default-DACL change. This is reported separately from the fixed readiness timeout; the suite is not claimed green.Not run:
Limits
Only a direct Windows launcher child qualifies; arbitrary descendant trees do not. No file ACLs, process priorities, model data, sampling, cache sizes or engine defaults are changed. The Windows default-DACL failure remains. Draft for review of the ownership check and additional platform coverage.
Follow-up: separate DACL failure verified (2026-10-21)
On an isolated local validation branch, cherry-picked #3428 commit
14b1d8f095042559f15ad0ae6dd882c4a0a3cc8don top of this PR's41e534b3(combined local commit44b16b88). This PR's branch is unchanged; #3428 is not included here.Using the same Windows 11 / Python 3.12.7 venv, explicitly called
private_files.adopt_user_defaults()before discovering and runningtest_runtime.py: 41 tests, 39 passed, 2 platform skips, zero failures, 242.332 seconds. The previously failing liveness test also passed in isolation with those token defaults applied.test_private_files.py: 13 passed, 1 platform skip;test_winproc_parent.py: 4 passed.These results support #3428 as the fix for the separate default-DACL failure. They validate the combined local revision, not an all-green claim for this PR alone. The earlier failed result above remains the result for this PR without #3428. A clean next step is to sync and retest this branch after #3428 lands. At this check, the three workflows attached to this PR's head report
action_required; no successful CI result is claimed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.