Code Monkey home page Code Monkey logo

Comments (9)

ATheorell avatar ATheorell commented on August 16, 2024 2

Thanks for moving this from PR to issue @vgvishesh and providing the source file. Would be great if you could look into this @similato87 .

@ilutoo when did you have this problem? The improve workflow was changed completely only a few days ago, so you can expect it to work differently (but apparently not flawlessly yet).

from gpt-engineer.

vgvishesh avatar vgvishesh commented on August 16, 2024 1

This is the only problem I found yet.

from gpt-engineer.

vgvishesh avatar vgvishesh commented on August 16, 2024 1

Was testing the improvement flow, and found another problem:
input file:

import React from 'react';

export const SocialLinks: React.FC = () => {
  const profiles = {
    linkedIn: 'https://www.linkedin.com/in/guptavishesh/',
    github: 'https://github.com/vgvishesh',
    whatsapp: 'https://wa.me/1234567890',
    twitter: 'https://twitter.com/__visheshgupta',
  };

  return (
    <div className="social-links">

generated diff block:

--- src/components/SocialLinks.tsx
+++ src/components/SocialLinks.tsx
@@ -1,10 +1,11 @@
 import React from 'react';
 
+export const profiles = {
-  const profiles = {
     linkedIn: 'https://www.linkedin.com/in/guptavishesh/',
     github: 'https://github.com/vgvishesh',
     whatsapp: 'https://wa.me/1234567890',
     twitter: 'https://twitter.com/__visheshgupta',
-  };
+};
 
 export const SocialLinks: React.FC = () => {

output file:

import React from 'react';

export const profiles = {
export const SocialLinks: React.FC = () => {
   linkedIn: 'https://www.linkedin.com/in/guptavishesh/',
   github: 'https://github.com/vgvishesh',
   whatsapp: 'https://wa.me/1234567890',
   twitter: 'https://twitter.com/__visheshgupta',
};

 return (
   <div className="social-links">
       <h2 className="text-xl font-semibold mb-3">My Social Links</h2>
       <ul className="list-none">
       {Object.entries(profiles).map(([key, value]) => (
         <li key={key}>
             <a href={value} target="_blank" rel="noopener noreferrer" className="text-blue-500 hover:text-blue-600 social-link">
             {key.charAt(0).toUpperCase() + key.slice(1)}
           </a>
         </li>
       ))}
     </ul>
   </div>
 );
};

Expected:

import React from 'react';

export const profiles = {
  linkedIn: 'https://www.linkedin.com/in/guptavishesh/',
  github: 'https://github.com/vgvishesh',
  whatsapp: 'https://wa.me/1234567890',
  twitter: 'https://twitter.com/__visheshgupta',
};

export const SocialLinks: React.FC = () => {

  return (
    <div className="social-links">
      <h2 className="text-xl font-semibold mb-3">My Social Links</h2>
      <ul className="list-none">
        {Object.entries(profiles).map(([key, value]) => (
          <li key={key}>
            <a href={value} target="_blank" rel="noopener noreferrer" className="text-blue-500 hover:text-blue-600 social-link">
              {key.charAt(0).toUpperCase() + key.slice(1)}
            </a>
          </li>
        ))}
      </ul>
    </div>
  );
};

Ideally, this one should have been caught as a problem in the diff.validate_and_correct() as the generated diff is not in the correct order with respect to the source code file.

from gpt-engineer.

similato87 avatar similato87 commented on August 16, 2024 1

@vgvishesh You're right. The validation and correction mechanism did not effectively manage the error diffs. Ideally, GPT-Engineer should have discarded such problematic sections. We will revise the logic to address this issue. Thank you for your feedback, which is invaluable in enhancing the system's reliability.

from gpt-engineer.

vgvishesh avatar vgvishesh commented on August 16, 2024

On debugging looks like this part of the code is causing the issue:

for file_name, diff in diffs.items():

From ln 319-328. On replacing this snippet with below code, it works fine:

for file_name, diff in diffs.items():
        # if diff is a new file, validation and correction is unnecessary
        # if diff.is_new_file():
        #     files_dict = apply_diffs(diffs, files_dict)
        # else:
        if not diff.is_new_file():
            problems = diff.validate_and_correct(
                file_to_lines_dict(files_dict[diff.filename_pre])
            )
            error_message.extend(problems)
    files_dict = apply_diffs(diffs, files_dict)

from gpt-engineer.

vgvishesh avatar vgvishesh commented on August 16, 2024

Is anyone also facing the same issue?

from gpt-engineer.

ilutoo avatar ilutoo commented on August 16, 2024

ye, i had that issue too many times and still dont know how to fix it.. so tired! maybe github help us

from gpt-engineer.

viborc avatar viborc commented on August 16, 2024

Thanks for posting here, we will take a look!

from gpt-engineer.

similato87 avatar similato87 commented on August 16, 2024

@vgvishesh Thank you for bringing this to our attention. I will prioritize investigating and resolving this issue promptly. To ensure we address all concerns, could you please confirm if the problem is solely related to the duplication of additions, or are there other anomalies we should be aware of? Your feedback is crucial for a comprehensive fix.

from gpt-engineer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.