Repository navigation
fix(tooling): admit semantic checks within host memory budgets - #160094
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 maintainer review before merge. Reviewed September 28, 2026, 12:48 AM ET / 04:48 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds a Linux helper that reserves one shared slot for a compiler or lint check, sizes its process-tree memory limit, and tests contention, cancellation, and cleanup. Merge readiness✅ Ready for maintainer review This is a distinct admission component missing from current main. The prior test-cost finding is addressed in the updated PR body, and this review found no blocking patch defect. Later PRs own activation in developer commands. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's developer tooling launches compiler and lint processes. This helper accepts a proposed command, checks shared memory capacity, and passes admitted work to the existing managed-process launcher; no current command calls it yet. flowchart LR
A[Compiler or lint command] --> B[Shared host slot]
B --> C[Measure memory headroom]
C --> D{Enough capacity?}
D -->|Yes| E[Managed Linux process tree]
D -->|No| F[Refusal with guidance]
E --> G[Release slot after cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +335, Other +166. Total +501 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use this shared admission owner for semantic check entrypoints in separately qualified caller changes, preserving kernel containment and clear remote-worker guidance where local containment is unavailable. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main execution was established in this read-only review. The linked issue records a high-memory lint run, and current source shows the lint entrypoint does not use shared admission. Is this the best way to solve the issue? Yes for this bounded Linux component: it reuses the existing file-lock and managed-process owners. Caller activation still needs its own proof and upgrade review. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 246e575c929f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
…law#160094) Related: openclaw#160010 ## What Problem This Solves Independent lint and compiler processes can each fit their own heap target while collectively exhausting the host. ## User Impact This adds the shared admission owner for subsequent compiler and lint activation; no existing command uses it yet. Callers receive one host/account slot, a kernel process-tree limit based on current memory headroom, and a 15-minute queue-plus-execution deadline. The owner requires verified Linux containment. Unsupported platforms or insufficient/unknown memory headroom return an actionable refusal instead of starting an unbounded process. Compiler/lint command activation and platform routing are separate PRs. ## Why This Change Was Made The kernel limit from openclaw#160024 bounds one process tree; this owner prevents simultaneous checks across worktrees from independently consuming the same budget. It uses the existing fs-safe lock contract and process-memory reader, with the OS account identity rather than task-specific HOME. Admission follows artifact ownership, measures headroom after waiting, caps the aggregate tree at the smaller of 8 GiB or half of usable capacity/headroom, and refuses below 512 MiB. It records the kernel scope identity before launch and retains ownership when cleanup cannot prove tree extinction. Cancellation remains owned through asynchronous release; soft Go overrides remain intact. ## Evidence - [Blacksmith Testbox proof](https://github.com/openclaw/openclaw/actions/runs/36373081283) exercised real filesystem lock contention, canceled/expired admission, late acquisition, command snapshotting, capacity/headroom refusal, non-Linux refusal, receipt ordering, and retention after uncertain cleanup. Kernel launches are mocked in this focused owner suite; actual kernel enforcement was qualified in the merged parent. - Strict script/root test types, targeted typed lint, formatting, and whitespace passed for the helper and profiler candidate. An independent P0–P2 review found no actionable finding. - This PR cherry-picks the tested helper unchanged onto the merged kernel/cancellation parents. The three dependency-owner modules are byte-identical to the proof base. Hosted CI will validate this exact head. - Production/tooling: +166/-0; tests: +321/-0. The growth supplies the missing cross-worktree admission/lifecycle owner. There is no runtime/config migration or new dependency. CI correction: exact-head check-lint identified nine missing control-flow braces in the new test file. Commit `e590faf299ddb75e36b1a8e503121807785bb1ba` adds those braces; conditions and async sequencing are unchanged. Targeted formatting, whitespace, and independent P0–P2 review pass. Fresh CI provides the updated lint proof. Measured test cost at `e590faf299ddb75e36b1a8e503121807785bb1ba`: the exact helper and test bytes were run on [Testbox](https://github.com/openclaw/openclaw/actions/runs/36376377264) from the profiler child revision, with `--maxWorkers=1`. All 26 cases passed; file test time 1.331s, Vitest wall 1.84s, complete test command 2.69s. Dedicated test execution adds 2.69 CI wall seconds, excluding shared checkout/install/setup. This addresses the review's test-cost finding and Rank-up move; no source change or repeat review is needed.
Related: #160010
What Problem This Solves
Independent lint and compiler processes can each fit their own heap target while collectively exhausting the host.
User Impact
This adds the shared admission owner for subsequent compiler and lint activation; no existing command uses it yet. Callers receive one host/account slot, a kernel process-tree limit based on current memory headroom, and a 15-minute queue-plus-execution deadline.
The owner requires verified Linux containment. Unsupported platforms or insufficient/unknown memory headroom return an actionable refusal instead of starting an unbounded process. Compiler/lint command activation and platform routing are separate PRs.
Why This Change Was Made
The kernel limit from #160024 bounds one process tree; this owner prevents simultaneous checks across worktrees from independently consuming the same budget. It uses the existing fs-safe lock contract and process-memory reader, with the OS account identity rather than task-specific HOME.
Admission follows artifact ownership, measures headroom after waiting, caps the aggregate tree at the smaller of 8 GiB or half of usable capacity/headroom, and refuses below 512 MiB. It records the kernel scope identity before launch and retains ownership when cleanup cannot prove tree extinction. Cancellation remains owned through asynchronous release; soft Go overrides remain intact.
Evidence
CI correction: exact-head check-lint identified nine missing control-flow braces in the new test file. Commit
e590faf299ddb75e36b1a8e503121807785bb1baadds those braces; conditions and async sequencing are unchanged. Targeted formatting, whitespace, and independent P0–P2 review pass. Fresh CI provides the updated lint proof.Measured test cost at
e590faf299ddb75e36b1a8e503121807785bb1ba: the exact helper and test bytes were run on Testbox from the profiler child revision, with--maxWorkers=1. All 26 cases passed; file test time 1.331s, Vitest wall 1.84s, complete test command 2.69s. Dedicated test execution adds 2.69 CI wall seconds, excluding shared checkout/install/setup. This addresses the review's test-cost finding and Rank-up move; no source change or repeat review is needed.