ErikBjare / gptme

Your agent in your terminal, equipped with local tools: writes code, uses the terminal, browses the web, vision.
https://gptme.org/docs/
MIT License
2.64k stars 178 forks source link

fix: support line removal in patch tool #267

Closed ErikBjare closed 7 hours ago

ErikBjare commented 7 hours ago

The patch tool now properly handles empty content between ======= and >>>>>>> UPDATED, allowing for line removal in patches.

This is done by:


[!IMPORTANT] Enhances patch tool to support line removal by handling empty content between ======= and >>>>>>> UPDATED in patch.py.

  • Behavior:
    • Supports line removal in patches by handling empty content between ======= and >>>>>>> UPDATED in patch.py.
    • Special case handling when UPDATED marker follows immediately after DIVIDER.
  • Functions:
    • Modifies _from_codeblock() in Patch class to split patch content in multiple steps and handle empty content cases.

This description was created by Ellipsis for bc7891d7003fa157c280b58eed73d3a41bd474d0. It will automatically update as commits are pushed.

codecov-commenter commented 7 hours ago

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.65%. Comparing base (2ade667) to head (bc7891d). Report is 2 commits behind head on master.

:white_check_mark: All tests successful. No failed tests found.

Files with missing lines Patch % Lines
gptme/tools/patch.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #267 +/- ## ========================================== - Coverage 72.66% 72.65% -0.01% ========================================== Files 64 64 Lines 4298 4301 +3 ========================================== + Hits 3123 3125 +2 - Misses 1175 1176 +1 ``` | [Flag](https://app.codecov.io/gh/ErikBjare/gptme/pull/267/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Erik+Bj%C3%A4reholt) | Coverage Δ | | |---|---|---| | [anthropic/claude-3-haiku-20240307](https://app.codecov.io/gh/ErikBjare/gptme/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Erik+Bj%C3%A4reholt) | `71.37% <80.00%> (+0.01%)` | :arrow_up: | | [openai/gpt-4o-mini](https://app.codecov.io/gh/ErikBjare/gptme/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Erik+Bj%C3%A4reholt) | `71.26% <80.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Erik+Bj%C3%A4reholt#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: