Skip to content

loopguard: ignore dry-run, compile-only, and list commands across test runners - #311

Open
Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/loopguard-dry-run-and-list-not-a-test-run
Open

Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/loopguard-dry-run-and-list-not-a-test-run

Conversation

@PStarH

Copy link
Copy Markdown

Summary

A test runner asked only to list tests, print configuration, or compile/dry-run does not execute any tests and should not count as a verification run:

  • cargo test --no-run (compiles test binaries without execution);
  • go test -list <pattern> (lists tests matching pattern);
  • ctest --show-only (shows available CTest targets without running);
  • jest --showConfig / vitest --show-config (dumps test configuration);
  • playwright test --dry-run (dry-run without running test specs).

Previously, because _NOT_A_RUN_RE only matched --help, --version, --collect-only, --co, and --list\S*, commands like cargo test --no-run or go test -list returned status_of_tests(...) -> "own". When an agent ran one of these commands after a failing test run, the 0 exit code caused resolved_proxy() to falsely mark the failing turn as "ended green", feeding false resolutions into the envelope tracker.

Changes

  • Updated _NOT_A_RUN_RE in tokeneconomizer/loopguard/turn.py to match (?i)\s(?:-h|--help|--version|--collect-only|--co|-{1,2}list\S*|--no-run|--dry-run|--show-only\S*|--show-?config)(?!\S).
  • Added unit tests in tests/test_loopguard_dry_run_and_list.py verifying status and ensuring failed turns are not falsely turned green.

Verification

  • pytest tests/test_loopguard_dry_run_and_list.py tests/test_loopguard*.py passed (136 passed in 2.83s).
  • pytest tests/test_live_core.py passed (316 passed in 8.32s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant