Repository navigation
fix(agent): suppress stale mutation verifier warnings - #65584
aftership-bot-vlt-platform wants to merge 1 commit into
Conversation
Related: #53165 addresses the same stale mutation-verifier warning with backend-aware content fingerprints. This PR uses a smaller local stat-fingerprint approach; maintainers should choose the desired verifier semantics. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the stale-verifier case and adding local/remote regression coverage. The current-main premise is valid: run_agent.py:2910-2916 tracks only write_file/patch, while agent/turn_finalizer.py:304-310 renders any remaining failure, so a later terminal recovery cannot currently clear the warning.
Problems
run_agent.py:2926fingerprintsst_modeandst_ctime_ns. A metadata-only operation such aschmodchanges those fields without changing content, yetrun_agent.py:2994-2998would clear the warning. The footer's assertion that the requested mutation did not land can therefore be hidden by an unrelated metadata change.- The linked #53165 records the stronger recovery contract: backend-aware content identity plus a successful foreground fallback. This PR instead treats any observable local change as recovery; the member comment on this PR explicitly asks maintainers to choose the semantics.
Suggested changes
- Add a metadata-only regression (
chmod/chown) and retain the footer unless contents changed. - Align the chosen implementation with an explicit recovery contract; if fallback causality is required, capture the resolved backend target and compare it around the successful foreground fallback.
Automated hermes-sweeper review.
| # message shouldn't silently overwrite the original. Still | ||
| # refresh the filesystem fingerprint so a later unrelated | ||
| # external edit cannot hide the most recent failed attempt. | ||
| fingerprint = self._get_local_file_mutation_fingerprint(path) |
There was a problem hiding this comment.
This fingerprint includes st_mode and st_ctime_ns, so a metadata-only chmod/chown after a failed patch changes the fingerprint and clears the footer even though file contents were not recovered. Please require a content change (and add a metadata-only regression) before suppressing the warning.
Summary
Reproduction
A protected
patchto~/.hermes/config.yamlcan fail, followed by a successfulhermes config setcommand. The config is modified, but the verifier previously still claimed the file was not changed because it only observed file-tool success.Verification
uv run --extra dev pytest tests/run_agent/test_file_mutation_verifier.py -q -o "addopts="— 44 passeduv run --extra dev ruff check run_agent.py agent/turn_finalizer.py tests/run_agent/test_file_mutation_verifier.py— passedgit diff --check— passedRisk
Stat-based comparison intentionally avoids hashing large files. Remote backends fail closed and retain the warning.