Repository navigation
docs(configuration): document total_timeout, ws_ping_interval, ws_close_timeout, allow_unknown_host - #304
Conversation
…se_timeout, allow_unknown_host Closes #300.
Code Review — PR #304Overview: Documentation-only PR that adds 4 missing Accuracy ✅All defaults have been verified against
The URL validation correction ("Unknown hosts log a warning" → "Unknown hosts are rejected by default") matches the actual code path at Issues1. In Suggestion: move the 2. Vague opt-in wording in
"Opt out via the field" is ambiguous — a reader skimming the table doesn't know which value to set. Suggest: 3. Quick-reference code block not updated (informational) The code block at the top of the doc still doesn't include the 4 new fields. This is probably intentional (it's meant as a common-case example, not exhaustive), but if someone looks there first they won't find SummaryThe core content is correct — defaults verified, rejection behavior accurately documented. Two minor wording/ordering nits worth addressing before merge, but nothing blocking. |
…fy allow_unknown_host opt-in Bot-review follow-up on #304: - Move `total_timeout` row up next to `retry_max_delay` so retry-related knobs stay grouped. - Reword `allow_unknown_host` description from ambiguous "Opt out via the field" to explicit "Set `allow_unknown_host=True` or `KALSHI_ALLOW_UNKNOWN_HOST=1` to allow it".
|
Thanks @claude. Addressed both nits in 2-line follow-up:
Skipping nit #3 (extending the quick-reference code block). That block is intentionally a common-case example, not exhaustive — adding a defensive |
|
Claude finished @TexasCoding's task in 41s —— View job Re-review — PR #304
Both nits from the first pass are confirmed resolved: Nit 1 — Nit 2 — Nit 3 — Quick-reference code block (intentionally skipped) LGTM. The doc is accurate, the retry knobs stay grouped, and the host-allow opt-in is now unambiguous. Ready to merge. |
Code Review — PR #304: docs(configuration): add missing KalshiConfig fieldsOverview: Documentation-only patch that adds four fields ( Accuracy (verified against
|
| Field | Doc says | Code says |
|---|---|---|
total_timeout |
None |
float | None = None ✅ |
ws_ping_interval |
20.0 |
float = 20.0 ✅ |
ws_close_timeout |
5.0 |
float = 5.0 ✅ |
allow_unknown_host |
False |
bool = False ✅ |
Descriptions are also accurate. The allow_unknown_host row correctly captures both the per-instance flag and the KALSHI_ALLOW_UNKNOWN_HOST=1 env-var escape hatch.
Suggestions
Minor — table row ordering: ws_ping_interval and ws_close_timeout are placed after limits in the table, but in the dataclass they appear before rest_json_loads / ws_json_loads / ws_json_dumps. The pre-existing table already had those three rows in a different order than the dataclass, so this isn't a regression you introduced. If you want to fix the full ordering in a follow-up (or squash it in here), the correct dataclass order after http2 is:
limits → ws_ping_interval → ws_close_timeout → rest_json_loads → ws_json_loads → ws_json_dumps → allow_unknown_host
Up to you — the current placement is readable and not wrong.
Nit — quick-reference code block not updated: The ## Quick reference snippet at the top still shows only http2 and limits as the "advanced" options. It doesn't need to show all four new fields (they're less commonly set), but total_timeout is probably the most user-facing of the four given the retry docs link. Consider adding a comment line there if you think users will look for it. Not a blocker.
URL-validation prose
The rewrite from:
"Unknown hosts log a warning…"
to:
"Unknown hosts are rejected by default; opt in via
allow_unknown_host… orKALSHI_ALLOW_UNKNOWN_HOST=1."
is accurate and better. The old text described the pre-v2.5 behavior; this one describes current behavior and cross-links to the table row.
Verdict
Accurate, minimal, and directly closes #300. The ordering note above is cosmetic and can be addressed separately. Happy to approve as-is.
|
Round-2 review notes:
Merging. |
Closes #300.
Four
KalshiConfigfields had docstrings but were missing from the at-a-glance reference table indocs/configuration.md:total_timeout— wall-clock cap across all retries (Retry: cap total wall-clock budget; no per-request deadline today (~180s worst case) #193)ws_ping_interval— heartbeat tuningws_close_timeout— clean-close graceallow_unknown_host— host allowlist gate (Config: unknown base_url host only warns — typo silently signs to attacker #250, v2.5)Also tightened the URL validation prose bullet so it states the new default-reject behavior and points readers at the table row instead of repeating the description.
No code touched.
Part of the post-v2.5 audit closure (Wave W0 docs).