fix(update): stop truncating venv blocker cmdline before gateway exemption - #78094
Closed
szzhoujiarui wants to merge 2 commits into
Closed
fix(update): stop truncating venv blocker cmdline before gateway exemption#78094szzhoujiarui wants to merge 2 commits into
szzhoujiarui wants to merge 2 commits into
Conversation
…ption _detect_venv_python_processes() truncated every cmdline to 120 chars before storing it in the match tuple. The pausable-gateway exemption in _scan_venv_blockers then operated on that already-truncated string. For desktop-runtime gateways whose full cmdline exceeds 120 chars, the trailing "gateway run" tokens were cut off and looks_like_gateway_command_line() returned False, causing the Desktop UI preflight to abort with "venv-blocked" before the CLI updater got to pause the gateway. Move the 120-char truncation from the match tuple to the display helper _format_venv_python_holders_message(), so downstream exemption checks see the complete command line. _leftover_pausable_gateway_pids already re-reads full argv via psutil, so this change makes the exemption path consistent with the post-pause guard. Fixes NousResearch#78089
Contributor
Author
|
Follow-up pushed in
Local verification:
Related implementations for maintainer visibility: #78095, #78188, and #79195. This PR was opened first and now covers the same long-command-line regression with explicit output-boundary tests. #77772 addresses the complementary Electron-owned backend-child path, while this PR covers external gateway command lines seen by the venv blocker scan. |
Contributor
Author
|
Closing as implemented on current main by 0b33ee8. That commit preserves the full venv-holder command line for gateway classification, truncates only at display/JSON boundaries, and adds the managed-runtime long-path regression coverage that this PR targeted. Thanks for carrying the fix forward. |
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.
Summary
_detect_venv_python_processes()truncated every cmdline to 120 chars before storing it in the match tuple. The pausable-gateway exemption in_scan_venv_blockersthen operated on that already-truncated string. For desktop-runtime gateways whose full cmdline exceeds 120 chars (e.g. 186 chars on the reporter's machine), the trailinggateway runtokens were cut off andlooks_like_gateway_command_line()returnedFalse— so the Desktop UI preflight aborted with "venv-blocked" before the CLI updater got to pause the gateway.Root cause
_detect_venv_python_processes()atupdate_cmd.py:2914storedcmdline_raw[:120]in the match tuple._scan_venv_blockers.py:150then applied_is_pausable_gateway()to that truncated string, defeating the exemption added by #75881.Fix
Move the 120-char truncation from the match tuple to the display helper
_format_venv_python_holders_message(), so:_scan_venv_blockers_is_pausable_gateway()sees the full cmdline — exemption works_leftover_pausable_gateway_pids()sees the full cmdline as fallback (it already re-reads via psutil, now consistent)Related
hermes gateway runprocess #74783 — original three-layer gateway/update coordination issues