-
-
Notifications
You must be signed in to change notification settings - Fork 225
Conversation
realfishsam
commented
Jun 11, 2026
Maintenance automation note: local validation passed for this generated exchange-wrapper cleanup:
npm run generate:python-exchanges --workspace=pmxt-core✅grep -q "class Router(Exchange)" sdks/python/pmxt/_exchanges.py && exit 1 || true✅grep -q "from .router import Router" sdks/python/pmxt/__init__.py✅python3 -m py_compile sdks/python/pmxt/_exchanges.py sdks/python/pmxt/__init__.py✅git diff --check✅
CI is currently blocked by repository-wide generated client/API reference drift unrelated to this PR. The in-scope _exchanges.py generation check is green.
realfishsam
commented
Jun 11, 2026
PR Review: FAIL
What This Does
Removes the generated Python _exchanges.Router class so pmxt.Router comes only from pmxt.router.Router. This matters to Python SDK consumers because the PR also regenerates exchange constructors.
Blast Radius
Python SDK package exports and generated exchange convenience constructors (sdks/python/pmxt/__init__.py, _exchanges.py, and core/scripts/generate-python-exchanges.js). No core sidecar behavior is changed.
Consumer Verification
Before (base branch):
Python consumers could use hosted constructor options on generated venue classes, e.g. pmxt.Polymarket(pmxt_api_key=..., wallet_address=..., signer=...); the base Exchange.__init__ supports wallet_address and signer.
After (PR branch):
The PR branch generated Polymarket.__init__ at sdks/python/pmxt/_exchanges.py:13-24 and Opinion.__init__ at sdks/python/pmxt/_exchanges.py:283-291 without wallet_address or signer, and the super-call at sdks/python/pmxt/_exchanges.py:39-48 no longer passes them. A consumer using hosted reads/writes through the convenience constructors will hit TypeError: __init__() got an unexpected keyword argument 'wallet_address' before the base client can route hosted requests.
Test Results
- Build: PASS (
npm run build --workspace=pmxt-core) - Core unit tests: PASS (27 suites / 652 tests passed; 1 suite / 3 tests skipped)
- Python syntax: PASS (
py_compileon changed Python files) - Full
npm test: FAIL in this checkout during Python SDK collection becausepmxt_internal/eth_accountare not available. - Server starts: N/A (SDK export/generator-only change)
- E2E smoke: FAIL by inspection for hosted Python constructor path described above
Findings
sdks/python/pmxt/_exchanges.py:13-24andsdks/python/pmxt/_exchanges.py:283-291-- the generator change removed the manual hostedwallet_address/signerconstructor parameters from Polymarket and Opinion while trying to drop only the generated router stub. Those venue wrappers no longer expose the base client's hosted wallet/signer path, so existing hosted-mode Python code that passeswallet_addressorsignerbreaks at construction time.
PMXT Pipeline Check
- Field propagation (3-layer): N/A
- OpenAPI sync: N/A
- Financial precision: N/A
- Type safety: ISSUE (Python convenience constructor signature regression)
- Auth safety: OK (no credential logging/exposure found)
Semver Impact
major as written -- it removes accepted Python constructor options for hosted Polymarket/Opinion clients.
Risk
Router export cleanup itself is reasonable, but the generator needs to preserve hosted constructor overrides before this is safe to merge.
Summary
pmxt._exchanges.Router(Exchange)stub; the realpmxt.router.Routerremains exported frompmxt.Fixes #976
Test Plan
npm run generate:python-exchanges --workspace=pmxt-coregrep -q "class Router(Exchange)" sdks/python/pmxt/_exchanges.py && exit 1 || truegrep -q "from .router import Router" sdks/python/pmxt/__init__.pypython3 -m py_compile sdks/python/pmxt/_exchanges.py sdks/python/pmxt/__init__.pygit diff --check