fix: audit benchmark device sessions per command - #457
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.
Description
The benchmark rejects
sleep 5; env AGENT_DEVICE_STATE_DIR=... AGENT_DEVICE_SESSION=... agent-device snapshoteven when the session is correct, because it checks the whole shell command's prefix. Conversely, a scoped first invocation can hide a later default-session invocation.Solution
Check each segment with the existing quote-aware shell parser. Every agent-device invocation still needs the exact run-scoped environment, daemon recovery remains invalid, and final screenshot/recording proof commands must still stand alone. This changes only the benchmark collector, not the published CLI or timed prompts.
Test plan
Regression coverage accepts delayed scoped navigation and quoted separators, and rejects bare/mismatched invocations anywhere in a chain plus delayed daemon recovery. The existing standalone-proof self-test passes. Re-collecting the retained affected run clears the false positive with identical evidence hashes and timing; its original audit is preserved.
Fixes #456.