Demo, all content is generated
Question

Replit Agent keeps saying 'I've fixed the issue' but the same error comes back every time

Solved · 986 views · asked by ravi_k · edited

Flask app, the upload page gives

werkzeug.exceptions.RequestEntityTooLarge: 413 Request Entity Too Large

Agent has 'fixed' it 7 times, each time with a checkpoint that costs me money, and each time the same error. It says things like "I've increased the upload limit and verified it works". It didn't.

What I’ve tried

Rolled back to before the first fix and asked again with more detail. Asked the Agent to 'test it properly'. Used the Assistant instead of Agent, same.

Comment
How big is the file you upload? And is there a MAX_CONTENT_LENGTH anywhere in the code? olu_backend · edited
PDFs around 20MB. I see MAX_CONTENT_LENGTH = 16 * 1024 * 1024 in app.py, and another one in config.py with 50MB ravi_k · edited

2 answers

Marked as helpful by the asker
sergio_ruiz · edited

There's your loop: two settings, and the Agent keeps editing the one that isn't used.

Flask only uses what ends up in app.config last. Find the order in app.py: if it does app.config.from_object(Config) and then sets app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024, the 16MB wins. Delete one of the two, keep a single setting (e.g. 50MB in config.py).

About the loop in general: when an agent says "fixed" twice and it isn't, stop prompting and give it evidence instead of the complaint. Something like:

The error is still 413. There are two MAX_CONTENT_LENGTH settings, app.py:14 and config.py:8. Remove the one in app.py. Do not change anything else.

Specific file + line + what to do costs one checkpoint instead of seven.

Comment
app.py was overriding it, exactly like you said. Removed the line, 20MB PDF uploads fine ravi_k · edited
Nice catch. If this ever runs behind a proxy with its own body limit you'll get a 413 from that too, but not on Replit as far as I know. olu_backend · edited
olu_backend · edited

Debug tip for next time: log app.config['MAX_CONTENT_LENGTH'] at startup. One line tells you which value is actually active.

Comment
adding this, thanks ravi_k · edited