ChatGPT keeps removing parts of my code

If I ask ChatGPT to make slight amendments to my Python code, it will remove large and important chunks of code not related to what I’ve asked it to do.

If I ask it to put it back in, it will do, but then it will remove something else.

I have around 170 lines of Python, so not particularly long.

Is this a known bug?

1 Like

Having same problem with different programming languages.

Same issue - I am creating a graph and it will just not include all the points. I am giving it some old code with about 40 points defined on this graph and it will maybe do about 6. None of the points are redundant to what I want to do and I have made that clear in my prompt.

I’ve been using it for coding for about 6 months, this has always been an issue, particularly if you ask it to give you full code, best to ask for edited segments as you progress through development in my experience

In case it helps anyone, the o3 mini-high model is much better behaved, at least in my compact code (c. 200 lines of python).

Same here for me. I have 150 lines of code with 4o (premium) and canvas. I’ll ask to add a small thing and i explicitly told it NOT to remove anything and i end up with 50 lines less than before. pathetic.