Repository navigation
Validation kit: Collect no longer takes another command's output from the guest agent - #5
Merged
Merged
Conversation
… agent for a payload chunk The QEMU guest agent keeps a result until a status call collects it and answers a call for a process id with the oldest result it holds under that id; Windows reuses the ids. The driver's synchronous qm guest exec, retried on a timeout, left results behind, and a later chunk read given the same id got an earlier chunk back: the right length, the wrong text. That is the JSON error reported in #4. GuestAgent.ps1 now carries the guest calls for the driver and Invoke-LabGuestScript.ps1. A command is started without waiting and its result asked for by process id; every command prints a marker of its own and a result without it is passed over; a result lost to a status call that timed out makes the command run again. The device reports a SHA-256 with the payload size and the assembled payload is checked against it. The detached launch sits behind a started marker, since a second runner skips the script and writes the done marker at once.
This was referenced Oct 5, 2026
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
Fixes the validation kit's
Collectaction, which #4 reported as failing on the lab device and left open ("Not changed":ConvertFrom-Jsonstopped at probe record 5,637 of an 11 MB payload). The payload was never the problem. The QEMU guest agent returned another command's output for one of the chunk reads, and the driver had no way to notice.Only the validation kit changes. Nothing under
Public/,Private/or the shipped package is touched, andModuleVersionis not bumped.Cause
Measured on the Entra joined lab device (VM 125) on 2026-10-05:
qmp command 'guest-exec-status' failed - got timeout) has still been answered by the agent. If the command had finished, the next call saysPID does not exist: the result went with the reply nobody read.The driver ran each guest command with a synchronous
qm guest execand ran it again on a timeout. That left results behind, and a later chunk read that was given the same process id got an earlier chunk back.Changes
Validation/GuestAgent.ps1(new).Invoke-GuestPowerShellnow lives here and is dot-sourced byInvoke-ValidationRound.ps1andInvoke-LabGuestScript.ps1, which each carried their own copy.qm guest exec --synchronous 0) and its result is asked for by process id.Read-GuestPayload(new, same file). The chunked read moved out ofInvoke-Collect. The device now reports a SHA-256 with the payload size, and the assembled text is checked against it, so a damaged payload is refused with both hashes instead of surfacing as a parse error.Validation/README.mdrecords the measurements under "Timing notes" and lists the new file. Changelog entry under Unreleased.Verification
Validation/.Collectagainst VM 125: completed, 79 stale results passed over, 3 commands run again, payload hash matched, result file written with 45 remediations, 11 platform scripts and 6,118 probe records. The 79 is higher than a normal run would see, because the agent still held results planted for the test above.Invoke-LabGuestScript.ps1was run once through the shared helper and returned the script's output.Not changed
Collectstill takes about 25 minutes on this device: the payload is 18 MB, read in 179 chunks at roughly 6 seconds each. Limiting what the device script gathers would be a separate change.query userlong-name case from Harness module path under PowerShell 7, and rule fixes backed by validation round 10 #4 is still open.