fix(pm): make the retired canonical-market helpers fail fast - #40
Merged
Conversation
Upstream probe (api.predexon.com direct, 3 runs each, 2026-08-04): /v1/pm/markets,
/v1/pm/markets/listings and /v1/pm/outcomes/{id} all return
410 "This endpoint has been sunset as of 2026-07-20. Market matching is
discontinued."
pm_markets / pm_listings / pm_outcome have been shipping calls to them ever
since. Payment was never charged — the gateway returns before settlement — but
the caller pays a round trip to learn the endpoint is gone, and the docstrings
still advertised them as live Tier 1 endpoints.
Kept as raising stubs rather than deleted: removing a public method breaks
`from x import` and attribute access on upgrade, and this is a patch release.
They now raise RetiredEndpointError (new, exported) with the sunset date and
`pm("markets/search", q=...)` as the replacement — before any network I/O, on
all four client surfaces (sync + async × HTTP + Solana).
pm_sports_categories / pm_sports_markets keep working but gain a warning: every
sports/* path is returning a consistent upstream 500 as of 2026-08-04. That is a
partner bug, not a sunset, so the helpers stay callable for whenever it recovers.
added 2 commits
August 4, 2026 15:38
Only repositions the RetiredEndpointError entries in the import block and __all__ — ruff 0.16.0 (the pinned CI version) sorts these differently than the newer ruff I had installed locally, which is why it passed here and failed there.
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.
Upstream probe (
api.predexon.comdirectly, 3 runs each, 2026-08-04):/v1/pm/markets,/v1/pm/markets/listingsand/v1/pm/outcomes/{id}all returnpm_markets/pm_listings/pm_outcomehave been calling them ever since. Payment wasnever charged — the gateway returns before settlement — but the caller pays a round trip to
learn the endpoint is gone, and the docstrings still advertised them as live Tier 1 endpoints.
Kept as raising stubs rather than deleted. Removing a public method breaks
from x importand attribute access on upgrade, and this is a patch release. They now raise a new, exported
RetiredEndpointErrornaming the sunset date andpm("markets/search", q=...)as thereplacement — before any network I/O, on all four client surfaces (sync + async × HTTP +
Solana).
pm_sports_categories/pm_sports_marketskeep working but gain a warning: everysports/*path returns a consistent upstream
500as of 2026-08-04. That is a partner bug, not a sunset,so the helpers stay callable for whenever it recovers.
Companion changes: BlockRunAI/blockrun#336 (gateway), BlockRunAI/awesome-blockrun#33 (docs).
451 unit tests pass, including 8 new ones pinning that the stubs raise rather than call.