Skip to content

Commit 7139df8

Browse files
fix(exec): preserve output after stdin EOF and verify stream completion (#3359)
* fix(exec): preserve output after stdin EOF and verify stream completion Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> * test(exec): cover fair duplex progress and live SDK completion Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> * test(sdk): compare large exec buffers with native equality Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> * test(exec): use workspace-scoped sandbox name in EOF regression Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> --------- Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
1 parent ca45735 commit 7139df8

17 files changed

Lines changed: 1442 additions & 149 deletions

File tree

‎architecture/gateway.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,26 @@ alone — instead an unanswered keepalive on a wedged or orphaned relay closes t
959959
channel and returns the exec with an error. Once a command reports its exit
960960
status, the gateway also bounds how long it waits for the trailing channel close.
961961

962+
Interactive exec treats normal request-stream EOF as the end of stdin and resize
963+
input. The gateway sends SSH EOF while keeping the output channel open until
964+
command completion. Input errors terminate the operation rather than masquerading
965+
as normal EOF. The input and output pumps are owned by the exec operation, so
966+
timeout or response abandonment cannot leave a detached stdin task behind.
967+
The pumps share polling fairly, and request processing yields cooperatively even
968+
for ignored resize messages, so sustained input cannot monopolize the operation.
969+
970+
Go and TypeScript interactive-exec helpers distinguish process exit from stream
971+
completion. They consume the final gRPC status before reporting success and retain
972+
an observed exit code if transport completion fails. Callers must drain output
973+
concurrently with waiting for completion.
974+
975+
TypeScript starts interactive exec eagerly and uses a bounded output queue between
976+
the background receiver and the consumer. Cancellation wakes a receiver blocked
977+
on that queue. Go exposes input closure through an optional session capability,
978+
preserving the original interface for existing implementations. TypeScript also
979+
preserves its original session interface; SDK-created sessions expose lifecycle
980+
controls through an extended interface.
981+
962982
`ForwardTcp` is the client-facing byte stream for SSH and service forwarding.
963983
The first frame is a `TcpForwardInit` that carries the workspace-scoped sandbox
964984
name, an authorization token from `CreateSshSession`, and an explicit target:

0 commit comments

Comments
 (0)