Skip to content

docs(configuration): reference table missing total_timeout, ws_ping_interval, ws_close_timeout, allow_unknown_host #300

Closed

Description

@TexasCoding

Summary

The KalshiConfig field reference table in docs/configuration.md:32-46 omits four documented dataclass fields:

Missing field Default Source
total_timeout None kalshi/config.py
ws_ping_interval 20.0 kalshi/config.py
ws_close_timeout 5.0 kalshi/config.py
allow_unknown_host False kalshi/config.py (added in #250, v2.5)

allow_unknown_host is partially covered by the prose under URL validation (lines 66-77) but is not in the at-a-glance reference table users actually skim. The other three predate v2.5 but have never appeared in the reference table.

Users reaching for total_timeout (the wall-clock retry budget #193 introduced) or ws_ping_interval (heartbeat tuning) currently have to discover them by reading the dataclass source — defeats the purpose of the doc page.

Suggested fix

Append these rows to the table at docs/configuration.md:46:

| `total_timeout` | `None` | Wall-clock cap (seconds) across the whole request including all retries. `None` = unbounded; cap with the per-attempt `timeout` only. See [Retries & idempotency](retries.md). |
| `ws_ping_interval` | `20.0` | Seconds between WebSocket pings (forwarded to the `websockets` library). |
| `ws_close_timeout` | `5.0` | Seconds to wait for a clean WebSocket close handshake before forcing the socket shut. |
| `allow_unknown_host` | `False` | When `False`, the SDK rejects `base_url` / `ws_base_url` whose host is not in the known-Kalshi allowlist (`api.elections.kalshi.com`, `demo-api.kalshi.co`) or a loopback host. Opt out via the field or `KALSHI_ALLOW_UNKNOWN_HOST=1` if you target a custom proxy. (Added in v2.5.0 #250.) |

Optionally tighten the URL validation section to point at the new allow_unknown_host row instead of repeating its description.

Discovered by

Post-v2.5 multi-reviewer audit (Docs / configuration reference surface).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions