authorgravatar for 71498452+StiensWout@users.noreply.github.comWout Stiens <71498452+StiensWout@users.noreply.github.com> 2026-10-10 04:57:34+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-09 23:57:34-03:00
log0981e6b9d421ec46010d9b9edebd0beb241ef472
tree6efa8a378492a972423d359d8b84ab5bf6674171
parentb822420e5074d750e7258ea48568666720cf0415
signature Signed by PGP key B5690EEEBB952194

perf(server): keep passive terminal output flowing (#17178)


2 files changed, 3 insertions(+), 0 deletions(-)

apps/server/src/terminal/OutputProtocol.test.ts+2
...@@ -13,8 +13,10 @@ import { withTerminalOutputWindow } from "./OutputProtocol.ts";...@@ -13,8 +13,10 @@ import { withTerminalOutputWindow } from "./OutputProtocol.ts";
13describe("terminal output window", () => {13describe("terminal output window", () => {
14 it.effect.each([14 it.effect.each([
15 { tag: WS_METHODS.terminalAttach, size: 1, limit: 8 },15 { tag: WS_METHODS.terminalAttach, size: 1, limit: 8 },
16 { tag: WS_METHODS.terminalObserve, size: 1, limit: 8 },
16 { tag: WS_METHODS.subscribeTerminalEvents, size: 1, limit: 8 },17 { tag: WS_METHODS.subscribeTerminalEvents, size: 1, limit: 8 },
17 { tag: WS_METHODS.terminalAttach, size: 64 * 1024, limit: 1 },18 { tag: WS_METHODS.terminalAttach, size: 64 * 1024, limit: 1 },
19 { tag: WS_METHODS.terminalObserve, size: 64 * 1024, limit: 1 },
18 { tag: WS_METHODS.subscribeTerminalMetadata, size: 1, limit: 1 },20 { tag: WS_METHODS.subscribeTerminalMetadata, size: 1, limit: 1 },
19 ])("limits $tag with $size-byte values to $limit pending chunks", ({ tag, size, limit }) =>21 ])("limits $tag with $size-byte values to $limit pending chunks", ({ tag, size, limit }) =>
20 Effect.gen(function* () {22 Effect.gen(function* () {
apps/server/src/terminal/OutputProtocol.ts+1
...@@ -22,6 +22,7 @@ export function withTerminalOutputWindow(...@@ -22,6 +22,7 @@ export function withTerminalOutputWindow(
22 if (22 if (
23 message._tag === "Request" &&23 message._tag === "Request" &&
24 (message.tag === WS_METHODS.terminalAttach ||24 (message.tag === WS_METHODS.terminalAttach ||
25 message.tag === WS_METHODS.terminalObserve ||
25 message.tag === WS_METHODS.subscribeTerminalEvents)26 message.tag === WS_METHODS.subscribeTerminalEvents)
26 ) {27 ) {
27 const key = `${clientId}:${message.id}`;28 const key = `${clientId}:${message.id}`;