[Bug] Native validation fails with SQLAlchemy 2.1 result typing
Description
A fresh native development setup on unchanged main fails the required typecheck after resolving SQLAlchemy 2.1.1. This affects four existing result-handling sites, independent of the FunASR integration in #8501.
Steps to Reproduce
At main commit 476f61b000ef15a77ab3a6851b2c6cefbc7571c9:
./scripts/dev_setup.sh
source .venv/bin/activate
python -c 'import sqlalchemy; print(sqlalchemy.__version__)'
./scripts/validate.shThe observed fresh dependency resolution selected SQLAlchemy 2.1.1. No repository dependency declarations were changed.
Expected Behavior
The repository's native setup and validation should work together with the supported dependency resolution, without locally downgrading SQLAlchemy or suppressing mypy errors.
Actual Behavior
Validation reports four errors in the 1062-file Agno check:
agno/os/public/_limits.py:132: the scalar result assigned toresetneeds a type annotation.agno/db/sqlite/async_sqlite.py:2469,agno/db/postgres/async_postgres.py:2179, andagno/db/mysql/async_mysql.py:2096: the tuple-unpacked session ID is inferred asobject, incompatible with the string-keyed grouping dictionary.
The Agno/agnoctl/cookbook Ruff checks, agnoctl mypy check, and cookbook pattern check pass in the same baseline run.
Environment
- Linux, Agno 3.0.11 at the main commit above.
- Python 3.12.3, SQLAlchemy 2.1.1, mypy 2.1.0, Ruff 0.15.20.
- SQLAlchemy 2.1.1 requires Python >=3.11; the existing Agno style-check job runs Python 3.10, while native dev setup uses Python 3.12.
Possible Solutions
Use the named mapping API for the three explicitly labeled metrics queries, and perform the limiter's existing int() normalization directly on the scalar expression. Also exercise the native Python 3.12 runtime in the style-check matrix.
Additional Context
Other contributions mention the same unrelated baseline failure and local SQLAlchemy 2.0.x workarounds: #10642, #10634, and #10606. Those PRs address different bugs; this report is specifically about the native validation failure.
This report and the accompanying repair were prepared by Codex with the account owner's authorization. No model inference, paid API, or database service was required to reproduce the typecheck failure.
Source: agno-agi/agno