Skip to content

v0.7.0 release prep: 100% coverage, batch tools, typed mode, deprecation fix#27

Merged
jackparnell merged 2 commits intomainfrom
feature/v070-release-prep
Apr 12, 2026
Merged

v0.7.0 release prep: 100% coverage, batch tools, typed mode, deprecation fix#27
jackparnell merged 2 commits intomainfrom
feature/v070-release-prep

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

Releases prep for v0.7.0 — covers all four items requested before tagging:

  1. 100% test coverage across the entire langchain_colony package (was 91%)
  2. 2 new batch tools wrapping colony-sdk 1.7.0 helpers
  3. typed=True passthrough on both toolkits
  4. LangGraph V1.0 deprecation fix for create_react_agent

Plus CHANGELOG entry and version bump 0.6.0 → 0.7.0.

Coverage

Module Before After
__init__.py 67% 100%
agent.py 100% 100%
callbacks.py 91% 100%
events.py 84% 100%
models.py 100% 100%
retriever.py 98% 100%
toolkit.py 100% 100%
tools.py 90% 100%
Total 91% 100%

New tests/test_coverage_gaps.py adds targeted tests for:

  • Error paths in every tool's _run and _arun (~50 tests)
  • Async happy paths in tools that previously only had sync coverage
  • _format_poll / _format_webhooks non-dict input branches
  • Async retriever _aenrich_with_comments exception swallowing
  • Event poller mark-read failures, async error paths, sync + async dispatch handler exceptions, catch-all dispatch
  • Callbacks metadata extraction branches and on_tool_end/on_tool_error optional logging + unknown run-id no-ops
  • __init__.py lazy import of create_colony_agent

377 tests passing (up from 270).

New batch 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 (the SDK helper does this). Toolkit now ships 29 tools (11 read + 18 write), up from 27.

typed=True passthrough

toolkit = ColonyToolkit(api_key="col_...", typed=True)
# toolkit.client.typed is True — methods will return Post / User / Comment models

Also works on AsyncColonyToolkit. Ignored when client= is also passed (the injected client wins).

LangGraph V1.0 deprecation fix

agent.py now tries from langchain.agents import create_agent first, falling back to from langgraph.prebuilt import create_react_agent for users without the langchain package. The fallback's deprecation warning is suppressed at the call site so users don't see noise on import/use.

Test plan

  • 377 tests pass
  • 100% line coverage
  • ruff check + format clean
  • No deprecation warnings during tests
  • CI matrix (Python 3.10/3.11/3.12/3.13)

Once this lands, the next release tag (v0.7.0) will trigger the existing release.yml workflow.

🤖 Generated with Claude Code

ColonistOne and others added 2 commits April 12, 2026 10:38
…ion fix

1. 100% test coverage across the entire package
   - tests/test_coverage_gaps.py — targeted tests for error paths in
     tools.py (50+ tools with sync+async error branches), small branches
     in callbacks.py, async paths in events.py and retriever.py, and
     lazy imports in __init__.py
   - All 8 source modules now at 100% line coverage (was 91%)
   - 377 tests passing, up from 270

2. Two new batch tools wrapping colony-sdk 1.7.0 helpers
   - colony_get_posts_by_ids — fetch multiple posts in one call,
     skipping any that 404
   - colony_get_users_by_ids — same for user profiles
   - Toolkit now ships 29 tools (11 read + 18 write), up from 27

3. typed=True passthrough on both ColonyToolkit and AsyncColonyToolkit
   - ColonyToolkit(api_key="col_...", typed=True) constructs the
     underlying ColonyClient with typed=True for SDK 1.7.0 typed
     response models

4. LangGraph V1.0 deprecation warning fix
   - agent.py now imports langchain.agents.create_agent first (the new
     path) and falls back to langgraph.prebuilt.create_react_agent
   - The fallback's deprecation warning is suppressed at the call site
     so users don't see noise on import/use

CHANGELOG entry added for v0.7.0. Version bumped 0.6.0 → 0.7.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CI test matrix was failing on all 4 Python versions because:

1. tests/test_coverage_gaps.py imported create_colony_agent at module top
2. That triggered langchain_colony.agent's import of langgraph
3. CI didn't install langgraph (not in dev or async extras)
4. Test collection failed with ModuleNotFoundError

Two fixes:

1. Use pytest.importorskip("langgraph") inside the lazy-import test
   instead of importing at module top, so the file collects cleanly even
   without langgraph installed.

2. Add `langgraph>=0.2.0` to the dev extra so CI runs the agent tests
   instead of skipping them via pytest.importorskip in test_agent.py.
   Also add a new `agent` optional extra (`pip install langchain-colony[agent]`)
   for users who want the pre-built create_colony_agent without going
   through the dev install.

377 tests still pass locally with 100% coverage. CI should now report
real coverage on agent.py (was being skipped silently before).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jackparnell jackparnell merged commit 752b464 into main Apr 12, 2026
6 checks passed
@jackparnell jackparnell deleted the feature/v070-release-prep branch April 12, 2026 09:59
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