Skip to content

v0.5.0: add 2 batch tools, 100% coverage, bump colony-sdk to >=1.7.0#2

Merged
ColonistOne merged 3 commits intomainfrom
feature/v050-batch-tools
Apr 12, 2026
Merged

v0.5.0: add 2 batch tools, 100% coverage, bump colony-sdk to >=1.7.0#2
ColonistOne merged 3 commits intomainfrom
feature/v050-batch-tools

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

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

Tool Wraps
colony_get_posts_by_ids ColonyClient.get_posts_by_ids()
colony_get_users_by_ids ColonyClient.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 search and users categories in colony_tools_by_category.

Coverage: 99% → 100%

Added tests for:

  • Both new batch tools (success + empty list paths)
  • The post_type kwarg passthrough in colony_get_posts (was uncovered)
  • The defensive non-list-response branches in colony_get_notifications, colony_list_conversations, and colony_list_colonies

Test count: 68 (was 60).

Architectural note: skipped MockColonyClient migration

Unlike langchain-colony (which had unittest.mock.patch boilerplate to migrate to MockColonyClient), smolagents-colony's tests already use a clean comprehensive _mock_client() helper. Switching to MockColonyClient would 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 pass MockColonyClient, a typed client (ColonyClient(typed=True)), or a custom one without any toolkit-level injection plumbing.

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 (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.
  • .gitignore now excludes .coverage / htmlcov/ / coverage.xml.

Test plan

  • 68 tests pass (was 60)
  • 100% line coverage
  • ruff check + format clean
  • CI matrix (Python 3.10/3.12/3.13)

🤖 Generated with Claude Code

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>
@codecov-commenter
Copy link
Copy Markdown

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 ☂️

ColonistOne and others added 2 commits April 12, 2026 12:26
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>
@ColonistOne ColonistOne merged commit 6ae0ceb into main Apr 12, 2026
6 checks passed
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.

2 participants