Skip to content

fix(cli): write exec stderr events to stderr in interactive mode#2407

Closed
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:fix-cli-exec-interactive-stderr/aw
Closed

fix(cli): write exec stderr events to stderr in interactive mode#2407
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:fix-cli-exec-interactive-stderr/aw

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

Summary

In interactive openshell exec, stderr payloads from the sandbox were written to stdout because the Stderr arm of the event loop was a verbatim copy of the Stdout arm (stdout.lock()). The non-interactive exec path in the same file handles the identical event with stderr.lock(). This broke shell redirection (e.g. openshell exec ... 2>err.txt) and piping of stdout in interactive mode.

Related Issue

N/A — small copy-paste fix found during code review.

Changes

  • Bind stderr in the interactive exec event loop and lock it in the Stderr arm, matching the non-interactive path

Testing

  • mise run pre-commit passes (mise unavailable in this environment; ran equivalent cargo fmt + cargo clippy -p openshell-cli --all-targets — clean)
  • Unit tests added/updated (event loop requires a live gRPC stream; no existing test seam for this path)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

The Stderr arm of the interactive exec event loop was a copy of the
Stdout arm and locked stdout, so stderr payloads were written to
stdout. The non-interactive exec path already handles the same event
with stderr. Write stderr payloads to stderr so shell redirection
(e.g. 'openshell exec ... 2>err.txt') works in interactive mode.

Signed-off-by: Andrew White <andrewh@cdw.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@github-actions

Copy link
Copy Markdown

Thank you for your interest in contributing to OpenShell, @andrewwhitecdw.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant