Skip to content

ci: add typecheck and test workflow - #17

Merged
ssevera1 merged 2 commits into
mainfrom
ci/add-checks
Jul 29, 2026
Merged

ci: add typecheck and test workflow#17
ssevera1 merged 2 commits into
mainfrom
ci/add-checks

Conversation

@ssevera1

Copy link
Copy Markdown
Owner

What

Adds a CI workflow running typecheck and tests on every pull request and on pushes to the default branch.

Why

These repos had no automated checks at all. The automated improvement workflow opens PRs against them, and nothing verified that the proposed code compiled or passed tests before review.

Runs mypy (--ignore-missing-imports) and pytest on Python 3.11.

ssevera1 added 2 commits July 29, 2026 12:22
mypy, newly wired into CI, found:

- Eight BaseTool subclasses declared execute() signatures incompatible with
  the abstract method, so a caller holding a BaseTool could not satisfy them.
  Arguments arrive as a dict parsed from the model's tool call, so the base
  signature is now open rather than the subclasses being wrong.
- LLMClient.chat declared -> dict but returns a generator when stream=True.
  Added overloads so the return type follows the stream flag.
- Message.to_dict assigned a list into a dict inferred as dict[str, str].
- _parse_ddg_html needed an annotation on its accumulator.

Verified locally: mypy clean over 20 files, 50 tests pass.
@ssevera1

Copy link
Copy Markdown
Owner Author

Since this PR introduces mypy, it also carries the fixes for what mypy found on the first run — otherwise the check would land red on day one.

These were pre-existing latent defects, not new ones. The most consequential across the three repos was treating a chat model's response.content as a str when it is typed str | list[str | dict]: on the list form, .strip() and json.loads() raise AttributeError/TypeError at runtime. Full detail is in the individual commit messages.

CI is green on this branch: typecheck and tests both pass.

@ssevera1
ssevera1 merged commit 6e94916 into main Jul 29, 2026
2 checks passed
@ssevera1
ssevera1 deleted the ci/add-checks branch July 29, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant