You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SDK drift: Python Exchange.__init__ has api_token parameter not present in TypeScript ExchangeOptions #469
The Python Exchange base class constructor accepts an api_token parameter that sends apiToken to the sidecar. TypeScript's ExchangeOptions interface has no corresponding field, so TypeScript callers have no way to pass this credential through the base class.
TypeScript SDK
sdks/typescript/pmxt/client.ts, lines 167–213 — ExchangeOptions interface (no apiToken field):
// sdks/typescript/pmxt/client.ts lines 167–213exportinterfaceExchangeOptions{exchange?: string;pmxtApiKey?: string;baseUrl?: string;apiKey?: string;apiSecret?: string;// ... other fields// apiToken is absent}
The TypeScript Exchange constructor passes ExchangeOptions to the sidecar via _getCredentialsDict() — apiToken is never included.
Python SDK
sdks/python/pmxt/client.py, line 263 — api_token in base class __init__:
_get_credentials_dict (client.py) then includes "apiToken": self._api_token when set, sending it to the sidecar with every request.
Metaculus (in _exchanges.py) is the concrete exchange that relies on this path.
Expected
ExchangeOptions in TypeScript should include an apiToken?: string field, and the TypeScript Exchange._getCredentialsDict() should include it when present — mirroring Python's behaviour. Alternatively, if api_token is purely a Metaculus-specific credential, it should be removed from the Python base class and handled only in the Metaculus subclass in both languages (with a dedicated constructor parameter).
Impact
TypeScript users of Metaculus cannot pass a bearer token through the base-class credential path. Python users can, creating an undocumented asymmetry. Any sidecar exchange handler that checks for apiToken in the credentials object will never receive it from TypeScript clients.
core/src/BaseExchange.ts:386 declares apiToken in ExchangeCredentials.
Because getCredentials() never returns apiToken, the sidecar always falls back to process.env.METACULUS_API_TOKEN only — there is no programmatic path to pass a token from TypeScript.
Additional context from duplicates #1384 and #1420 (later re-filings of this same finding):
The root cause is slightly deeper than just a missing field: Exchange.getCredentials() in sdks/typescript/pmxt/client.ts (~lines 464–474) never forwards apiToken even if the field existed, and Metaculus has no getCredentials() override to compensate.
core/src/server/exchange-factory.ts:110–114 confirms apiToken is the only credential field MetaculusExchange reads — without it the sidecar silently falls back to unauthenticated/env-var-only mode.
Current line references (as of late June): TS ExchangeOptions interface at client.ts:231–290, Python Exchange.__init__ at client.py:329 forwarding via _get_credentials_dict() at client.py:555–564, and Metaculus.__init__ forwarding at sdks/python/pmxt/_exchanges.py:341.
Impact also includes: the failure is silent (no compile/runtime error), so it specifically breaks programmatic/multi-tenant credential rotation and hosted-mode usage for Metaculus via the TypeScript SDK.
Closing as duplicate of #465. Both describe the same underlying credential-plumbing gap for the identical Python api_token parameter that only Metaculus currently uses. Relevant context has been copied over.
Activity
realfishsam commentedon Jun 28, 2026
Additional context from duplicate #1370 (filed 2026-06-28):
Detailed code path analysis showing exactly why TypeScript callers cannot pass an API token programmatically:
Root cause in TypeScript SDK:
sdks/typescript/pmxt/client.ts:231–290—ExchangeOptionshas noapiTokenfield.sdks/typescript/pmxt/client.ts:464–474—Exchange.getCredentials()never includesapiToken:sdks/typescript/pmxt/client.ts:3360–3364—Metaculusclass uses genericExchangeOptions.Core expects
apiToken:core/src/server/exchange-factory.ts:110–114:core/src/BaseExchange.ts:386declaresapiTokeninExchangeCredentials.Because
getCredentials()never returnsapiToken, the sidecar always falls back toprocess.env.METACULUS_API_TOKENonly — there is no programmatic path to pass a token from TypeScript.Generated by Claude Code
apiTokenconstructor parameter — authentication impossible #1370 as a duplicate of this issuerealfishsam commentedon Jun 30, 2026
Additional context from duplicates #1384 and #1420 (later re-filings of this same finding):
Exchange.getCredentials()insdks/typescript/pmxt/client.ts(~lines 464–474) never forwardsapiTokeneven if the field existed, andMetaculushas nogetCredentials()override to compensate.core/src/server/exchange-factory.ts:110–114confirmsapiTokenis the only credential fieldMetaculusExchangereads — without it the sidecar silently falls back to unauthenticated/env-var-only mode.ExchangeOptionsinterface atclient.ts:231–290, PythonExchange.__init__atclient.py:329forwarding via_get_credentials_dict()atclient.py:555–564, andMetaculus.__init__forwarding atsdks/python/pmxt/_exchanges.py:341.Generated by Claude Code
ExchangeOptionsmissingapiTokenandgetCredentials()does not forward it — Metaculus programmatic authentication broken #1384 as a duplicate of this issueExchange.__init__acceptsapi_tokenparameter absent from TypeScriptExchangeOptions#1420 as a duplicate of this issueMetaculususesapi_tokencredential param; TypeScript usesapiKey#465realfishsam commentedon Jul 3, 2026
Closing as duplicate of #465. Both describe the same underlying credential-plumbing gap for the identical Python
api_tokenparameter that only Metaculus currently uses. Relevant context has been copied over.Generated by Claude Code