test: type-check agent state tests - #12327
Draft
KXHXK wants to merge 1 commit into
Draft
Conversation
Signed-off-by: KXH <shepherdlaurie238@gmail.com>
|
|
Contributor
|
Hi @KXHXK, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
HaystackBot
marked this pull request as draft
August 12, 2026 22:05
38 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
Continue #10396 with a small, reviewable increment by adding the Agent state tests to the repository's mypy target.
The file had three related errors because mypy inferred the generic type parameter of
merge_lists()asNeverwhen both arguments were lists. An explicit result type supplies the intendedintcontext without changing runtime behavior.What:
test/components/agents/test_state_class.pyto thetest:typesmypy allowlistlist[int]How can it be used:
This runs automatically as part of the existing
hatch run test:typescommand.How did you test it:
uv run --with mypy mypy --install-types --non-interactive --cache-dir=.mypy_cache test/components/agents/test_state_class.py: no issuesuv run --with pytest pytest test/components/agents/test_state_class.py -q: 52 passeduvx ruff check test/components/agents/test_state_class.py pyproject.toml: passeduvx ruff format --check test/components/agents/test_state_class.py: passedBefore the annotation, the focused mypy command reported three errors at the
merge_listscall; after the annotation it reports none.Checklist:
AI assistance
Codex assisted with candidate screening, type-check diagnosis, and validation. I reviewed and understand the submitted change and all reported test results.