Skip to content

Yield initial prediction output in polling iterators - #480

Open
jeeth-kataria wants to merge 1 commit into
replicate:mainfrom
jeeth-kataria:fix/polling-initial-output
Open

jeeth-kataria wants to merge 1 commit into
replicate:mainfrom
jeeth-kataria:fix/polling-initial-output

Conversation

@jeeth-kataria

Copy link
Copy Markdown

The polling iterators initialized their offset from the prediction’s current output. For a nonblocking run whose create response already contains ["Hello, "], an unchanged poll followed by ["Hello, ", "world!"] yielded only ["world!"]. Calling the iterator on an already-succeeded prediction yielded nothing.

Start each iterator’s offset at zero and advance it after yielding a snapshot. This delivers the initial items, skips repeated items on subsequent polls, and yields the final suffix. Both public run paths and the direct iterators are covered with mock HTTP responses, including a completed prediction that needs no further GET requests.

On upstream d2956ff the two initially-empty control cases passed and all three new regression cases failed. With the change the offline suite passed (161 passed, 6 skipped, cassette recording disabled). Codex assisted with implementation and testing.

Assisted-by: Codex
Signed-off-by: jeeth-kataria <172952299+jeeth-kataria@users.noreply.github.com>
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