Skip to content

fix(compat): return 400 for a non-integer v0.3 REST historyLength - #1382

Merged
mykytanetipa merged 2 commits into
a2aproject:mainfrom
ConnorMoss02:fix/v03-rest-history-length-400
Oct 27, 2026
Merged

mykytanetipa merged 2 commits into
a2aproject:mainfrom
ConnorMoss02:fix/v03-rest-history-length-400

Conversation

@ConnorMoss02

Copy link
Copy Markdown
Contributor

Problem

A v0.3 REST GetTask with a non-integer historyLength returned 500, because the ValueError from int() was not handled.

Fix

Raise InvalidParamsError instead, with the same message the v1.0 REST transport uses.

Tests

test_on_get_task_non_integer_history_length and test_get_task_v03_non_integer_history_length fail on main. 2325 passed.

Fixes #1381

@ConnorMoss02
ConnorMoss02 requested a review from a team as a code owner October 26, 2026 03:09
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/rest_handler.py 96.63% 96.74% 🟢 +0.11%
src/a2a/server/events/event_queue_v2.py 91.79% 92.27% 🟢 +0.48%
src/a2a/utils/telemetry.py 90.70% 91.47% 🟢 +0.78%
Total 93.10% 93.12% 🟢 +0.02%

Generated by coverage-comment.yml

@mykytanetipa mykytanetipa self-assigned this Oct 26, 2026

@mykytanetipa mykytanetipa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mykytanetipa
mykytanetipa merged commit 9c90c48 into a2aproject:main Oct 27, 2026
17 checks passed
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.

v0.3 REST GetTask returns 500 for a non-integer historyLength

2 participants