Founder finds Codex wrote quadratic length-checking code that crashed his Supabase edge function

burkov · x · 2026-09-09

ChapterPal developer burkov shares a cautionary tale about reading vibe code: Codex implemented a book-digest algorithm so inefficiently that Supabase killed the edge function for exceeding CPU limits. To check whether appending a paragraph would exceed the 100K-character cap, Codex concatenated the entire digest with each candidate paragraph and measured the resulting string — instead of just adding the two known lengths.

Replacing the length measurement with a simple A+B addition fixed it instantly. His takeaway: AI-generated code is full of these choices, "and that's OK — just be aware and don't make it responsible for running a nuclear factory."

Original post →

More from coding & agent

coding & agent channel →