Skip to content

fix(pi-runtime): extend model stream idle timeout to 30 minutes - #1351

Merged
zhangjiadi225 merged 1 commit into
mainfrom
zhangjiadi225/7fb3bf21
Oct 17, 2026
Merged

zhangjiadi225 merged 1 commit into
mainfrom
zhangjiadi225/7fb3bf21

Conversation

@zhangjiadi225

@zhangjiadi225 zhangjiadi225 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Passed pnpm lint (existing warnings in unchanged files), pnpm format:check, and git diff --check.
  • The updated tests cover survival past the old 120-second limit, expiry at 30 minutes, and the shared budget across credential attempts.
  • Tests, type checking, builds, and device verification were intentionally not run under the task's verification constraints.

Checklist

  • Branch: This PR targets main
  • PR: The description explains the behavior and tradeoff
  • Preview: The lack of screenshots is explained above
  • Code: The change is limited to the timeout, related tests, and documentation
  • Documentation: Runtime and provider-serving references are updated
  • Self-review: Reviewed the complete diff locally

Release note

Allow model responses up to 30 minutes without stream activity before a request times out and is retried, reducing interruptions during slow responses.

@zhangjiadi225
zhangjiadi225 marked this pull request as ready for review October 17, 2026 09:12
@zhangjiadi225
zhangjiadi225 merged commit d589125 into main Oct 17, 2026
8 checks passed
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