Skip to content

Comments

fix(deps): DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693

Merged
holtskinner merged 4 commits intoa2aproject:mainfrom
SrzStephen:fix_starlette_deprectation
Feb 18, 2026
Merged

fix(deps): DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693
holtskinner merged 4 commits intoa2aproject:mainfrom
SrzStephen:fix_starlette_deprectation

Conversation

@SrzStephen
Copy link
Contributor

@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!

Copy link
Member

@holtskinner holtskinner left a comment

Choose a reason for hiding this comment

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

We're intentionally not requiring a minimum starlette version, instead we're requiring a minimum fastapi version.

Can you modify this change to work with both starlette statuses?

Don't lock starlette version
Name "HTTP_413_CONTENT_TOO_LARGE" already defined (possibly by an import)  [no-redef]
@holtskinner holtskinner changed the title fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE Feb 18, 2026
@holtskinner
Copy link
Member

@gemini-code-assist review

@holtskinner holtskinner changed the title fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE fix(deps): DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE Feb 18, 2026
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

The pull request addresses a DeprecationWarning in Starlette by conditionally importing HTTP_413_CONTENT_TOO_LARGE or aliasing HTTP_413_REQUEST_ENTITY_TOO_LARGE for backward compatibility. This is a good approach to handle API changes in external libraries while maintaining compatibility with older versions. The changes are well-contained and directly address the reported issue.

@holtskinner holtskinner assigned herczyn and unassigned herczyn Feb 18, 2026
@holtskinner holtskinner merged commit 9968f9c into a2aproject:main Feb 18, 2026
10 checks passed
sokoliva pushed a commit that referenced this pull request Feb 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.24](v0.3.23...v0.3.24)
(2026-02-20)


### Bug Fixes

* **core:** preserve legitimate falsy values in _clean_empty
([#713](#713))
([7632f55](7632f55))
* **deps:** `DeprecationWarning` on `HTTP_413_REQUEST_ENTITY_TOO_LARGE`
([#693](#693))
([9968f9c](9968f9c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants