Skip to content

Conversation

@peteski22
Copy link
Contributor

@peteski22 peteski22 commented Jan 15, 2026

'Yay, linting passes' 🫠

Rationale

This PR fixes all mypy type errors that were causing pre-commit checks to fail, plus one runtime bug discovered during the investigation.

Type Fixes

  • llama_index_utils.py: DocumentBlock.data is bytes | IOBase, but only bytes has .decode(). Added proper type narrowing.
  • google.adk.tools: The module doesn't explicitly export BaseTool, FunctionTool, etc. in its type stubs. Added type: ignore[attr-defined].
  • openai.py: The reasoning_effort parameter accepts 'xhigh' from OpenAI agents but any-llm doesn't support it yet. Added type ignore with TODO. Upstream fix: feat: add xhigh reasoning effort level any-llm#738
  • langchain.py: bind_tools return type was BaseMessage but should be AIMessage to match BaseChatModel.

Bug Fix

  • test_mcp_serve.py / test_a2a_serve.py: AppStatus.get_or_create_exit_event() doesn't exist in any version of sse-starlette. Replaced with AppStatus.should_exit = True.

The data attribute can be bytes | IOBase, but only bytes has .decode().
Added isinstance check to handle both types correctly.
The google.adk.tools module does not explicitly export BaseTool,
FunctionTool, or google_search in its type stubs.
The OpenAI agents library supports 'xhigh' but any-llm does not yet.
See mozilla-ai/any-llm#738 for the upstream fix.
The return type should be AIMessage to match BaseChatModel's signature,
not the broader BaseMessage type.
AppStatus.get_or_create_exit_event() does not exist in sse-starlette.
The correct way to signal shutdown is setting AppStatus.should_exit.
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/any_agent/frameworks/langchain.py 54.85% <ø> (-2.29%) ⬇️
src/any_agent/frameworks/openai.py 60.64% <ø> (ø)
src/any_agent/tools/wrappers.py 92.39% <100.00%> (ø)
tests/unit/frameworks/test_google.py 97.43% <100.00%> (ø)
tests/unit/tools/test_unit_wrappers.py 95.45% <100.00%> (ø)

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants