fix(cli): write exec stderr events to stderr in interactive mode#2447
fix(cli): write exec stderr events to stderr in interactive mode#2447andrewwhitecdw wants to merge 1 commit into
Conversation
The Stderr arm of the interactive exec event loop 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>
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
Label |
|
/ok to test 6f44826 |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This is a project-valid, concentrated CLI correctness fix. It restores interactive sandbox exec stderr routing to match the established non-interactive path and supersedes the author’s vouch-closed PR #2407.
Head SHA: 6f44826cd6f4513a431468bfb71c0374694f08d6
Review findings:
- No blocking findings remain. A PTY-backed stream-separation regression test would be useful when the harness supports it, but the missing seam does not block this minimal fix.
Docs: Not needed because this restores standard stdout/stderr semantics rather than introducing a new command, flag, or workflow.
E2E: Applied test:e2e because the change affects CLI handling of sandbox exec events over the gateway, and authorized the current mirror with /ok to test 6f44826cd6f4513a431468bfb71c0374694f08d6.
Next state: gator:watch-pipeline
Summary
In interactive
openshell exec, stderr payloads from the sandbox were written to stdout because theStderrarm of the event loop was a verbatim copy of theStdoutarm (stdout.lock()). The non-interactive exec path in the same file handles the identical event withstderr.lock(). This broke shell redirection (e.g.openshell exec ... 2>err.txt) and piping of stdout in interactive mode.This PR supersedes #2407, which was auto-closed by the vouch-check workflow before I was vouched.
Related Issue
N/A — small copy-paste fix found during code review.
Changes
stderrin the interactive exec event loop and lock it in theStderrarm, matching the non-interactive pathTesting
mise run pre-commitpasses (mise unavailable in this environment; ran equivalentcargo fmt+cargo clippy -p openshell-cli --all-targets— clean)Checklist