Enforce backend type checking in CI#27
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f98191b981
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| session_id=_required_string(data, "session_id"), | ||
| run_id=_required_string(data, "run_id"), | ||
| user_id=_required_string(data, "user_id"), | ||
| query=_required_string(data, "query"), |
There was a problem hiding this comment.
Do not leave empty research runs stuck in progress
When the API receives {"query": ""}, ResearchRequest.query has no min_length (src/api/routers/sessions.py:64-65) and the enqueue path stores body.query directly in the research/run.requested event (src/api/routers/sessions.py:728-734). This new _required_string(..., "query") raises before _execute_research_run starts, so the pending SessionRun created just before enqueue never reaches the failure patch in _execute_research_run, leaving clients polling a run that remains running while Inngest retries. Either reject empty queries before creating the run or let the handler call _execute_research_run so it can persist a terminal failure.
Useful? React with 👍 / 👎.
# Conflicts: # src/api/endpoints.py
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
What changed
Why
Backend type checking was non-blocking because of a pre-existing error backlog. That allowed new typing regressions to merge unnoticed and weakened the CI quality signal.
Impact
Future pull requests now fail CI when backend type errors are introduced. Runtime behavior remains unchanged except that malformed Inngest event payloads now fail early with explicit validation errors.
Validation
uv run ruff check src testsuv run mypy src— zero errors across 67 source filesuv run bandit -q -c pyproject.toml -r srcuv run python -m pytest tests/ -q— 554 passedgit diff --checkgraphify update .