Repository navigation
fix: bound polling requests by the remaining timeout - #300
Open
Ricardo-M-L wants to merge 1 commit into
Open
Ricardo-M-L wants to merge 1 commit into
Ricardo-M-L wants to merge 1 commit into
Conversation
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.
Summary
Bound each polling HTTP request by the polling time remaining, while preserving a shorter configured request timeout.
The loop already bounds the sleep between requests, but an in-flight status request can outlive the entire remaining polling budget. For example, a 50 ms polling budget with a 1 s request timeout currently waits around 1 s when the server stalls. This is separate from the sleep fix in #283.
Changes
config.timeout.AbortSignal.timeout, correcting floating-point noise around whole milliseconds and rounding genuine fractional milliseconds down.TimeoutErrorandAbortErrorwhile reading both successful and HTTP-error response bodies. Malformed JSON retains the existing error mapping.This bounds the HTTP wait at the start of each polling iteration. It does not redesign OAuth credential refresh or claim a strict wall-clock deadline during credential resolution or event-loop blocking.
Validation
Base:
38aba5f26173dd1065b115b221d79c9ddd87c6bb.XDG_CONFIG_HOMEexpectation in editor configuration tests. Browser launcher commands were stubbed in both runs to avoid opening a browser; tests were not skipped.bun run typecheck,bun run lint, andbun run buildpass (lint retains one existing speechanywarning).AGENTS.md; confirmed first-round findings were fixed, and both second-round reviewers reported no blocking findings. Both independently ran the 37 HTTP/polling tests and native Node timeout checks.git diff --checkpasses.bun test test/polling/poll.test.ts test/client/http.test.ts test/commands/video/generate.test.ts test/sdk/video.test.ts bun run typecheck bun run lint bun run buildImplemented and tested with OpenAI Codex assistance. Independent reviews above were agent reviews, not a claim of maintainer or human approval.
Need help on this PR? Tag
@codesmith-botwith what you need.