Skip to content

fix(tooling): release completed PR operations with exited loaders - #152209

Merged
steipete merged 1 commit into
mainfrom
codex/pr-loader-settlement
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/pr-loader-settlement

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes completed native PR commands failing and retaining their operation lock when exited loader descendants are still waiting to be reaped on Linux.

User Impact

This is an internal maintainer-tooling correction. It changes no product behavior or configuration. Live descendants, uncertain process state, incomplete operations, and failures after side effects still retain the lock.

Why This Change Was Made

The supervisor used a process-group existence probe after its wrapper exited. That probe also reports groups containing only zombies. The supervisor now consumes the existing managed-child owner's all-thread classification for the child whose exit it directly observed. Lock acquisition and recovery retain their conservative treatment of externally observed zombie groups.

Evidence

A controlled original-source run retained two successfully exited loader children and reproduced the native provisioning failure; promptly reaping those children let the unchanged fixture pass. The existing genuinely live-child rejection control also passed. This is consistent with the failure in CI run 35398131748, but that historical log lacks process states and does not prove this was its sole cause.

The maintained regression fails on the original supervisor and passes with the repair. All 48 selected cases pass: five real provisioning-state cases, both live-child and externally observed zombie lock controls, eleven archived-wrapper closure cases, and thirty shared process-owner cases. All selected tooling/root-test type, lint, formatting, and repository guards pass. Independent review of the candidate found no actionable P0–P2 issues.

@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 18, 2026 22:33
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The exact-head review workflow 35402192241 has completed. Its retained review for 8dd0535 explicitly reports no actionable introduced defect, but the public comment remains at “review started” and has no completed-review marker. Please publish a completed review for this unchanged head. All 48 focused local cases and selected checks pass; CI is still running.

@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:49 PM ET / 22:49 UTC.

ClawSweeper review

What this changes

The PR lets completed maintainer PR commands release their operation locks when only exited Linux loader processes remain, and adds regression coverage through real worktree provisioning.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: fetched main and the latest release retain the faulty process-group probe. Codex review found no actionable introduced defect.

Priority: P2
Reviewed head: 8dd053551ebfbb498e5e5c552f524101f2e255d1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful boundary regression coverage and no actionable introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer-authored internal tooling, so the external-contributor proof gate does not apply. Reported Linux provisioning results exercise the changed supervisor with unreaped descendants and successful lock release; execution was not repeated here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies maintainer-authored internal tooling, so the external-contributor proof gate does not apply. Reported Linux provisioning results exercise the changed supervisor with unreaped descendants and successful lock release; execution was not repeated here.
Evidence reviewed 8 items Introduced production change: The supervisor delegates liveness inspection to the existing managed-process owner and permanently records a dead group. Completion-marker, interruption, validation-phase, and lingering-child checks remain intact.
Existing shared process contract: Linux zombie classification requires an observed child exit and successful all-thread inspection; empty, failed, live-thread, and expired-budget observations cannot certify completion. The implementation uses Node and operating-system process facilities, with no Codex dependency contract.
Current-main necessity: Comparison with fetched main shows that its supervisor still uses signal-zero alone; the shared process owner itself is unchanged by this PR.
Findings None None.
Security None None.

How this fits together

The PR command supervisor tracks child processes and holds an operation lock while repository work runs. Process completion, notification metadata, and lock ownership determine whether it releases the lock or retains it for recovery.

flowchart TD
  A[Maintainer PR command] --> B[Process supervisor]
  B --> C[Worktree operation]
  C --> D[Exit and completion metadata]
  D --> E[Shared process inspection]
  E --> F{Safe completion?}
  F -->|Yes| G[Release exact operation lock]
  F -->|No| H[Retain lock for recovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +21, Other -3. Total +18 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 60 39 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 14 17 -3
Total 5 74 56 +18

Review metrics

None.

Technical review

Best possible solution:

Keep process classification in the shared owner while preserving completion-marker checks, exact-owner lock release, and conservative external recovery.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: holding exited Linux loader descendants unreaped makes the current supervisor's signal-zero probe report a live group. The PR provides a focused provisioning regression; this review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing all-thread process classifier removes the incorrect duplicate probe without changing lock acquisition, recovery, or persisted formats.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ce616b641779.

Labels

Label changes:

  • add P2: Completed Linux maintainer operations can fail and retain locks, with impact limited to repository tooling.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies maintainer-authored internal tooling, so the external-contributor proof gate does not apply. Reported Linux provisioning results exercise the changed supervisor with unreaped descendants and successful lock release; execution was not repeated here.

Label justifications:

  • P2: Completed Linux maintainer operations can fail and retain locks, with impact limited to repository tooling.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies maintainer-authored internal tooling, so the external-contributor proof gate does not apply. Reported Linux provisioning results exercise the changed supervisor with unreaped descendants and successful lock release; execution was not repeated here.

Evidence

What I checked:

  • Introduced production change: The supervisor delegates liveness inspection to the existing managed-process owner and permanently records a dead group. Completion-marker, interruption, validation-phase, and lingering-child checks remain intact. (scripts/pr-lib/process-group-runner.mjs:139, 8dd053551ebf)
  • Existing shared process contract: Linux zombie classification requires an observed child exit and successful all-thread inspection; empty, failed, live-thread, and expired-budget observations cannot certify completion. The implementation uses Node and operating-system process facilities, with no Codex dependency contract. (scripts/lib/managed-child-process.mts:343, 8dd053551ebf)
  • Current-main necessity: Comparison with fetched main shows that its supervisor still uses signal-zero alone; the shared process owner itself is unchanged by this PR. (scripts/pr-lib/process-group-runner.mjs:139, ce616b641779)
  • Latest-release check: The v2026.9.4 supervisor also classifies every successful signal-zero group probe as live, so that release does not contain this repair. (scripts/pr-lib/process-group-runner.mjs, 3a9d69db306c)
  • Regression and validation evidence: The added Linux case retains exited descendants around the actual supervisor and provisioning path, then checks successful exit, worktree seed, released allocation lease, and absent operation locks. The captured PR body reports pre-fix failure and 48 passing focused cases after repair; these results were not independently rerun during this read-only review. (test/scripts/pr-worktree-state.test.ts:15, 8dd053551ebf)
  • Lock safety remains owned by existing code: Lock release still uses an expected-object compare-and-swap. Existing tests cover foreign-group notification rejection, live descendants after clean wrapper exit, and conservative acquisition when an externally observed group contains a zombie. (scripts/pr-lib/operation-lock.sh:245, 8dd053551ebf)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit ed82676 into main Sep 18, 2026
206 checks passed
@steipete
steipete deleted the codex/pr-loader-settlement branch September 18, 2026 22:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant