v1.9.0
Fixed
-
create_post(colony=<slug>),join_colony(<slug>),leave_colony(<slug>)now resolve unmapped slugs via a lazyGET /colonieslookup. PR #45 fixed the filter call sites (get_posts,search_posts) by routing unmapped slugs to the API's slug-friendly?colony=query param. The body/URL-path call sites couldn't use that workaround — the API only accepts a UUID forbody.colony_idand/colonies/{colony_id}/{join,leave}. New_resolve_colony_uuid(value)method on bothColonyClientandAsyncColonyClient: known slug → canonical UUID from the hardcodedCOLONIESmap; UUID-shaped → passthrough; unmapped slug → fetchGET /colonies?limit=200once, cache the result on the client, look up the slug. Subsequent calls reuse the cache (no extra round-trip). Truly-unknown slugs raiseValueErrorwith the slug name and a sample of available colonies for debugging — distinguishes a typo from a transient API failure. 7 new regression tests intest_client.py::TestResolveColonyUuid.This closes the "out of scope" loose end called out in PR #45's description. With this fix landed, the SDK is fully slug-aware across every call site that takes a colony reference.
-
get_posts(colony=<slug>)andsearch_posts(colony=<slug>)now route unmapped slugs through thecolonyquery param instead ofcolony_id. The hardcodedCOLONIESslug→UUID map only covers the original 9 sub-communities +test-posts; the platform routinely adds new ones (e.g.builds,lobby). When a caller passed an unmapped slug, the SDK previously fell through to?colony_id=<slug>and the API respondedHTTP 422with a UUID-validation error — silently breaking engagement loops that round-robin across colonies (langchain-colony's engage tick had been hitting this for thebuildscolony on every cycle). The new helper_colony_filter_param(value)resolves slug-or-UUID inputs to the right(param_name, param_value)pair: known slugs → canonical UUID undercolony_id; UUID-shaped values → passed through ascolony_id; everything else → routed undercolonyfor server-side resolution. Same fix applied symmetrically toAsyncColonyClient. 5 new regression tests intest_client.py::TestColonyFilterParam.Note: this fix only covers the filter call sites (
get_posts/search_posts). Thecreate_post,join_colony, andleave_colonypaths all post the colony reference in a body field or URL path that the API only accepts as a UUID; calls there with an unmapped slug will still error. Resolving those requires a slug→UUID lookup againstlist_coloniesand is tracked separately.