feat(streams)!: define forwarding and relay lifecycle - #3669
varshaprasad96 wants to merge 3 commits into
Conversation
Preserve directional EOF across ForwardTcp, RelayStream, and PeerRelay. Negotiate response FIN support, propagate downstream legacy limitations, and preserve typed aborts through owned bridges and session-scoped relays. Update CLI forwarding, generated bindings, documentation, and regressions. BREAKING CHANGE: malformed post-init frames now fail explicitly, relay I/O and trailer failures reach callers, and RelayClose actively aborts its owned operation. Negotiated streams wait for both directions to finish. Wire additions remain capability-gated; existing SDK Close meanings stay unchanged. Flag these behavioral changes for release review, particularly if the merge occurs after September 25, 2026. Validation: lifecycle regressions, gateway and supervisor tests, Python and TypeScript tests, and Go SDK CI passed. Full-suite validation is blocked by missing e2fsprogs for five VM tests. Docker E2E is blocked by read-only BuildKit storage before fixture creation. Refs NVIDIA#3056 Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Preserve legacy relay replies and wait for downstream completion after FIN. Keep established data relays alive across control-session loss, authenticate forwarding E2E requests, and add lifecycle regression coverage. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Combine upstream supervisor shutdown tracking and SSH recovery imports with relay lifecycle handling. Refresh the public API fingerprint while preserving durable schema fingerprints. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
| For protocols that send EOF before receiving a reply, use `forward service` | ||
| and keep reading after closing the local socket's write direction. Independent | ||
| response FIN requires support throughout the CLI/gateway/supervisor path. See | ||
| [forwarding stream lifecycle](https://docs.nvidia.com/openshell/latest/reference/stream-lifecycle.md) | ||
| for mixed-version fallback, deadlines, and cancellation behavior. | ||
|
|
There was a problem hiding this comment.
Could you add reference/stream-lifecycle.mdx to docs/index.yml? The CLI skill links directly to its published .md endpoint, but Fern navigation is explicitly defined there. Without an entry, the page may be undiscoverable or absent from the published docs. Please also run mise run docs:build:strict to verify the link.
|
@varshaprasad96 I think there’s one case missing here. The caller can then wait for the full 10-second timeout, and the entry keeps counting against the pending limit until cleanup. Would it make sense to handle pending relays here too? Keep the current-session and sandbox checks, remove the matching entry, and |
Summary
Allow TCP forwarding and supervisor relays to close one byte direction while draining the other. Negotiate response FIN across the CLI, gateway peers, and supervisor, and preserve downstream final status so a later relay error does not appear as successful EOF.
Breaking behavior: malformed post-init frames now fail explicitly, relay failures propagate to callers,
RelayCloseactively aborts its owned operation, and negotiated streams wait for both directions to finish. The protobuf additions are capability-gated and existing SDKClosemeanings are unchanged. Flag these behavioral changes for release review, especially if merged after September 25, 2026.Related Issue
Refs #3056. Follow-up to #3359, covering
ForwardTcp,RelayStream, andPeerRelay. This does not close the broader issue: equivalent curated SDK lifecycle helpers and the remaining timeout/retry policy work are outside this slice.Changes
Testing
mise run pre-commitpasses, including the commit hook; final core Clippy check passes.mise run ciChecklist