Skip to content

Global request body limit#3165

Draft
sxlijin wants to merge 1 commit intocanaryfrom
cursor/global-request-body-limit-dded
Draft

Global request body limit#3165
sxlijin wants to merge 1 commit intocanaryfrom
cursor/global-request-body-limit-dded

Conversation

@sxlijin
Copy link
Contributor

@sxlijin sxlijin commented Feb 23, 2026

Pull Request Template

Thanks for taking the time to fill out this pull request!

Issue Reference

Please link to any related issues

  • This PR fixes/closes #[issue number]

Changes

Please describe the changes proposed in this pull request

This PR implements a global request body limit for the BAML runtime server.

  • Replaced axum::extract::DefaultBodyLimit with tower_http::limit::RequestBodyLimitLayer to apply a global limit.
  • Set the global request body limit to 50 MB (50 * 1024 * 1024 bytes) for all routes.
  • Added tower-http dependency with the limit feature to engine/baml-runtime/Cargo.toml.
  • Updated imports in engine/baml-runtime/src/cli/serve/mod.rs to reflect these changes.

Testing

Please describe how you tested these changes

  • Unit tests added/updated
  • Manual testing performed
    • Ran cargo test -p baml-runtime --lib which resulted in all 147 tests passing.
    • Applied cargo fmt for code formatting.
  • Tested in [environment]

Screenshots

If applicable, add screenshots to help explain your changes

[Add screenshots here...]

PR Checklist

Please ensure you've completed these items

  • I have read and followed the contributing guidelines
  • My code follows the style guidelines of this project (via cargo fmt)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Additional Notes

Add any other context about the PR here

This change addresses the need for a global request body limit, replacing a more specific or default limit with a consistent approach across the server.


Slack Thread

Open in Web Open in Cursor 

- Replace axum DefaultBodyLimit with tower_http RequestBodyLimitLayer
- Set global limit to 50 MB for all routes
- This provides a more consistent approach than path-specific limits

Co-authored-by: Sam Lijin <sam@boundaryml.com>
@cursor
Copy link

cursor bot commented Feb 23, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Feb 23, 2026 6:55pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
promptfiddle Skipped Skipped Feb 23, 2026 6:55pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/global-request-body-limit-dded

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants