Skip to content

fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693

Open
SrzStephen wants to merge 1 commit intoa2aproject:mainfrom
SrzStephen:fix_starlette_deprectation
Open

fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693
SrzStephen wants to merge 1 commit intoa2aproject:mainfrom
SrzStephen:fix_starlette_deprectation

Conversation

@SrzStephen
Copy link

@SrzStephen SrzStephen commented Feb 15, 2026

Description

In This commit that landed in v0.48.0 starlette changed constants to conform to RFC9110.

It's the only one affected that I could find in this codebase.

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run bash scripts/format.sh from the repository root to format)
  • Appropriate docs were updated (if necessary)

Tests

uv sync --all-groups

Before and after: confirmed that this is fixed.

uv run python -W error::DeprecationWarning -c "from a2a.server.apps.jsonrpc.fastapi_app import *"   

Confirmed that tests worked with

uv run pytest

Other

uv.lock currently has

[[package]]
name = "starlette"
version = "0.50.0"

So I don't think the dependency pinning is a breaking change.

…. Use 'HTTP_413_CONTENT_TOO_LARGE' instead.

Reason for this is that in Kludex/starlette@40a8147 they changed the enum to match https://www.rfc-editor.org/rfc/rfc9110#name-413-content-too-large

starlette release specifier due to this only being changed in https://github.com/Kludex/starlette/releases/tag/0.48.0
@SrzStephen SrzStephen requested a review from a team as a code owner February 15, 2026 10:37
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SrzStephen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a DeprecationWarning originating from a change in Starlette's HTTP status code enumeration. By updating the reference from HTTP_413_REQUEST_ENTITY_TOO_LARGE to HTTP_413_CONTENT_TOO_LARGE and specifying a minimum Starlette version, the project maintains compatibility with recent Starlette releases and adheres to updated RFC standards, preventing future warnings and potential breakage.

Highlights

  • Deprecation Warning Fix: Addressed a DeprecationWarning related to the HTTP_413_REQUEST_ENTITY_TOO_LARGE status code in Starlette, which was renamed to HTTP_413_CONTENT_TOO_LARGE to conform with RFC9110.
  • Dependency Version Constraint: Updated the 'starlette' dependency in 'pyproject.toml' and 'uv.lock' to explicitly require version '0.48.0' or higher, ensuring compatibility with the new status code name.
Changelog
  • pyproject.toml
    • Updated the 'http-server' optional dependency to specify 'starlette>=0.48.0'.
  • src/a2a/server/apps/jsonrpc/jsonrpc_app.py
    • Replaced 'HTTP_413_REQUEST_ENTITY_TOO_LARGE' with 'HTTP_413_CONTENT_TOO_LARGE' in import statements.
    • Updated the usage of the status code in the '_handle_requests' method.
    • Modified the type hint for the status code constant.
  • uv.lock
    • Updated the 'starlette' dependency specification to 'starlette>=0.48.0' for both 'all' and 'http-server' extras.
Activity
  • The author confirmed the fix by running 'uv sync --all-groups' and testing with 'uv run python -W error::DeprecationWarning -c "from a2a.server.apps.jsonrpc.fastapi_app import *"' before and after the changes.
  • The author confirmed that 'uv run pytest' worked as expected.
  • The author noted that the 'uv.lock' file already specifies 'starlette' version '0.50.0', indicating that the change is not breaking.
  • The author followed the 'CONTRIBUTING' guide, including conventional commits and ensuring tests and linter pass.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses the DeprecationWarning from starlette by replacing HTTP_413_REQUEST_ENTITY_TOO_LARGE with the new HTTP_413_CONTENT_TOO_LARGE constant. The changes are applied consistently across all relevant files, and the dependency version in pyproject.toml and uv.lock has been updated accordingly to ensure compatibility. The fix is well-contained and follows best practices. Great work!

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