Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
db07f78 to
d2fdccf
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #50505
Type of change
What does this PR do?
The web UI fails to open large sessions with
ClientError: Transport/TypeError: Load failed: the server writes the session's message list as one big body via a singleres.end(body), and under Bunserver.keepAliveTimeout(default 5s) destroys the socket while that body is still draining to a client reading slower than ~1 MB/s — afterend()there are no furtherwrite()calls to reset Bun's timer. Node is unaffected; chunkedHttpServerResponse.streamresponses are unaffected. Details and repro in #50505.This PR sets
server.keepAliveTimeout = 0on thecreateServer()instance inbind(), so in-flight responses are never cut mid-body.How did you verify your code works?
Against
opencode servefrom source, fetching a ~9.5 MB session response with a throttled client (curl --limit-rate 600K):curl: (18) transfer closed with 3968156 bytes remaining to read(~9.5 s)bytes=9517142 time=16.2sAlso verified with a minimal Bun +
@effect/platform-noderepro (no opencode code): killed at ~9 s before the change, completes after.bun run testin packages/server: 58 pass, 0 fail.Screenshots / recordings
Not a UI change.
Checklist