-
-
Notifications
You must be signed in to change notification settings - Fork 225
fix(sdk): preserve hosted client generator overrides#1015
Conversation
realfishsam
commented
Jun 11, 2026
PR Review: PASS (NOT VERIFIED)
What This Does
Updates SDK client-method generators so regeneration preserves hand-maintained hosted-mode dispatch overrides, and syncs generated API reference docs. This reduces accidental drift when BaseExchange-derived SDK methods are regenerated.
Blast Radius
Python and TypeScript SDK generator scripts plus generated API reference markdown. Runtime SDK clients are intended to remain stable.
Consumer Verification
Before (base branch):
Running the client-method generators could overwrite hosted-mode methods inside the generated region, dropping custom hosted dispatch/guards unrelated to the generator change.
After (PR branch):
I ran both changed generators locally:
node sdks/python/scripts/generate-client-methods.jsnode sdks/typescript/scripts/generate-client-methods.js
After both commands, git diff -- sdks/python/pmxt/client.py sdks/typescript/pmxt/client.ts was empty, so the preservation logic is stable for the current clients.
Test Results
- Build: PASS (
npm run build --workspace=pmxt-core) - Core unit tests: PASS (27 suites / 652 tests passed; 1 suite / 3 tests skipped)
- Generator idempotence: PASS for Python and TypeScript client generators (no diff after rerun)
- Full
npm test: FAIL in this checkout during Python SDK collection becausepmxt_internal/eth_accountare not available. - Server starts: N/A (generator/docs change)
- E2E smoke: N/A (not directly API-observable)
Findings
No blocking findings.
PMXT Pipeline Check
- Field propagation (3-layer): N/A
- OpenAPI sync: N/A
- Financial precision: N/A
- Type safety: OK for generator idempotence; runtime client code unchanged by rerun
- Auth safety: OK (no credential handling changes)
Semver Impact
patch -- generator/docs hygiene preserving existing SDK behavior.
Risk
The preservation parser is string-based, so future formatting changes around generated method declarations could need generator tests, but the current PR is idempotent on the checked-in clients.
Uh oh!
There was an error while loading. Please reload this page.
Summary
npm run generate:docs --workspace=pmxt-coreso the API reference check is clean.Unblocks
Investigation
Verify client.py methods are up-to-date/Verify client.ts methods are up-to-datejobs regenerate the client method blocks fromBaseExchange.ts.cancel_order,fetch_order,fetch_open_orders,fetch_my_trades,fetch_closed_orders,fetch_all_orders,fetch_positions,fetch_balance.submitOrder,cancelOrder,fetchOrder,fetchOpenOrders,fetchMyTrades,fetchClosedOrders,fetchAllOrders,fetchPositions,fetchBalance.Validation
node --check sdks/python/scripts/generate-client-methods.jsnode --check sdks/typescript/scripts/generate-client-methods.jsnode sdks/python/scripts/generate-client-methods.jsnode sdks/typescript/scripts/generate-client-methods.jsgit diff --exit-code -- sdks/python/pmxt/client.py sdks/typescript/pmxt/client.tsnpm run generate:docs --workspace=pmxt-corepython3 -m py_compile sdks/python/pmxt/client.py sdks/python/pmxt/_hosted_routing.py sdks/python/pmxt/models.pynpm run build --workspace=pmxt-coreCommands run but not committed
npm run generate:openapi --workspace=pmxt-corewas tried before and afternpm run build --workspace=pmxt-core; it produced broad OpenAPI/version/scope drift unrelated to this fix, so generated OpenAPI files were reset.python3 -m pytest -q sdks/python/tests/test_hosted_dispatch.pycould not run becausepytestis not installed in this environment.npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-dispatch.test.tsandnpm run build --workspace=pmxtjscould not run becausesdks/typescript/generated/src/index.jsis absent.npm run generate:sdk:typescript --workspace=pmxt-corecould not generate the missing TS SDK because Java is not installed.