Live data from Hacker News

A ChatGPT mistake cost us $10k

asim.bearblog.dev

231–240 of 526 posts

Re: A ChatGPT mistake cost us $10k

#231
post #225

Earlier quoted context omitted.

Like people who post "here's what ChatGPTx said" instead of their own answer. Quite literally, what is the point? However, I don't think it's really bad for the technical industries long term. It probably does mean that some companies with loose internal quality control and enough shiftless employees pasting enough GPT spew without oversight will go to the wall because their software became unmaintainable and not use…

Is the idea here that normal (read: low?) interest rates will let companies spend more time getting things right?

[deleted]

Re: A ChatGPT mistake cost us $10k

#232
post #185
post #103

Earlier quoted context omitted.

Eh I imagine they looked over the code as well, doing code review -- and at first glance, the code looks reasonable. I certainly wasn't able to catch the bug even though I tried to find it (and I was given a tiny collection of lines and the knowledge that there's a bug there!). If anything, I think this says something about how dangerous ChatGPT and similar tools are: reading code is harder than writing code, and whe…

I totally disagree with this. You might as well argue that we shouldn't use code-completion of any kind because you might accidentally pick the wrong dependency or import. Or perhaps we shouldn't use any third-party libraries at all because you can use them to write reasonable-looking but incorrect code? Heck, why even bother using a programming language at all since we don't "own" how it's interpreted or compiled? U…

[deleted]

Re: A ChatGPT mistake cost us $10k

#233

Earlier quoted context omitted.

This is a pretty common mistake with sqlalchemy whether you’re using ChatGPT or not. I learned the same lesson years ago, although I caught it while testing. I write plenty of python and I just don’t often pass functions in as parameters. In this case you need to! For something like this where you’re generating a unique id and probably need it in every model, it’s better to write a new Base model that includes things…

I wonder are there linters to detect those types of mistakes for SQLAlchemy. Even though I'm aware of such pitfalls, it's nice if linters can catch them cause I'm not confident to cache them all the time during code review. Some linters like pyright can identify dangerous defaults in function call, like `def hello(x=[]): pass` (mutable values shouldn't be a default). Linter plugins for widely-used and critical librar…

I personally use pylint, which I've found to be the most aggressive python linter.

Re: A ChatGPT mistake cost us $10k

#234
uuidv4 is bad for a primary key. Google it. Use uuidv6 or v7. If you don't like using something not quite yet part of the standard, use v1 using time rather than MAC. Not a big deal for small tables, but for anything that will get large, you really don't want v4.

Re: A ChatGPT mistake cost us $10k

#235
I'm generally pretty critical of ChatGPTs code writing ability, but this mistake is something that could very easily be made by a human.

On the other hand, this could and probably should, have been caught by an automated test that tried to create multiple subscriptions on a single server. Or for that matter , manual testing of creating subscriptions against a local copy. I'm not saying that to be dismissive, but one takeaway you should get from it is the value of testing before putting code in production.

Edit: Another takeaway should probably be that if you have a a major bug like this, and you can't easily reproduce it, you should look harder. I bet there were some logs for errors about constraint violations in the database if you had looked for them.

Re: A ChatGPT mistake cost us $10k

#237

Today chatGPT thought it was June 7th 2024 but today is June 9th 2024... like what huh WTH it could query my iPhone for that simple info

I get the sense that you don't understand the purpose or design of chatgpt No tool can do everything

what it cant tell you the correct date.. how simple is that and yeah i use chatGPT in many different ways ... i was pointing out an example from today in which it was flat wrong for such a simple thing.

Re: A ChatGPT mistake cost us $10k

#238
post #20
post #2

Thanks for telling. Bookmarked for the next time we're told ChatGPT's code error rate is acceptable because we review its code just like an intern's.

Your take-away is that this is ChatGPT's fault rather than a failure of testing?

Their take-away is that when people tell them ChatGPT produces excellent code you have a nice example to the contrary. The business had many failures, not the least of which is that `default = ... foo() ...` should have jumped out in a cursory glance at the code as needing further inspection, almost no matter which language the developers in question are most comfortable with.

Re: A ChatGPT mistake cost us $10k

#239

This is why you should always rush your engineers, never giving them enough time to validate or understand what ChatGPT just spewed. Good job. /s Meanwhile, I go through the tedious process of understanding ChatGPT's code letter-by-letter, also reading the docs, searching StackOverflow, even offering and rewarding bounties on StackOverflow, all to see if the code makes a shred of sense.

When I was coding https://stackoverflow.com/a/77210784/308851 well, I had no idea how to open an SSH connection using go, I barely knew basic Go so I asked ChatGPT. The meat of the SSH connecting code is still pretty much ChatGPT written (bad chx!) but it contained a couple defers like defer session.Close() which I needed to understand and remove before it became usable as a utility function. I did search for ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers) to see whether others use it and I found they do and their code was very similar so I decided to trust ChatGPT code even if I only understood it enough to understand but not enough to write similar code. It's just an SSH connection, the risk is quite low, the expected result of bogus code is just not working, I wouldn't expect subtle errors here. The rest of the logic is hand written, though.
Post reply on HN