Fix exit codes, shell escaping, validation, and logging #2
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.
This PR addresses several critical issues and improvements identified in
docs/CODE_REVIEW.md:echo $?or equivalent) for commands that complete during background monitoring after a timeout. This ensuresexit_codeis accurate instead of defaulting to 0 or None.write_file(sudo mode) withbase64encoding/decoding. This prevents vulnerabilities and bugs related to special characters (newlines, quotes, etc.) in file content._execute_enable_mode_command_internalto check if the session is actually in enable mode (prompt ends with#) before executing commands. It attempts to re-enter enable mode if the validation fails.recvloops incommand_executor.pyto prevent log flooding during long operations or idle states.Verified with targeted reproduction tests and existing regression tests.
PR created automatically by Jules for task 11506711411728051988 started by @devnullvoid