mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 12:42:17 +00:00
docs(server): explain why HTTP API PTY handler has no early-frame buffer (#26464)
This commit is contained in:
parent
dcb8ed8eb0
commit
96bde05f6e
1 changed files with 6 additions and 0 deletions
|
|
@ -153,6 +153,12 @@ export const ptyConnectRoute = HttpRouter.use((router) =>
|
|||
return HttpServerResponse.empty()
|
||||
}
|
||||
|
||||
// No `pending[]`-style early-frame buffer (the legacy Hono handler had one).
|
||||
// `request.upgrade` returns a Socket without running the WS handshake; the
|
||||
// handshake fires inside `socket.runRaw` below, AFTER `pty.connect` resolves
|
||||
// and the message callback is registered. The client therefore can't fire
|
||||
// `open` and start sending until the listener is already wired. Don't move
|
||||
// `runRaw` ahead of `pty.connect` without re-introducing a buffer.
|
||||
yield* socket
|
||||
.runRaw((message) => handlePtyInput(handler, message))
|
||||
.pipe(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue