Skip to content

feat(communications): allowed_leg_misses + X-Retry-After + 2026-12-01 spec sync (#592) — 22.18.0 - #593

Merged
TexasCoding merged 2 commits into
mainfrom
fix/592-spec-drift-2026-11-30
Dec 1, 2026
Merged

TexasCoding merged 2 commits into
mainfrom
fix/592-spec-drift-2026-11-30

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

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

  • Combo allowed_leg_misses (int ≥ 0, optional): RFQ, Market, CreateQuoteRequest, CreateRFQBatchQuoteRequest; WS RfqCreatedPayload and new typed RfqBatchCreatedPayload. Quote create (quotes.create, rfq_batches.quotes.create, sync + async, plus deprecated forwarders) take keyword-only allowed_leg_misses=, sent only when set.
  • IntraExchangeInstanceTransferStatus gains failed.
  • Quote-create 409 X-Retry-After: _parse_retry_after falls back to X-Retry-After when Retry-After is absent; KalshiConflictError.retry_after is populated. POST still never retried; 409 still not retryable.
  • Perps MarginMarket: optional expiration_ts, taker_long_volume_24h, taker_short_volume_24h.
  • Docs/docstrings only: MultivariateEventCollection.is_ordered legacy (always false, kept), perps transfer is Predictions↔Perps (not for FCM/self-clearing members), perps settlement/liquidation mark-price wording, perps ticker allOf[$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_after is shared by all error mapping: behavior only differs when Retry-After is absent and X-Retry-After is present. 409 now carries retry_after; the retry loop's retryable-status set is unchanged, so no new retries.
  • Request models keep extra="forbid"; new field is None by default and dropped by exclude_none, so existing request bodies are byte-identical.
  • All new response fields are optional; existing payloads parse unchanged.
  • IntraExchangeInstanceTransferStatusLiteral widened (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 skipped
  • uv run pytest tests/test_contracts.py -W error::UserWarning ✅ 1009 passed

@TexasCoding
TexasCoding merged commit fe108aa into main Dec 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec drift 2026-11-30: openapi 3.38.0 [content-changed] (paths 123→123, fp 823b23c5)

1 participant