Repository navigation
improve(tooling): reduce commit formatting resource use - #152297
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 18, 2026, 8:23 PM ET / September 19, 2026, 00:23 UTC. ClawSweeper reviewWhat this changesThe PR limits staged-file formatting to one worker and updates existing hook tests to expect that limit. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, narrowly scoped improvement absent from current main and the latest release. No actionable correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s local commit hook checks staged content, formats eligible files, and updates the Git index. Fully staged files use batch formatting; partially staged files retain a separate path that preserves unstaged edits. flowchart TD
A[Git commit] --> B[Staged content guard]
B --> C{Fully staged file?}
C -->|Yes| D[Single-worker batch formatting]
C -->|No| E[Format staged blob only]
D --> F[Update Git index]
E --> F
F --> G[Final content check]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests 0, Other 0. Total 0 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the existing single-worker formatter policy in the batch commit-hook path while retaining staged-byte preservation and content checks. Do we have a high-confidence way to reproduce the issue? The resource-use mechanism is clear from source and the supplied controlled hook runs; reproducing task-limit exhaustion remains host-dependent and was not independently rerun in this read-only review. Is this the best way to solve the issue? Yes. Applying the already-supported worker limit at the existing batch invocation is a narrow repair that preserves formatter configuration, file selection, and staging behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cbef434846a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '912b21b98581c0be3baad87fe3686b64d69fffeb': (191 commits) perf(process): reduce allocation while processing command output (#152261) fix(ui): collapse duplicate previews when a page opens in multiple tabs (#152281) fix(test): run local Gateway tests behind protected exec egress (#152318) fix(node-host): avoid blocking configuration reads (#151411) fix(qa-lab): prevent Evidence Archive filters from overflowing (#152123) test: stabilize Docker scheduler signal fixtures on macOS (#152301) fix(ui): close stuck submenus when moving between menu rows (#152317) fix(ui): preserve question drafts and pending submissions (#152096) fix(release): recognize 7.34 fs-safe contract (#152326) chore: retire CLAUDE.md files fix(ui): release queued input after completed chat runs (#152299) improve(tooling): reduce commit formatting resource use (#152297) feat: show mentioned sessions in Involving me (#152083) perf(tasks): reuse prepared audit summaries (#152294) fix(daemon): preserve LaunchAgent rollback bytes and modes (#152195) fix: stop chat layout changes from loading extra history (#151726) perf(gateway): streamline config reload comparison (#152279) fix(xai): reject invalid UTF-8 OAuth responses (#111737) fix(release): accept waived advisory performance evidence for stable publication (#152290) fix: deliver watcher results while other sessions are busy (#152287) ...
What Problem This Solves
The commit hook can exhaust a constrained host's task limit while formatting a small staged change that includes Markdown.
User Impact
Developers get substantially lower commit-hook CPU, memory and task demand. The measured four-file batch finished faster; the forty-file batch took about 115 ms longer (+16.9%). There is no OpenClaw runtime behavior change.
Why This Change Was Made
Use the same single-worker formatting policy already used by
format,format:fixandformat:diff. The staged hook previously let oxfmt select all available workers; on this host, formatting one Markdown document could initialize a 32-process external formatter pool. The existing stdin path for partially staged files already uses one worker and is unchanged.Evidence
git-hooks/pre-commitentry point on Linux, Node 24.19.0 and installed oxfmt 0.67.0. Fixed B1/C1/C2/B2 order for each batch, fresh fixture/index/HOME/cache for every arm, identical 2 GiB/no-swap/1024-task limits, no retries.git diff --checkpassed. Source/dependency/index fences and process cleanup checks passed. The changed-check planner also passed; this is not a full localcheck:changedpass. Full exact-head hosted gates remain required before native prepare/merge.CPU is GNU time's child-inclusive user+system time. Unit memory/task peaks include fixture preparation and the common supervisor; Linux tasks include threads. These are two observations per variant on one host, not a universal latency improvement. The earlier 256-task EAGAIN failure and subsequent 1024-task successful commit are historical resource-control evidence, not the timing comparison above.