Adopt colony-sdk 1.5.0 typed errors and RetryConfig#13
Merged
jackparnell merged 1 commit intomainfrom Apr 9, 2026
Merged
Conversation
Bumps the floor to colony-sdk>=1.5.0 and removes the duplicated retry loop, _RETRYABLE_STATUSES set, and _STATUS_HINTS table — all of which the SDK now ships natively. - RetryConfig is re-exported from colony_sdk so existing imports keep working unchanged. ColonyToolkit hands it straight to ColonyClient, which performs retries internally with Retry-After handling. - The tool layer's _safe_run now just call+catch+format. Errors are caught as ColonyAPIError (whose str() already contains the hint and the server's detail field) and rendered as "Error (status) [code] —". - Per-tool retry= constructor argument removed (was unused after the retry loop moved into the SDK). - Test suite rewritten to use real SDK exception classes (ColonyNotFoundError, ColonyRateLimitError, etc.) rather than ad-hoc Exception() instances with monkey-patched .status attributes. 168 tests passing, 100% coverage held across all source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Cleanup PR — adopts the primitives that landed in
colony-sdk1.5.0 and deletes the now-duplicated copies that lived increwai_colony.tools.colony-sdkfloor to >=1.5.0RetryConfigis now re-exported fromcolony_sdk(existingfrom crewai_colony import RetryConfigkeeps working)_RETRYABLE_STATUSES,_STATUS_HINTS,_is_retryable,_fmt_error's hint table — all gone. The SDK's typed exceptions already include the hint + serverdetailin their string form, so the tool layer just prependsError (status) [code] —.ColonyToolkit(retry=...)now hands the config straight toColonyClient(retry=...). The SDK honoursRetry-Afterautomatically and retries502/503/504in addition to429.retry=constructor arg removed (was unused after the loop moved into the SDK).ColonyNotFoundError/ColonyRateLimitError/ColonyConflictError/ColonyAuthError/ColonyValidationError/ColonyNetworkErrorexceptions rather thanException()with monkey-patched.statusattributes.Net diff: −98 lines, mostly deleted duplication.
Behaviour notes
max_retries=3(3 total attempts, our old default) tomax_retries=2(3 total attempts under the SDK's "retries after the first try" semantics) — same total number of attempts, just labelled differently. PassRetryConfig(max_retries=3)to bump it back up.ColonyNetworkError(status=0)directly. Document in CHANGELOG.ColonyRateLimitError.retry_afteris exposed for callers that want to do higher-level backoff above the SDK's internal retries.Test plan
pytest— 168 passedpytest --cov— 100% across all 6 source files (__init__,callbacks,cli,crews,toolkit,tools)ruff checkcleanruff format --checkcleanmypy src/cleanThis is the first of four PRs heading toward v0.6.0. Next: native async via
AsyncColonyClient(drops theasyncio.to_threadshim).🤖 Generated with Claude Code