v0.5.0: add 2 batch tools, 100% coverage, bump colony-sdk to >=1.7.0#2
Merged
ColonistOne merged 3 commits intomainfrom Apr 12, 2026
Merged
v0.5.0: add 2 batch tools, 100% coverage, bump colony-sdk to >=1.7.0#2ColonistOne merged 3 commits intomainfrom
ColonistOne merged 3 commits intomainfrom
Conversation
New tools: - colony_get_posts_by_ids: fetch multiple posts by ID, skipping 404s - colony_get_users_by_ids: same for user profiles Wraps the new colony-sdk 1.7.0 batch helpers. Toolkit now ships 32 tools (17 read + 15 write), up from 30. Both new tools are added to the `search` and `users` categories in colony_tools_by_category. Coverage: - 100% line coverage (was 99%). Added tests for the new batch tools, the post_type kwarg passthrough in colony_get_posts, and the defensive non-list-response branches in colony_get_notifications, colony_list_conversations, and colony_list_colonies. - Test count: 68 (was 60). Dependencies: - colony-sdk>=1.6.0 → >=1.7.0 Internal: - Per-module mypy override for smolagents_colony.tools to disable union-attr and index codes. colony-sdk 1.7.0 changed read-method return types to `dict | Model` which trips strict mypy when we process responses as dicts. CI doesn't run mypy so this is just for clean local development. - .gitignore now excludes .coverage / htmlcov/ / coverage.xml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
colony-sdk 1.7.1 reverted the dict | Model union return types that 1.7.0 introduced (which broke every downstream consumer using strict mypy). With 1.7.1 we no longer need the per-module mypy override for smolagents_colony.tools — strict mypy works again out of the box. Changes: - pyproject.toml: colony-sdk>=1.7.0 → >=1.7.1 - pyproject.toml: removed [[tool.mypy.overrides]] for smolagents_colony.tools - CHANGELOG.md: dropped the "Internal" section about the workaround; updated the Dependencies entry to explain why 1.7.1 specifically 68 tests pass, 100% coverage. The 39 remaining mypy errors are pre-existing "Class cannot subclass Tool" warnings from smolagents not having py.typed — unrelated to colony-sdk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The smolagents-colony CI workflow was a leaner template than what
langchain-colony and crewai-colony use. This brings it up to the same
standard:
1. Add Python 3.11 to the test matrix (was: 3.10/3.12/3.13). The other
gold-standard repos test all four currently-supported versions.
2. Split lint into a separate `lint` job (was: ruff check + format
inside each test job, which duplicated the work 3x and bloated PR
checks). Lint now runs once in parallel with tests.
3. Add a separate `typecheck` job that runs mypy. Previously mypy was
only run locally during development; CI never gated on it.
To make the typecheck job pass, also relax pyproject.toml's mypy config
from `strict = true` to the same shape langchain-colony / crewai-colony
use (warn_return_any=false, disallow_untyped_defs=true) and add an
ignore_missing_imports override for `smolagents` and `colony_sdk`. Both
upstream packages don't ship py.typed markers, which previously caused
~39 spurious "Class cannot subclass Tool (has type Any)" errors and
made strict mypy unusable.
Also annotate `inputs: dict[str, Any] = {}` on the 6 no-input tools so
mypy can infer their type — without the annotation, mypy emits
`var-annotated` errors on the empty-dict literals.
Branch protection on main updated to require all 6 new checks: lint,
typecheck, and Test (Python 3.10/3.11/3.12/3.13).
Note: this PR adds the CI infrastructure but `codecov/patch` PR status
checks won't appear until the Codecov GitHub App is installed on the
repo (a Codecov web UI step Jack needs to do — the workflow already
uploads coverage successfully via CODECOV_TOKEN).
All 68 tests pass, 100% coverage, mypy clean.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
v0.5.0 release prep for smolagents-colony — adds the new colony-sdk 1.7.0 batch helpers as smolagents tools and brings the package to 100% test coverage.
New tools
colony_get_posts_by_idsColonyClient.get_posts_by_ids()colony_get_users_by_idsColonyClient.get_users_by_ids()Both silently skip 404s. Useful for LLMs that have a list of IDs from earlier search results and want to fetch them all in one tool call.
Toolkit total: 32 tools (17 read + 15 write), up from 30. Both new tools are also added to the
searchanduserscategories incolony_tools_by_category.Coverage: 99% → 100%
Added tests for:
post_typekwarg passthrough incolony_get_posts(was uncovered)colony_get_notifications,colony_list_conversations, andcolony_list_coloniesTest count: 68 (was 60).
Architectural note: skipped MockColonyClient migration
Unlike langchain-colony (which had
unittest.mock.patchboilerplate to migrate toMockColonyClient), smolagents-colony's tests already use a clean comprehensive_mock_client()helper. Switching toMockColonyClientwould require duplicating all the response shapes — no code reduction. The existing helper stays as-is.Similarly, smolagents-colony's tool factories already accept any client (
colony_search(client)), so users can passMockColonyClient, a typed client (ColonyClient(typed=True)), or a custom one without any toolkit-level injection plumbing.Internal
smolagents_colony.toolsto disableunion-attrandindexcodes. colony-sdk 1.7.0 changed read-method return types todict | Model(a union with the typed-mode dataclasses) which trips strict mypy when we access fields with.get(). We use the untyped default at runtime so this is type-noise. CI doesn't gate on mypy..gitignorenow excludes.coverage/htmlcov//coverage.xml.Test plan
🤖 Generated with Claude Code