Skip to content

fix(perf): calibrate RSS by Node runtime major - #93

Merged
shakkernerd merged 2 commits into
mainfrom
fix/runtime-rss-calibration
Aug 21, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
fix/runtime-rss-calibration

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • make RSS release gates select a reviewed baseline by Node runtime major
  • bound each baseline with a 10% regression allowance and a 1200 MB absolute ceiling
  • retain the absolute ceiling for an uncalibrated future Node major and report that its baseline is missing

Root cause

The release gate used one absolute RSS budget calibrated before the current Node runtime line. Same-shape remote runs show this is a runtime-major distinction, not a Node 24 patch regression or process-tree accounting error:

Node Fresh Onboarded Bundled Many plugins
22.22.3 719 724 729 752
24.15 1046 1051 1088 1049
24.16 1053 1060 1103 1071
24.19 1048 1058 1083 1079
25.9 1044 1079 1062 1047

Kova attributes the RSS to the single Gateway PID. Gateway diagnostics show roughly 726–758 MB committed JS heap with 292–355 MB used and about 16 MB external memory. Service-only --max-old-space-size=512/768 did not reduce RSS; disabling compile cache worsened memory and latency; shrinking semi-space only marginally shifted startup RSS while worsening the agent scenario. A product runtime flag is therefore not the owner fix.

OpenClaw #127040 at 734ec85e independently reduced the exact Node 24 path and remains within these calibrated bands: run 32451512897 recorded 1047/1057/1059/1084 MB for fresh/onboarded/bundled/many-plugin, with the agent scenario at 870 MB.

Gate behavior

  • Node 22: fresh/gateway 808 MB; bundled 803 MB
  • Node 24: fresh/gateway 1177 MB; bundled 1193 MB
  • Node 25: fresh/gateway 1166 MB; bundled 1171 MB
  • other major: 1200 MB absolute ceiling, with baselineMb: null in threshold-policy evidence

This avoids a blind global increase: known runtime lines still fail beyond their measured baseline plus 10%, while every runtime remains subject to the absolute ceiling.

Verification

  • node bin/kova.mjs matrix plan --profile release --target local-build:/tmp/openclaw-rss-node --json
  • npm run test:snapshots
  • runtime policy self-checks cover Node 22 selection, Node 24 regression math, and missing-baseline fallback
  • full local self-check reached the changed checks successfully; unrelated setup/credential/OCM checks are contaminated by this workstation's existing OCM state, so PR CI is authoritative

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 2:17 PM ET / 18:17 UTC.

ClawSweeper review

What this changes

The PR makes Kova choose RSS limits from the Node major reported by the provisioned Gateway, with calibrated allowances and an absolute fallback ceiling.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The PR is mechanically coherent, but it intentionally relaxes release RSS gates and needs a release-owner decision before merge.

Priority: P2
Reviewed head: f32c8e40612d0ad1218c46ed0d00137197f43760
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation and focused validation are solid, with merge readiness limited by the intentional release-budget decision.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: this is a repository MEMBER PR; the body also links release-run measurements and states local self-check coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: this is a repository MEMBER PR; the body also links release-run measurements and states local self-check coverage.
Evidence reviewed 4 items Current-main behavior: Current main still uses fixed 1050 MB RSS thresholds, so it does not already implement Node-major calibration.
Runtime identity boundary: The PR obtains the Gateway-reported Node version after reading OCM’s service PID and port, and rejects mismatched identity before selecting a calibrated threshold.
Calibration behavior and coverage: Threshold resolution applies the Node-major baseline plus allowance, caps it at 1200 MB, and self-check coverage exercises trusted Node 22, untrusted evidence, and an uncalibrated future major.
Findings None None.
Security None None.

Live Verification

Command: node bin/kova.mjs plan --scenario fresh-install --json

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: "schemaVersion": "kova.plan.v1"
  • FAIL expect_output: "baselineByNodeMajor"

How this fits together

Kova scenarios and surfaces define OpenClaw release-gate thresholds. During final evidence collection, Kova reads the Gateway runtime identity through OCM, resolves the applicable RSS limit, and records the pass/fail result.

flowchart LR
  A[Release scenario] --> B[RSS baseline configuration]
  C[OCM service identity] --> D[Gateway runtime identity]
  D --> E[Threshold resolution]
  B --> E
  E --> F[Record evaluation]
  F --> G[Release gate report]
Loading

Decision needed

Question Recommendation
Should Kova adopt the proposed Node 24/25 RSS ceilings for release gating despite the reduced sensitivity relative to the current fixed limits? Approve calibrated gates: Accept the documented baselines, 10% allowance, and 1200 MB ceiling as the intended release policy.

Why: The implementation supports the stated policy, but accepting new release-performance budgets is a maintainer-owned calibration decision.

Before merge

  • Resolve merge risk (P1) - Known Node 24/25 and bundled-plugin gates become less sensitive than the former fixed caps, so a real RSS regression can pass unless maintainers accept the new calibration evidence as release policy.
  • Complete next step (P2) - The remaining action is maintainer acceptance of new release RSS budgets, not a mechanical repair.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and validation delta implementation +279/-15; validation and snapshots +253/-18 The change spans registry schema, target-runtime collection, evaluation, and focused self-check coverage.

