gpt-engineer-org/gpt-engineer

Git diff generation marking valid diffs as invalid

vgvishesh opened this issue · 4 comments

Policy and info

  • Maintainers will close issues that have been stale for 14 days if they contain relevant answers.
  • Adding the label "sweep" will automatically turn the issue into a coded pull request. Works best for mechanical tasks. More info/syntax at: https://docs.sweep.dev/

Expected Behavior

The generated diff hunk should not be marked as invalid hunk. This is happening after taking the pull of last fix for git diff #1027

Please describe the behavior you are expecting.

Current Behavior

input file:

import "./App.css";
import CoffeeList from "./components/interface/CoffeeList";

function App() {
  return (
    <div className="p-4"><CoffeeList /></div>
  );
}

export default App;

generated diff block:

--- src/App.tsx
+++ src/App.tsx
@@ -1,3 +1,5 @@
+import { BrowserRouter, Route, Routes } from 'react-router-dom';
 import "./App.css";
 import CoffeeList from "./components/interface/CoffeeList";
+import CheckoutPage from './components/interface/CheckoutPage';

This is a valid diff, but still the algorithm marks it as a faulty one, in function find_start_line() here:
problems.append(f"In {self.hunk_to_string()}:The starting line of the diff {self.hunk_to_string()} does not exist in the code")

Failure Information

The algorithm marks the above generated diff as invalid and generates the below problem description:

['In @@ -0,3 +1,6 @@
+import { BrowserRouter, Route, Routes } from \'react-router-dom\';
 import "./App.css";
 import CoffeeList from "./components/interface/CoffeeList";
+import CheckoutPage from \'./components/interface/CheckoutPage\';
 
:The starting line of the diff @@ -0,3 +1,6 @@
+import { BrowserRouter, Route, Routes } from \'react-router-dom\';
 import "./App.css";
 import CoffeeList from "./components/interface/CoffeeList";
+import CheckoutPage from \'./components/interface/CheckoutPage\';
 
 does not exist in the code']

Steps to Reproduce

use the input file and the git diff block provided here, issue will be reproduced.

Hi @vgvishesh ,

Thank you for reporting the issue. We've recently enhanced our project with a new logging feature to better capture bug reports. It would be great if you could pull the latest changes from the main branch and try again. This should provide us with the detailed logs we need to address the issue more effectively.

Looking forward to your feedback, and thanks again for helping us improve.

@vgvishesh, did you get the chance to look into this, maybe? We now have a logging feature implemented, so we'd love to hear back from you.

Sure @viborc @similato87
I have not yet pulled the latest changes. Let me try to run the system with the logging feature. Will update you soon!

Hey, that's great! Thanks for the update so I don't close this issue,