Repository navigation
fix(pi-runtime): extend model stream idle timeout to 30 minutes - #1351
Merged
Merged
Conversation
zhangjiadi225
marked this pull request as ready for review
October 17, 2026 09:12
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 this PR does
Before this PR: a model request with no substantive stream activity for 120 seconds was aborted, which could interrupt slow reasoning or a delayed first response.
After this PR: the default idle timeout is 30 minutes. Content and native web activity renew the timer, while credential switching shares the same waiting budget. Existing cancellation and retry behavior is preserved: Pi's default policy still retries a timed-out request up to three times, so a request that never produces data fails its turn after about two hours (four 30-minute attempts plus short backoff) unless the user stops it. The timeout tests and runtime documentation are updated accordingly.
Screenshots or videos
N/A — this changes request timing without changing the interface.
Why we need it and why it was done in this way
Give slower model responses more time to progress while retaining a finite limit for stalled requests. Stalled requests are expected to be stopped by the user; the retained retries make the automatic limit for a request that never produces data about two hours. Pi's retry policy cannot exclude this error by type, so the retries are kept rather than worked around. This only changes the existing timeout value; tool execution remains outside the timer and a turn has no overall time deadline.
Breaking changes
None.
Special notes for your reviewer
pnpm lint(existing warnings in unchanged files),pnpm format:check, andgit diff --check.Checklist
mainRelease note