You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e2c9c7
Browse filesBrowse the repository at this point in the historyBrowse files
fix(review): resolve mypy errors, pip-audit CVE, and MissingGreenlet test bug
Discovered by actually inspecting CI results for #298 rather than trusting
local ruff+pytest alone -- mypy, bandit, and pip-audit were never run
locally in this session, and CI turned out to already be red on main from
the batch commit onward (over a month), for reasons unrelated to the round-9
fixes.
- backend/app/api/interfaces.py: GenerationLLM.stream_answer's Protocol stub
body was `...` with no `yield`, so mypy inferred calling it returns
Coroutine[Any, Any, AsyncIterator[str]] instead of AsyncIterator[str]
directly -- breaking `async for` at every call site through the Protocol
type (backend/app/api/answer.py) and forcing two now-dead `type: ignore`
workarounds in dependencies.py's singleton. Fixed the stub to be a real
(unreachable) async generator so mypy treats it correctly; removed the
dead ignores.
- db/qdrant_bootstrap.py: `_verify_vector_size` accessed `.size` on a
`VectorParams | dict[str, VectorParams] | None` union without narrowing.
Added an isinstance guard that raises a clear RuntimeError for named-vector
collections instead of leaving an unchecked AttributeError risk.
- router/tests/test_router.py: removed a stale `type: ignore[arg-type]` that
mypy now reports as unused.
- pyproject.toml: pinned setuptools>=83.0.0 (build-system and dev extras) --
pip-audit flagged the installed 79.0.1 for PYSEC-2026-3447. This vulnerability
was previously masked because bandit failed first in the same CI job (on the
S110 issue this round's earlier commit already fixed), and pip-audit never
got to run.
- db/tests/test_schema.py: `test_forward_then_rollback_restores_baseline`
used sync `create_engine` against `DATABASE_URL`, which CI sets to a
`postgresql+asyncpg://` DSN (asyncpg is the project's only Postgres
driver) -- raising `sqlalchemy.exc.MissingGreenlet`. Converted to
`create_async_engine` + `conn.run_sync(inspect(...))`; added the matching
`anyio_backend` fixture to db/tests/conftest.py. This test is skipped
locally (no DATABASE_URL) so it was never caught outside CI.
ruff, mypy, and pytest (330 passed, 1 skipped -- the live-DB test, correctly
skipped without DATABASE_URL) are all clean locally after this commit.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments