Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 11, 2026, 12:46 PM ET / 16:46 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds a 15-second limit to each child launched by OCM’s once-only supervisor command, timeout termination, and two Unix helper tests. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 7 items remain The proposed deadline remains absent from main and v0.2.44, so this PR is not obsolete. The previously reported descendant-cleanup defect remains unresolved, and the supplied demonstrations do not establish production-path behavior. Priority: P2 Review scores
Verification
How this fits togetherOCM’s supervisor reads saved environment service plans and launches their gateway processes. Its internal once-only command waits for each planned child and returns execution results instead of continuously supervising restarts. flowchart TD
A[Once-only command] --> B[Saved service plans]
B --> C[Environment admission check]
C --> D[Launch child process group]
D --> E[Wait for exit or deadline]
E --> F[Return child result]
E --> G[Terminate group and report timeout]
Decision needed
Why: The existing command waits for child completion, and elapsed time alone does not distinguish a stuck gateway from a healthy long-running one. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Reuse group-aware shutdown and preserve existing once-mode lifetime by default, with an explicit diagnostic deadline unless maintainers approve a documented compatibility change. Do we have a high-confidence way to reproduce the issue? Yes, from source: a non-exiting child keeps main’s wait blocked, and a leader that exits on TERM with a TERM-resistant descendant exposes the proposed cleanup defect. No runtime reproduction or artifact-producing tests were executed in this read-only review. Is this the best way to solve the issue? No, not as submitted: the deadline introduces a new lifetime policy, and its separate termination helper omits the group-aware cleanup already used by the supervisor. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c5ac5392e142. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
ocm service --once blocked forever on child.wait() if an env child never exited. Wait with a deadline and kill the child on timeout, matching the handoff wait helper. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> (cherry picked from commit 40ce43f)
The 200ms deadline plus SIGTERM grace can exceed 1s on macos-latest. Keep proving we do not wait the full 30s sleep. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> (cherry picked from commit c85f0e6)
c85f0e6 to
d9e51cb
Compare
dev_stop_acknowledgement_refuses_live_recorded_ownership failed once on macos-latest; the same test passed on openclaw#117 and openclaw#136 from the same main. This PR does not touch that test. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
What Problem This Solves
Fixes an issue where
ocm service --once(the__daemon run --oncepath) would hang forever when a planned env child never exited. After spawn,run_oncecalledchild.wait()with no deadline.On origin/main the hang is here:
ocm/src/supervisor/mod.rs
Lines 809 to 811 in e04c101
e04c101
This is separate from PR #136, which bounds git worktree helpers.
Why This Change Was Made
run_oncenow waits throughwait_child_with_timeout. The child is polled, then terminated (process group TERM, then KILL) whenSERVICE_ONCE_CHILD_TIMEOUT_MS(15s) expires, matching the restart-handoff wait helper. On timeout the supervisor returns an error instead of blocking. Long-runningrun_until_stoppedis unchanged.User Impact
A stuck env child in once-mode fails after 15s instead of hanging
ocm service --once. Children that exit on their own still report their exit status.Evidence
terminal output from a rustc one-off against
/bin/sleep 30. Naivechild.wait()is still running after 1s. The timed waiter returns an error at the 200ms deadline and the sleep process is gone.The same deadline-and-kill path is what
run_oncenow uses afterspawn_supervisor_child.Real behavior proof
Behavior or issue addressed:
ocm service --onceno longer blocks forever onchild.wait(). A child that does not exit is killed when the 15s deadline is reached, and the supervisor returns an error.Real environment tested: macOS (Darwin 25.6.0 arm64), rustc 1.98.0, ocm checkout
/tmp/ocm-F005onfix/supervisor-run-once-timeoutabove origin/maine04c10166d6b58932213bf8422ccfc201cf6ac37.Exact steps or command run after this patch:
rustc
/tmp/naive_sleep_wait.rsand/tmp/timed_sleep_wait.rs, then run both binaries against/bin/sleep 30. Then run the built lib binaryocm-c8830440f3406352 supervisor::tests::wait_child_with_timeout_kills_sleep_after_deadline --exact --nocapture.Evidence after fix: terminal output above. Naive
child.wait()was still running after 1006ms with sleep still alive. The timed waiter printedsleep timed out after 200ms after 223.674792msandsleep pid 47991 still alive: false.Observed result after fix: The helper returns a timeout error in about 200ms and the sleep child is gone.
run_onceuses that same waiter with a 15s named deadline.What was not tested: A live launchd/systemd
ocm service --oncewith a real OpenClaw gateway that refuses to exit, and the Windows job-object kill path.