Skip to content

fix(patch): report no-op edits clearly - #25564

Open
Cdo87 wants to merge 1 commit into
NousResearch:mainfrom
Cdo87:fix/patch-noop-report
Open

fix(patch): report no-op edits clearly#25564
Cdo87 wants to merge 1 commit into
NousResearch:mainfrom
Cdo87:fix/patch-noop-report

Conversation

@Cdo87

@Cdo87 Cdo87 commented May 14, 2026

Copy link
Copy Markdown

Summary

  • add explicit PatchResult noop/message fields
  • report identical replace-mode edits as successful no-ops without writing
  • treat V4A pure-context/no-effective-change updates as successful no-ops with guidance

Tests

  • pytest -q tests/tools/test_patch_parser.py tests/tools/test_file_operations.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/file File tools (read, write, patch, search) labels May 14, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the patch-tool behavior; the underlying premise is still present on current main (tools/fuzzy_match.py:69-70, reached by tools/file_operations.py:1578-1589).

Problems

  • The no-op state does not survive the actual tool boundary. tools/file_tools.py:1848-1868 serializes the result, then every non-error result gets files_modified overwritten and is recorded as a write. With this PR, a no-op would therefore report noop: true while also claiming the target was modified.

Suggested changes

  • Gate the successful-patch bookkeeping in tools/file_tools.py on not result_dict.get("noop"), preserving the no-op's empty modification result and avoiding stale/write-state updates.
  • Add a regression test through patch_tool, not only ShellFileOperations / apply_v4a_operations.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/file File tools (read, write, patch, search) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants