[code-improvement] code-quality: reject invalid exec response timeouts - #172
Merged
Pedro Henrique Penna (ppenna) merged 4 commits intoSep 22, 2026
Conversation
Validate the host response timeout before sending a managed guest exec request, preventing invalid timeout values from launching work before failing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Pedro Henrique Penna (ppenna)
September 21, 2026 22:51
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Positive infinity remains accepted, allowing a request to be sent with no finite response deadline.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds early validation for managed exec response timeouts to prevent transmitting requests with invalid deadlines.
Changes:
- Rejects zero, negative, and NaN response timeouts.
- Tests that rejected calls transmit no bytes.
| File | Description |
|---|---|
scripts/nvx_tools/control_session.py |
Adds pre-send timeout validation. |
scripts/test_control_session.py |
Covers invalid timeout rejection and socket behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Pedro Henrique Penna (ppenna)
September 21, 2026 23:15
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The positive-infinity rejection introduced by the guard lacks regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (1)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Pedro Henrique Penna (ppenna)
September 21, 2026 23:18
View session
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
September 21, 2026 23:26
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Pedro Henrique Penna (ppenna)
September 22, 2026 00:18
View session
Pedro Henrique Penna (ppenna)
deleted the
code-improvement/control-session-timeout-35663903111-57fffca35f92f2f8
branch
September 22, 2026 00:53
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.


Scope
Named improvement category: code-quality.
ControlSession.execpreviously accepted zero, negative, and NaN response timeouts until after it had sent the managed exec request. Invalid host input could therefore launch a guest workload and only then fail while waiting for its response. The guard now rejects those values before generating or transmitting the request, and the regression test verifies that the peer receives no bytes.The prepared baseline was green, and live
devhad no completed CI run for its current HEAD, so no failing-check scope applied. Category weighting selectedcode-quality(weight 5). Searches of open issues, active pull requests, and prior code-improvement outcomes found no matching timeout change or rejected proposal. A separate release-metadata candidate was discarded because it overlapped active PR #124.Patch
scripts/nvx_tools/control_session.py: validate the managed exec response timeout before sending.scripts/test_control_session.py: cover zero, negative, and NaN values and assert no request bytes are sent.Size: 2 files, 23 added plus deleted lines (23 additions, 0 deletions).
Validation
All commands passed:
python3 -m unittest scripts/test_control_session.py -v(4 tests)python3 -m compileall -q scriptspython3 -m unittest scripts/test_performance.py scripts/test_nvx_tools.py scripts/test_microvm_tests.py scripts/test_development_release.py -vpython3 -m ruff check scriptspython3 -m pyright --pythonplatform Linuxpython3 -m pyright --pythonplatform Windowspython3 -m ruff format --check scriptspython3 .github/skills/nvx-host-connect/scripts/test_hosts.py -vpython3 scripts/nvx.py --helppython3 scripts/nvx.py test-openvmm-unit --helppython3 scripts/nvx.py test-openvmm --helppython3 scripts/nvx.py test-microvm --helppython3 scripts/nvx.py benchmark --helpgit diff --checkNo dependency, public API, CLI, ABI, package-format, gitlink, or OpenVMM change was made.