Repository navigation
Conversation
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.
deanrie
force-pushed
the
defer-interval-docs
branch
from
October 24, 2026 08:55
a346678 to
d185856
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PollTimerhas defaultedintervalto 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_batchand_deferin bothsync/chat.pyandaio/chat.pystill sayA caller who reads the docstring and leaves
interval=unset polls ten times less often than documented. The siblingtimeoutline ("defaults to 10 minutes") is correct.Change
The six lines now read "defaults to 1 second". No code change.
Test
tests/poll_defaults_test.pypins thePollTimer()defaults (1 s interval, 10 min timeout) and checks that each of the six docstrings quotes the valuePollTimeractually uses, so the next change to the default fails a test instead of drifting again. Six of the seven cases fail onmain;ruffandpyrightare clean.