Skip to content

SDK drift: TypeScript _tradingRequest has no HTTP timeout; Python _trading_request uses a 120-second timeout #1139

Description

@realfishsam

Summary

The hosted-mode HTTP helper functions differ in timeout behaviour between the two SDKs.

Python (sdks/python/pmxt/_hosted_routing.py, line 322):

request_kwargs: dict[str, Any] = {"headers": headers, "timeout": 120.0}

Every request (GET and POST) is given an explicit 120-second socket timeout via httpx.

TypeScript (sdks/typescript/pmxt/hosted-routing.ts, lines 153–157):

const resp = await fetch(url, {
    method: opts.method,
    headers,
    body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,
});

No signal / AbortSignal is passed to fetch, so the request inherits the runtime's default timeout (typically none, or platform-defined). Long-running requests — e.g. a build-order call that is slow to respond — will hang indefinitely in the TypeScript SDK.

Impact

  • A stalled order-build or order-submit request in the TypeScript SDK will block the caller forever with no error surfaced.
  • The Python SDK times out after 120 s and propagates an httpx.TimeoutException.

Expected behaviour

Both SDKs should enforce the same explicit per-request timeout (120 s matches the Python value, or a shared constant).

Files

SDK File Line
TypeScript sdks/typescript/pmxt/hosted-routing.ts 153
Python sdks/python/pmxt/_hosted_routing.py 322

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions