Skip to content

improve: reduce extension boundary check overhead - #146771

Merged
steipete merged 1 commit into
mainfrom
codex/perf-sep12-boundary-aggregate
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-sep12-boundary-aggregate

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Supplemental CI checks load the same extension inventory three times to enforce three related boundary rules.

User Impact

There is no OpenClaw runtime behavior change. Developers get the same three boundary reports with less check overhead; individual mode and JSON commands remain available.

The aggregate has one failure group and one shared ten-minute timeout and 512-KiB output tail, replacing three independent groups and budgets. It uses one inventory snapshot rather than observing source changes between scans.

Why This Change Was Made

Run all three modes through the existing checker and its invocation-owned inventory, then replace the three runner commands with one --all command. Each mode still reports violations or errors, and the runner retains its default concurrency of four. The change adds 10 production lines and 49 test lines before formatting (60 test lines after formatting).

Evidence

A single Linux Testbox attempt measured the actual selected runner composition in B1/C1/C2/B2 order, allowing the three baseline checks to overlap:

Pair Baseline Candidate Wall reduction Native CPU reduction
B1 → C1 3.351 s 2.152 s 35.78% 69.35%
B2 → C2 3.350 s 2.149 s 35.85% 69.37%

All nine semantic cases passed on both revisions, including complete output parity, independently expected violations, overlapping rules, test/generated exclusions and all three oversized-source errors. The real runner's command selection and expanded shard coverage also passed. Raw evidence and process cleanup were independently checked.

Sampled process-tree RSS fell 66.99%/66.69%, but reverse-order kernel child maxRSS increased 1.22%. These are two observations per arm for the selected checks on frozen source, not a whole-CI, universal memory or Gateway performance claim. The four touched files are unchanged on the current author base.

Both complete existing test files passed: 51 tests, zero failures or skips, including timeout and signal descendant cleanup. Eighteen of twenty selected changed-file gates passed, including formatting, lint and repository guards. Fresh managed Codex review found no actionable P0–P2 issues.

Local type validation remains incomplete: the fixed 6 GiB memory cap stopped tsgo:scripts without compiler diagnostics, and tsgo:test:root could not acquire the lock retained by that stopped process. All owned children closed and the exact lock was recovered; neither type gate was retried or counted as passing. Both type checks subsequently passed in hosted type coverage on commit d788623ff9078e9b37297d696970b599bb8d3c4a, and exact-head CI is green. No full product build was selected or run.

Run the three extension boundary modes through one checker invocation while
preserving each report and individual mode/JSON commands. The aggregate
uses one shared timeout/output budget and one CI failure group.
@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 05:36
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:07 AM ET / 06:07 UTC (Revision 2).

ClawSweeper review

What this changes

Runs three plugin import checks in one process using a shared inventory, preserving individual commands and adding report-parity and shard-coverage tests.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused optimization absent from the inspected main and latest release. No actionable correctness or security defect was found, and current-head CI now reports successful boundary, type, and aggregate gates.

Priority: P3
Reviewed head: d788623ff9078e9b37297d696970b599bb8d3c4a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with relevant reported measurements, meaningful regression coverage, successful current-head gates, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its captured body additionally reports actual Linux runner comparisons and semantic parity for the changed aggregation path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its captured body additionally reports actual Linux runner comparisons and semantic parity for the changed aggregation path.
Evidence reviewed 8 items Shared owner and preserved failure behavior: The aggregate calls the existing mode implementation using its invocation-owned inventory promise, continues after mode errors, and returns failure if any mode fails. Individual mode and JSON behavior remain intact.
Runner integration and bounded execution: The runner replaces three invocations with the existing Node preload and --all entrypoint. Existing timeout, output-tail, process cleanup, and nonzero-exit handling still surround the aggregate.
Regression coverage inspected: Read both complete test files. Added cases cover clean and violating imports, overlapping rules, all three inventory-error reports, conflicting arguments, and complete unique selection across five shard counts. Tests were not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

OpenClaw’s supplemental CI runner checks repository architecture rules. This checker reads bundled plugin imports and produces rule-specific diagnostics and a failing exit status when boundaries are violated.

flowchart TD
  A[Supplemental CI runner] --> B[Aggregate extension check]
  C[Bundled plugin source] --> D[Shared import inventory]
  B --> D
  D --> E[Three existing boundary rules]
  E --> F[Rule diagnostics]
  E --> G[Combined exit status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +60, Other +10. Total +70 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 72 12 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 24 14 +10
Total 4 96 26 +70

Review metrics

Metric Value Why it matters
Aggregate execution budget 3 failure groups → 1; shared 10-minute timeout and 512-KiB output tail The PR explicitly documents this operational tradeoff while preserving rule-specific reports and standalone commands.

Technical review

Best possible solution:

Keep one inventory owner for all three rules while retaining standalone diagnostics and the runner’s bounded execution.

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

Not applicable to a product bug: source confirms repeated checker invocations, and the PR reports measured overhead through the actual Linux runner.

Is this the best way to solve the issue?

Yes. Reusing the checker’s existing inventory and rule implementations is a narrow solution that avoids competing policy logic.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded developer-tooling performance improvement with no OpenClaw runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 maintainer-authored PR is exempt from the external-contributor proof gate; its captured body additionally reports actual Linux runner comparisons and semantic parity for the changed aggregation path.

Evidence

What I checked:

  • Shared owner and preserved failure behavior: The aggregate calls the existing mode implementation using its invocation-owned inventory promise, continues after mode errors, and returns failure if any mode fails. Individual mode and JSON behavior remain intact. (scripts/check-extension-plugin-sdk-boundary.mts:248, d788623ff907)
  • Runner integration and bounded execution: The runner replaces three invocations with the existing Node preload and --all entrypoint. Existing timeout, output-tail, process cleanup, and nonzero-exit handling still surround the aggregate. (scripts/run-additional-boundary-checks.mts:95, d788623ff907)
  • Regression coverage inspected: Read both complete test files. Added cases cover clean and violating imports, overlapping rules, all three inventory-error reports, conflicting arguments, and complete unique selection across five shard counts. Tests were not executed during this read-only review. (test/extension-import-boundaries.test.ts:61, d788623ff907)
  • Still necessary on main and release: The fetched main runner and v2026.9.4 runner retain three separate extension-check invocations. The four changed files have no differences between the pinned merge base and fetched main; the optimization is not already present there. (scripts/run-additional-boundary-checks.mts:95, 3c16ced26794)
  • Reported production-path measurements: The captured PR body reports Linux Testbox runs of the actual selected runner composition in B1/C1/C2/B2 order: approximately 3.35 seconds baseline versus 2.15 seconds candidate, with nine semantic cases passing on both revisions. It explicitly limits these observations to selected checks and discloses the shared timeout/output budget. These are contributor-reported observations, not reviewer executions. (d788623ff907)
  • Current-head CI resolves earlier validation uncertainty: The REST check-run response identifies successful openclaw/ci-gate, check-prod-types, check-test-types, check-additional-boundaries, and checks-node-changed runs for the exact reviewed head. The response contains 140 total checks; this inspection establishes those named results rather than claiming every check was inspected. (d788623ff907)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-13T05:42:36.391Z sha d788623 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 31ba150 into main Sep 13, 2026
146 checks passed
@steipete
steipete deleted the codex/perf-sep12-boundary-aggregate branch September 13, 2026 06:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

zhangguiping-xydt added a commit to zhangguiping-xydt/openclaw that referenced this pull request Sep 13, 2026
The previous run merged this head into 1cc5eea, which predates
49c3d46. That commit added the fixture copy of scripts/tsx.mjs to
test/scripts/ci-workflow-guards.test.ts, which is what the guard needs now
that openclaw#146771 put extension-plugin-sdk-boundaries into
scripts/run-additional-boundary-checks.mts:

  node --import ./scripts/tsx.mjs scripts/check-extension-plugin-sdk-boundary.mts --all

Without the copy the fixture root has no scripts/tsx.mjs, the boundary check
dies with ERR_MODULE_NOT_FOUND, and checks-node-compact-small fails its
"routes eligible core test leaves to one type owner" case. No source change;
this commit only moves the merge base forward so CI exercises the fixed guard.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Run the three extension boundary modes through one checker invocation while
preserving each report and individual mode/JSON commands. The aggregate
uses one shared timeout/output budget and one CI failure group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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