Skip to content

Fix payload size limits and handle entity.too.large in express.json()#13

Closed
shenald-dev wants to merge 2 commits into
masterfrom
fix/payload-size-limit-69351485470057752
Closed

Fix payload size limits and handle entity.too.large in express.json()#13
shenald-dev wants to merge 2 commits into
masterfrom
fix/payload-size-limit-69351485470057752

Conversation

@shenald-dev
Copy link
Copy Markdown
Owner

Fix for payload size limits in the API proxy. Large prompts and completions often exceed the default 100kb limit in express.json(). This limit is now set to 10mb, and appropriate 413 error handling is implemented.


PR created automatically by Jules for task 69351485470057752 started by @shenald-dev

…ty.too.large

Increased the default payload limit of `express.json()` from 100kb to 10mb to
accommodate large LLM prompts. Also added explicit error handling for
`entity.too.large` errors, returning a standard 413 Payload Too Large
JSON response instead of falling through to a generic 500 stack trace.
Added a test to verify this behavior.

Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…ty.too.large

Increased the default payload limit of `express.json()` from 100kb to 10mb to
accommodate large LLM prompts. Also added explicit error handling for
`entity.too.large` errors, returning a standard 413 Payload Too Large
JSON response instead of falling through to a generic 500 stack trace.
Added a test to verify this behavior.

Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant