fix: address code review feedback on runbook executor - #11
Merged
Conversation
added 2 commits
June 8, 2026 20:11
- Add execute_command with robust timeout handling - Add run_diagnostics for TIER 1 automatic execution - Add execute_action with privileged action blocking - Add 6 tests covering success, failure, timeout, and privilege checks - Update hermes-implementation-plan.md to mark Task 14 complete
- Fix child process leak on timeout using start_new_session + os.killpg - Switch to shell=False with shlex.split() by default to prevent shell injection - Add shell_required flag to RunbookAction for explicit opt-in to shell=True - Add graceful ValueError handling in _parse_timeout with 30s default
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
Implements the runbook executor (Task 14) to execute diagnostics and actions defined in YAML runbooks, and addresses subsequent code review feedback.
Key Changes:
src/agentic_node_ops/executor.pywith robust command execution.start_new_session=Trueandos.killpg(withSIGKILLfallback).shell=Falsewithshlex.split()by default to prevent shell injection, adding ashell_requiredflag toRunbookActionfor explicit opt-in.ValueErrorhandling in_parse_timeoutwith a 30s default.Type of Change
Pre-Review Findings and Resolutions
ruff check --fix && ruff format) applied before pre-review.subprocess.runwithshell=True, risking child process leaks on timeout and shell injection from YAML strings.subprocess.Popen+os.killpgfor safe process group termination.shell=Falsewithshlex.split(), adding explicitshell_requiredopt-in for privileged actions.Testing
pytest -v --cov=agentic_node_ops --cov=webhook_receiver— 161 tests passed, 90% coverage)tests/test_executor.pyincludes 10 tests covering command success/failure/timeout, process group kill verification, shell injection prevention, and graceful timeout parsing)Checklist
docs/hermes-implementation-plan.md)