Skip to content

fix: narrow Agent.as_tool return type to FunctionTool#2473

Merged
seratch merged 1 commit intomainfrom
fix/agent-as-tool-functiontool-return-type
Feb 13, 2026
Merged

fix: narrow Agent.as_tool return type to FunctionTool#2473
seratch merged 1 commit intomainfrom
fix/agent-as-tool-functiontool-return-type

Conversation

@seratch
Copy link
Member

@seratch seratch commented Feb 13, 2026

This pull request fixes a typing mismatch where Agent.as_tool() was annotated as returning Tool even though it always constructs and returns a FunctionTool.

  • It updates agent.py to declare as_tool(...) -> FunctionTool.
  • It removes now-redundant cast(FunctionTool, ...) patterns in tests
  • It does not change runtime behavior; this change improves public type accuracy and prepares for future FunctionTool-specific extensions.

@seratch seratch added this to the 0.9.x milestone Feb 13, 2026
@github-actions github-actions bot added enhancement New feature or request feature:core labels Feb 13, 2026
@seratch seratch merged commit c473b0c into main Feb 13, 2026
10 checks passed
@seratch seratch deleted the fix/agent-as-tool-functiontool-return-type branch February 13, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant