Skip to content

Reconcile perps exit-trigger price drift (v16.0.1) - #523

Merged
TexasCoding merged 1 commit into
mainfrom
fix/521-perps-openapi-drift
Sep 28, 2026
Merged

TexasCoding merged 1 commit into
mainfrom
fix/521-perps-openapi-drift

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Summary

Closes #521.

Re-vendors upstream perps OpenAPI after a description-only drift on exit-trigger price fields (stop_loss_price / take_profit_price must be strictly positive when supplied). Aligns the three request models with that constraint via Field(default=None, gt=0) and bumps to 16.0.1.

Core OpenAPI / AsyncAPI / kalshi/_generated/ are unchanged. Response ExitTrigger is unchanged. Valid positive callers are unaffected; zero/negative values now raise ValidationError at construction (the server already rejected them).

Blast radius (GitNexus unavailable)

  • Touches only SetCrossExitTriggerRequest, SetIsolatedExitTriggerRequest, and UpdateExitTriggerRequest in kalshi/perps/models/portfolio.py.
  • Call sites: perps.portfolio.set_cross_exit_trigger / update_cross_exit_trigger / set_isolated_exit_trigger (sync + async).
  • Contract maps already registered; no new endpoints.

Test plan

  • uv run ruff check .
  • uv run mypy kalshi/
  • uv run pytest tests/ --ignore=tests/integration -q (4594 passed)
  • New regressions for zero/negative/None/positive on the three request models
  • CI green on this PR

Note on #522

Nightly Spec Drift Detection failed at uv sync (PyPI timeout fetching click), not on contract tests. The report-failure job reproduced 838 passed. Leaving that tracker for the next green scheduled run.

Re-vendor perps OpenAPI and enforce gt=0 on optional
stop_loss_price/take_profit_price for the three exit-trigger
request models so the client matches the upstream "strictly
positive when supplied" constraint (Closes #521).
@TexasCoding
TexasCoding merged commit 6119daa into main Sep 28, 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-09-28: openapi 3.31.0 [content-changed] (paths 100→100, fp 2bc18169)

1 participant