Skip to content

fix(web): bound browser request duration - #377

Closed
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:fix/issue-363-web-request-timeout
Closed

fix(web): bound browser request duration#377
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:fix/issue-363-web-request-timeout

Conversation

@seekskyworld

Copy link
Copy Markdown
Contributor

Problem

Adds the request-timeout slice of #363. A stalled /api/prompt fetch could leave the composer admission state pending indefinitely and make later input appear unresponsive.

Value

The browser receives a bounded failure instead of waiting forever when the Web host or transport is unavailable.

Approach

Apply a 30-second AbortController deadline to the shared api() helper and always clear the timer, including failed requests. Callers retain their existing error handling.

Validation

  • git diff --check

Impact

  • User-visible behavior: stalled requests now fail visibly after a bounded period.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: browser transport only.
  • Persisted config/data: none.
  • Compatibility/risk: additive timeout; callers may display the browser abort error.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要改:30s abort 挂在所有 api()

web/ui/app.js 的共享 api() 给每一次 fetch 都加了 30s AbortController。长 prompt 会在浏览器被掐掉,host 上的 turn 还在跑,UI 和运行时会拆开。

准入超时是对的,全局超时不是。请看 #370:默认超时可以留着,但 /api/prompt 的 admission 才应该用短超时;进行中的 turn 不要被浏览器单方面 abort。

建议关掉本 PR,或把超时从共享 api() 拿掉,改走 #370 的准入缝。

tt-a1i added a commit that referenced this pull request Sep 7, 2026
…utions (#439)

Restore the clipboard fallback from #352 in React with honest failure feedback, focus and selection restoration, and cleanup. Keep current exact-turn cancellation and request deadlines, and add timeout regression coverage inspired by #377. Credit the original #352, #377, and #358 contributions in README.

Closes #438

Co-authored-by: QuinnWan <144975606+somewan820@users.noreply.github.com>
Co-authored-by: seekskyworld <djh1813553759@gmail.com>
@tt-a1i

tt-a1i commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

The request deadline goal is implemented by the current React client. #439 adds body-stall and cleanup regressions and credits seekskyworld in README and as a recognized co-author of main commit 41c59d4. Closing the overlapping legacy implementation.

@tt-a1i tt-a1i closed this Sep 7, 2026
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.

2 participants