Merge-risk options

Maintainer options:

  1. Confirm the calibrated release policy (recommended)
    Review the supplied release measurements and approve the Node-major budgets if the lower regression sensitivity is acceptable.
  2. Pause for additional calibration
    Keep the existing limits until a maintainer-approved release matrix establishes the new baselines.

Technical review

Best possible solution:

Retain target-runtime-based selection, but merge only after a release owner accepts the measured Node-major baselines and their explicit 1200 MB ceiling.

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

No. This read-only review did not execute a release-shaped OCM matrix; the PR body provides measurements and the source path is inspectable.

Is this the best way to solve the issue?

Unclear. Selecting the actual Gateway runtime is the narrow implementation path, but the higher release budgets require maintainer acceptance of the calibration data.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f6b94b49605b.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded release-gate calibration change with no demonstrated user-facing outage.
  • merge-risk: 🚨 compatibility: Merging changes established RSS pass/fail limits for supported Node runtime lines.
  • 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: Not applicable: this is a repository MEMBER PR; the body also links release-run measurements and states local self-check coverage.

Evidence

What I checked:

  • Current-main behavior: Current main still uses fixed 1050 MB RSS thresholds, so it does not already implement Node-major calibration. (scenarios/fresh-install.json:19, f6b94b49605b)
  • Runtime identity boundary: The PR obtains the Gateway-reported Node version after reading OCM’s service PID and port, and rejects mismatched identity before selecting a calibrated threshold. (src/run/finalize-record.mjs:103, f32c8e40612d)
  • Calibration behavior and coverage: Threshold resolution applies the Node-major baseline plus allowance, caps it at 1200 MB, and self-check coverage exercises trusted Node 22, untrusted evidence, and an uncalibrated future major. (src/evaluation/thresholds.mjs:38, f32c8e40612d)
  • Feature history: Recent RSS-evaluation maintenance predates this PR in commits for separate agent-runtime RSS reporting and complete profile assessments. (src/evaluator.mjs:102, 8c5b9ff6fd63)

Likely related people:

  • Vincent Koc: Authored the recent current-main commits that maintain runtime RSS reporting and profile assessment behavior. (role: recent RSS-evaluation contributor; confidence: high; commits: 8c5b9ff6fd63, 89a4393a4627; files: src/evaluator.mjs, src/metrics.mjs)
  • shakkernerd: Authored the current head’s Gateway-runtime identity hardening and is assigned to this PR. (role: recent runtime-evidence contributor; confidence: high; commits: f32c8e40612d; files: src/run/finalize-record.mjs, src/evaluation/thresholds.mjs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Have the release owner confirm that the documented Node-major RSS bands are acceptable for the gate.

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 (3 earlier review cycles)
  • reviewed 2026-08-21T05:53:54.952Z sha 34224a3 :: needs changes before merge. :: [P1] Pass the tested runtime's Node version
  • reviewed 2026-08-21T06:13:15.566Z sha 1ce1cf7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T15:07:14.382Z sha 1ce1cf7 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa force-pushed the fix/runtime-rss-calibration branch from 34224a3 to 1c3c12f Compare August 21, 2026 06:05
@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the runtime-identity finding at 1c3c12f:

  • Kova now captures node --version inside the provisioned OCM target environment after the service path is established.
  • collectPreCleanupEvidence records that target-runtime fact and threads it through evaluateRecord into threshold resolution.
  • Missing/unparseable target-runtime evidence is explicit (nodeMajor: null, baselineMb: null) and remains bounded by the 1200 MB absolute ceiling.
  • Added a runner/target mismatch regression: a measured Node 22 target selects the 803 MB gate even when Kova itself runs on Node 24.

npm run test:snapshots passes locally; exact-head CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

🦞🧹
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:

@RomneyDa
RomneyDa force-pushed the fix/runtime-rss-calibration branch from 1c3c12f to 1ce1cf7 Compare August 21, 2026 06:09
@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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 21, 2026
@shakkernerd shakkernerd self-assigned this Aug 21, 2026
@shakkernerd
shakkernerd force-pushed the fix/runtime-rss-calibration branch from 1ce1cf7 to f32c8e4 Compare August 21, 2026 18:12
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 21, 2026
@shakkernerd
shakkernerd force-pushed the fix/runtime-rss-calibration branch 3 times, most recently from f32c8e4 to 1fe2f40 Compare August 21, 2026 18:47
@shakkernerd
shakkernerd merged commit 1fe2f40 into main Aug 21, 2026
10 checks passed
@shakkernerd
shakkernerd deleted the fix/runtime-rss-calibration branch August 21, 2026 18:47
@shakkernerd

Copy link
Copy Markdown
Contributor

Fixed: RSS calibration now uses trusted Gateway runtime identity and blocks untrusted evidence.

With thanks to @RomneyDa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants