fix(openclaw): preserve rewrite stdout on non-zero exit#1389
Open
jhenderiks wants to merge 1 commit intortk-ai:developfrom
Open
fix(openclaw): preserve rewrite stdout on non-zero exit#1389jhenderiks wants to merge 1 commit intortk-ai:developfrom
jhenderiks wants to merge 1 commit intortk-ai:developfrom
Conversation
Signed-off-by: Justin Henderiks <jhenderiks@users.noreply.github.com>
Collaborator
📊 Automated PR Analysis
SummaryFixes the OpenClaw plugin to preserve stdout from Review Checklist
Linked issues: #1388 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk rewritestdout when the child process exits non-zeroexecSync(...)throws and the rewrite is discardedWhy this change
The current OpenClaw plugin assumes that useful rewrite output only arrives on exit
0.That is brittle. If
rtk rewriteemits a rewritten command on stdout together with a non-zero exit status, the currentexecSync(...)path throws and the plugin drops the rewrite.This PR makes the plugin preserve rewritten stdout on non-zero exit instead of treating all non-zero exits as unrecoverable.
Test plan
bun --eval 'await import("./openclaw/index.ts")'cargo fmt --all && cargo clippy --all-targets && cargo testrtk rewriteemits rewritten stdout with non-zero exitNotes
I am intentionally framing this as a defensive correctness fix.
I originally saw a repro where
rtk rewriteemitted rewritten stdout with a non-zero exit, but I did not re-confirm that exact exit behavior on every RTK/environment combination before sending this PR.