Repository navigation
feat(communications): allowed_leg_misses + X-Retry-After + 2026-12-01 spec sync (#592) — 22.18.0 - #593
Merged
Conversation
…fer status, perps market fields (#592) — 22.18.0
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.
Closes #592
Reconciles the 2026-11-30 / 2026-12-01 spec drift (OpenAPI 3.38.0 content change; AsyncAPI and perps specs also changed in content). Additive only — releases as 22.18.0 (minor).
Spec changes → SDK
allowed_leg_misses(int ≥ 0, optional):RFQ,Market,CreateQuoteRequest,CreateRFQBatchQuoteRequest; WSRfqCreatedPayloadand new typedRfqBatchCreatedPayload. Quote create (quotes.create,rfq_batches.quotes.create, sync + async, plus deprecated forwarders) take keyword-onlyallowed_leg_misses=, sent only when set.IntraExchangeInstanceTransferStatusgainsfailed.X-Retry-After:_parse_retry_afterfalls back toX-Retry-AfterwhenRetry-Afteris absent;KalshiConflictError.retry_afteris populated. POST still never retried; 409 still not retryable.MarginMarket: optionalexpiration_ts,taker_long_volume_24h,taker_short_volume_24h.MultivariateEventCollection.is_orderedlegacy (always false, kept), perps transfer is Predictions↔Perps (not for FCM/self-clearing members), perps settlement/liquidation mark-price wording, perps tickerallOf[$ref]wrapping (no code change). AsyncAPI's optional binary SBE subprotocol is not implemented (SDK stays JSON).Blast radius (manual; GitNexus not installed)
_parse_retry_afteris shared by all error mapping: behavior only differs whenRetry-Afteris absent andX-Retry-Afteris present. 409 now carriesretry_after; the retry loop's retryable-status set is unchanged, so no new retries.extra="forbid"; new field isNoneby default and dropped byexclude_none, so existing request bodies are byte-identical.IntraExchangeInstanceTransferStatusLiteralwidened (Literal superset) — type-check only impact for exhaustive matches.Gates
uv run ruff check .✅uv run mypy kalshi/✅uv run pytest tests/ --ignore=tests/integration -q✅ 5500 passed, 3 skippeduv run pytest tests/test_contracts.py -W error::UserWarning✅ 1009 passed