Skip to content

chat: defer docstrings quote the current 1 s poll interval default - #236

Open
deanrie wants to merge 1 commit into
xai-org:mainfrom
deanrie:defer-interval-docs
Open

deanrie wants to merge 1 commit into
xai-org:mainfrom
deanrie:defer-interval-docs

Conversation

@deanrie

@deanrie deanrie commented Oct 23, 2026 •

Copy link
Copy Markdown

What

PollTimer has defaulted interval to 1 second since #98 (48adaab, 2026-02-17), which raised it from 100 ms. The six docstrings that restate that default were not touched: defer, defer_batch and _defer in both sync/chat.py and aio/chat.py still say

interval: Optional interval between polling attempts, defaults to 100 milliseconds.

A caller who reads the docstring and leaves interval= unset polls ten times less often than documented. The sibling timeout line ("defaults to 10 minutes") is correct.

Change

The six lines now read "defaults to 1 second". No code change.

Test

tests/poll_defaults_test.py pins the PollTimer() defaults (1 s interval, 10 min timeout) and checks that each of the six docstrings quotes the value PollTimer actually uses, so the next change to the default fails a test instead of drifting again. Six of the seven cases fail on main; ruff and pyright are clean.

@deanrie
deanrie requested a review from a team as a code owner October 23, 2026 18:15
xai-org#98 (2026-02-17) changed PollTimer's default interval from 100 ms to 1 s
but left the six defer / defer_batch / _defer docstrings in sync/chat.py
and aio/chat.py saying "defaults to 100 milliseconds". A caller who
reads the docstring and skips interval= polls ten times less often than
documented.

tests/poll_timer_test.py pins the PollTimer defaults and checks that the
six docstrings state the value PollTimer actually uses, so the next
change to the default fails a test instead of drifting again.
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.

1 participant