Skip to content

fix(openclaw): handle rtk rewrite exit code 3 as valid suggestion - #2220

Closed
mikeangstadt wants to merge 2 commits into
rtk-ai:developfrom
mikeangstadt:develop
Closed

mikeangstadt wants to merge 2 commits into
rtk-ai:developfrom
mikeangstadt:develop

Conversation

@mikeangstadt

Copy link
Copy Markdown

Summary

rtk rewrite exits with code 3 when it has a rewrite suggestion (and code 1 when it has none). execSync throws on any non-zero exit, so the catch block returned null for every rewrite attempt — the plugin was dead code.

Fix

Check e.stdout in the catch handler. Exit code 3 with stdout output is a valid rewrite suggestion, not an error.

Closes #2200


Collaborated & orchestrated by ClosedLoop.ai | GitHub

rtk rewrite exits with code 3 when it has a rewrite suggestion,
but execSync treats any non-zero exit as an exception. The catch
block was silently discarding all rewrites, making the plugin
dead code.

Fix: check e.stdout in the catch handler — exit code 3 with
stdout output is a valid rewrite, not an error.

Closes rtk-ai#2200
…n for SSH auth

git fetch uses exec_capture which sets stdin to null, preventing
SSH/credential prompting. When git can't prompt for credentials it
fails with 'could not read from remote repository' even though the
fetch would succeed with interactive auth.

Fix: switch run_fetch to run_streaming with StdinMode::Inherit (same
pattern as run_push). Add GitFetchLineHandler to filter progress
noise from stderr while preserving ref-update and error lines.

Fixes rtk-ai#2211
@rtk-release-bot

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet.

@rtk-release-bot rtk-release-bot Bot added the stale label Sep 3, 2026
@rtk-release-bot

Copy link
Copy Markdown
Contributor

Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you!

@rtk-release-bot rtk-release-bot Bot closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(openclaw): rtk-rewrite plugin silently drops all rewrites — exit code 3 treated as error

1 participant