Skip to content

feat(cli): stream non-TTY exec input before EOF - #3803

Open
shiju-nv wants to merge 6 commits into
NVIDIA:mainfrom
shiju-nv:feat/non-tty-streaming-exec
Open

shiju-nv wants to merge 6 commits into
NVIDIA:mainfrom
shiju-nv:feat/non-tty-streaming-exec

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add sandbox exec --stream-stdin so a client can exchange requests and responses with one remote process before closing stdin. The flag skips the default 200 ms piped-input grace period, disables TTY allocation, and keeps stdout and stderr separate.

Related Issue

Closes #3802.

Changes

  • Reuse the bidirectional exec RPC for immediate streaming, preserving default piped-input behavior from current main.
  • Apply the 4 MiB total stdin limit to both streaming paths. Cancel on overflow and warn that earlier input may already have been processed.
  • Distinguish clean stdin EOF from input failures, drain output through the final gRPC status, and never automatically retry an interrupted command.
  • Update the sandbox guide and CLI guidance, with regressions for grace-period input, cancellation, and transport failures.

Testing

  • Checks appropriate to the affected code and behavior pass locally: CLI package check, formatting, license headers, documentation lint, and focused helper, parser, and subprocess tests.
  • Unit tests added/updated.
  • E2E tests added/updated. The existing lifecycle cases are unchanged by this merge; fresh driver execution is tracked by hosted CI.

The final local candidate passed 30 focused tests and independent Gator-lens review. Hosted checks for the pushed head are tracked on this PR.

Checklist

  • Follows Conventional Commits.
  • Commits are signed off (DCO).
  • User-facing sandbox documentation and CLI guidance updated.

Add --stream-stdin using the existing interactive exec RPC without a PTY. Preserve separate output streams and enforce the existing 4 MiB cumulative input cap while forwarding input.

Require explicit clean stdin EOF and drain the response through its final gRPC status. Cover held-open input, limits, cancellation, trailers, and default finite-input behavior with subprocess and live sandbox regressions.

Signed-off-by: Shiju <shiju@nvidia.com>
Treat transport termination and response cancellation as separate test observations. Verify explicit stdin EOF through the shared frame writer and cover cancellation in the pinned Tonic decoder.

Signed-off-by: Shiju <shiju@nvidia.com>
Preserve upstream removal of obsolete architecture documents and retain streaming guidance in the published sandbox documentation.

Signed-off-by: Shiju <shiju@nvidia.com>
@johntmyers johntmyers added gator:in-review Gator is reviewing or awaiting PR review feedback test:e2e Requires end-to-end coverage labels Sep 29, 2026

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

This concentrated CLI feature is project-valid through linked issue #3802. The initial full-diff review found no blocking defects, and the user-facing command documentation and public CLI skill are updated.

Blocking findings:

  • No blocking findings remain

Carried findings:

  • None

Non-blocking suggestions:

  • None
Gator metadata
  • Validation: Linked issue #3802 defines the user path, failure semantics, input limit, and acceptance criteria; duplicate search found no overlapping work.
  • Docs: Fern sandbox documentation and the public CLI skill are updated for --stream-stdin.
  • Checks: Existing current-head branch, Helm, Trivy, and DCO gates are green; E2E dispatch is still being evaluated after label application.
  • E2E: test:e2e applied because sandbox execution behavior changed; E2E Label Help is running.
  • Head SHA: 1ca240f5d879b721d00782393e8f6af77d52ebc7
  • Base SHA: 33a8eac196a21aff3125dea46462a4591bcb5d0b
  • Merge base SHA: 33a8eac196a21aff3125dea46462a4591bcb5d0b
  • Patch ID: 20ec711c4a8a2d7516b076ee7739e1879626e64a
  • Gator payload: 9
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

@github-actions

Copy link
Copy Markdown

Label test:e2e applied for 1ca240f. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:blocked Gator is blocked by process or repository gates gator:approval-needed Gator completed review; maintainer approval needed and removed gator:in-review Gator is reviewing or awaiting PR review feedback gator:watch-pipeline Gator is monitoring PR CI/CD status gator:blocked Gator is blocked by process or repository gates gator:approval-needed Gator completed review; maintainer approval needed labels Sep 29, 2026
Merge current main while preserving immediate non-TTY streaming, the cumulative input cap, explicit stdin EOF, and final transport-status handling. Share the bounded writer with grace-period input and cover both rejection and cancellation paths.

Signed-off-by: Shiju <shiju@nvidia.com>
Signed-off-by: Shiju <shiju@nvidia.com>

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

The follow-up review of the author-owned reconciliation with current main found no blocking defects. The direct CLI UX remains documented, and the required E2E workflow is queued on this head.

Blocking findings:

  • No blocking findings remain

Carried findings:

  • None
Gator metadata
  • Validation: Linked issue #3802 defines the supported user path and acceptance criteria.
  • Docs: Fern sandbox documentation and the public CLI skill cover --stream-stdin and the reconciled default grace-period behavior.
  • Checks: Current-head Branch Checks, Helm, and E2E gates are pending; Trivy and DCO are green.
  • E2E: test:e2e is applied and the current-head E2E workflow is queued.
  • Head SHA: 6ccda0b3e21d617287403d0569ace836e9f93315
  • Base SHA: 71440b28f48d5fefc569d779f70d6e63893aa80a
  • Merge base SHA: 71440b28f48d5fefc569d779f70d6e63893aa80a
  • Patch ID: 22bd11caa58c9dc83f24c6ac1730cefa03748012
  • Gator payload: 9
  • Review mode: follow_up
  • Previous reviewed SHA: 1ca240f5d879b721d00782393e8f6af77d52ebc7
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status and removed gator:blocked Gator is blocked by process or repository gates labels Oct 1, 2026
Signed-off-by: Shiju <shiju@nvidia.com>

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

The follow-up review of the one-line author delta found no blocking defects. The change only uses the existing Duration import in the stdin EOF regression, and current-head E2E is running.

Blocking findings:

  • No blocking findings remain

Carried findings:

  • None
Gator metadata
  • Validation: Linked issue #3802 defines the supported CLI user path and acceptance criteria.
  • Docs: Fern sandbox documentation and the public CLI skill already cover --stream-stdin; this test-only delta needs no documentation change.
  • Checks: Current-head Branch Checks, Helm, Trivy, and DCO gates are green; E2E remains in progress.
  • E2E: test:e2e is applied and current-head workflow run 36901566572 is in progress.
  • Head SHA: 5123ffb29a35172407a531855693c8e58d19646f
  • Base SHA: 71440b28f48d5fefc569d779f70d6e63893aa80a
  • Merge base SHA: 71440b28f48d5fefc569d779f70d6e63893aa80a
  • Patch ID: e3f7e972cfb405803149746b50d9312c95b3e15f
  • Gator payload: 9
  • Review mode: follow_up
  • Previous reviewed SHA: 6ccda0b3e21d617287403d0569ace836e9f93315
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:approval-needed Gator completed review; maintainer approval needed and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Oct 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:approval-needed Gator completed review; maintainer approval needed test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream exec stdin without a TTY

2 participants