Python: accept int timeouts in A2AAgent by ManoharPaturi · Pull Request #8516 · microsoft/agent-framework · GitHub
Skip to content

Python: accept int timeouts in A2AAgent - #8516

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/a2a-int-timeout
Sep 21, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/a2a-int-timeout

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Motivation & Context

Fixes #8515. A2AAgent(timeout=30) raised TypeError because the guard only allowed float and httpx.Timeout. ints are valid timeouts for httpx itself and the natural spelling.

Description & Review Guide

  • What are the major changes? the timeout validation accepts int (coerced to float) alongside float and httpx.Timeout.
  • What is the impact of these changes? int timeouts work; nothing else changes.
  • What do you want reviewers to focus on? the guard change in the a2a agent construction path.

Related Issue

Fixes #8515

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue
  • This is not a breaking change.

A2AAgent._create_timeout_config only accepted float and httpx.Timeout, so
A2AAgent(url=..., timeout=30) raised TypeError. Per PEP 484's numeric tower
an int is a valid float, and httpx.Timeout itself accepts ints. Accept int
(and float) while continuing to reject bool and other types.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Merged via the queue into microsoft:main with commit 61d796c Sep 21, 2026
49 checks passed
ZedingZhang (ZedingZhang) pushed a commit to ZedingZhang/agent-framework that referenced this pull request Sep 29, 2026
A2AAgent._create_timeout_config only accepted float and httpx.Timeout, so
A2AAgent(url=..., timeout=30) raised TypeError. Per PEP 484's numeric tower
an int is a valid float, and httpx.Timeout itself accepts ints. Accept int
(and float) while continuing to reject bool and other types.

Co-authored-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
github-app-auth — 1110a7fa Deployed Sep 18, 2026 by ManoharPaturi via limit_open_prs #1404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: A2AAgent rejects int timeouts (only float/httpx.Timeout accepted)

3 participants