fix: increase body parser limit to 50mb for large PDF uploads

Claude API supports up to 32MB PDFs; base64 encoding adds ~33% overhead.
50mb body limit covers the maximum single-document upload case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 05:35:43 -08:00
parent c9367ee22a
commit 4987cad881
1 changed files with 2 additions and 2 deletions

View File

@ -17,8 +17,8 @@ process.on('uncaughtException', (error) => {
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AgentModule);
// Increase body parser limit for base64 image attachments (default 100KB is too small)
app.useBodyParser('json', { limit: '10mb' });
// Claude API: max 32MB PDF + 5MB images; base64 adds ~33% overhead → 50mb covers all cases
app.useBodyParser('json', { limit: '50mb' });
// Use raw WebSocket adapter instead of Socket.IO
app.useWebSocketAdapter(new WsAdapter(app));
const config = app.get(ConfigService);