Revert #4045 crash-loop gateway PID detector#4056
Conversation
📝 WalkthroughWalkthroughThe PR refactors two helper functions in the crash-loop-recovery E2E test script: ChangesE2E Gateway Diagnostics Helpers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/e2e/test-issue-2478-crash-loop-recovery.sh`:
- Line 113: The gateway_pid() helper currently returns the trimmed output of
sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" which may be non-numeric
stderr/garbage and causes wait_for_gateway_up() to treat it as a valid PID;
update gateway_pid() to validate the output is a positive integer (e.g., only
digits) before returning it and have it return empty/false on invalid output so
wait_for_gateway_up() only considers numeric PIDs, ensuring sandbox_exec/pgrep
stderr does not count as success.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5c700062-3aaa-4cb9-81d5-23f9f929c20f
📒 Files selected for processing (1)
test/e2e/test-issue-2478-crash-loop-recovery.sh
| SH | ||
| ) | ||
| sandbox_exec sh -c "$script" | awk '/^[0-9]+$/ { print; exit }' | ||
| sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" | tr -d '[:space:]' |
There was a problem hiding this comment.
Validate gateway_pid() output is numeric before reporting success.
At Line 113, stderr text from sandbox_exec/pgrep can become a non-empty string after whitespace stripping, and wait_for_gateway_up() will treat that as a valid PID.
Suggested fix
gateway_pid() {
- sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" | tr -d '[:space:]'
+ local pid
+ pid="$(sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" | tr -d '[:space:]')"
+ case "$pid" in
+ ''|*[!0-9]*) echo "" ;;
+ *) echo "$pid" ;;
+ esac
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" | tr -d '[:space:]' | |
| gateway_pid() { | |
| local pid | |
| pid="$(sandbox_exec sh -c "pgrep -fo '[o]penclaw[ -]gateway'" | tr -d '[:space:]')" | |
| case "$pid" in | |
| ''|*[!0-9]*) echo "" ;; | |
| *) echo "$pid" ;; | |
| esac | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/e2e/test-issue-2478-crash-loop-recovery.sh` at line 113, The
gateway_pid() helper currently returns the trimmed output of sandbox_exec sh -c
"pgrep -fo '[o]penclaw[ -]gateway'" which may be non-numeric stderr/garbage and
causes wait_for_gateway_up() to treat it as a valid PID; update gateway_pid() to
validate the output is a positive integer (e.g., only digits) before returning
it and have it return empty/false on invalid output so wait_for_gateway_up()
only considers numeric PIDs, ensuring sandbox_exec/pgrep stderr does not count
as success.
PR Review AdvisorRecommendation: blocked This is an automated advisory review. A human maintainer must make the final merge decision. Limitations: Review is based on the provided trusted metadata and diff; no PR scripts, E2E jobs, package-manager commands, or repository tests were executed.; PR title/body/comments and linked issue text were treated as untrusted evidence and used only for acceptance mapping.; The optional Full advisor summaryPR Review AdvisorBase: Tests-only revert is low runtime risk, but the PR is currently blocked by mergeability/review-thread gates and the touched E2E PID detector can treat non-numeric stderr as a valid gateway PID. Gate status
🔴 Blockers
🟡 Warnings
🔵 Suggestions
Acceptance coverage
Security review
Test / E2E status
✅ What looks good
Review completeness
|
Selective E2E Results — ✅ All requested jobs passedRun: 26271698463
|
Summary
test-issue-2478-crash-loop-recovery.shfor the OpenClaw 2026.5.x process-title shape seen after fix(openclaw): bump runtime deps EXDEV fix #3820.Why
80ee341686d695147c5cd118d1049c32f52d5af9passedissue-2478-crash-loop-recovery-e2e.openclaw-gatewayalive,[gateway] ready, sandboxReady, andAgent: OpenClaw v2026.4.24, but the test: fix crash-loop gateway PID detection #4045 detector still returned empty.Validation
bash -n test/e2e/test-issue-2478-crash-loop-recovery.shgit diff --checkgit diff --stat 80ee341686d695147c5cd118d1049c32f52d5af9 -- test/e2e/test-issue-2478-crash-loop-recovery.shis empty; the test file now matches the known-good pre-fix(openclaw): bump runtime deps EXDEV fix #3820 version.Summary by CodeRabbit