Skip to content

fix(init): treat no-op edits as passthrough instead of throwing#731

Merged
betegon merged 1 commit intomainfrom
fix/noop-edit-passthrough
Apr 13, 2026
Merged

fix(init): treat no-op edits as passthrough instead of throwing#731
betegon merged 1 commit intomainfrom
fix/noop-edit-passthrough

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented Apr 13, 2026

Summary

When the AI agent generates an edit where oldString === newString, return the content unchanged instead of throwing. The agent sometimes produces redundant no-op edits (e.g., package.json already has the right content), and crashing on those triggered 4 retries followed by "Codemod recovery produced no modifications."

This is a deliberate deviation from opencode's replace() which throws on identical strings — their context is interactive editing where it's a user mistake. In our agent context, no-op edits are benign.

Test plan

  • Updated test: expects passthrough instead of throw
  • All 15 replacer tests pass

Made with Cursor

When the AI agent generates an edit where oldString equals newString,
return the content unchanged instead of throwing. The agent sometimes
produces redundant no-op edits (e.g., package.json already has the
right content), and crashing on those triggered 4 retries followed by
"Codemod recovery produced no modifications."

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721

Bug Fixes 🐛

Init

  • Treat no-op edits as passthrough instead of throwing by betegon in #731
  • Remove JSON minification that breaks edit-based codemods by betegon in #719

Upgrade

  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (issue) Support share issue URLs by BYK in #718
  • (issue-list) Auto-correct AND and reject OR in --query to prevent 400 by BYK in #727
  • (resolve) Fuzzy auto-recovery for project slug resolution by BYK in #728
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-731/

Built to branch gh-pages at 2026-04-13 15:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1652 uncovered lines.
✅ Project coverage is 95.19%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.19%    95.19%        —%
==========================================
  Files          234       234         —
  Lines        34349     34347        -2
  Branches         0         0         —
==========================================
+ Hits         32697     32695        -2
- Misses        1652      1652         —
- Partials         0         0         —

Generated by Codecov Action

@betegon betegon marked this pull request as ready for review April 13, 2026 15:45
@betegon betegon merged commit 21a4c06 into main Apr 13, 2026
24 checks passed
@betegon betegon deleted the fix/noop-edit-passthrough branch April 13, 2026 16:08
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