Skip to content

fix(perf): retain startup benchmark warmups - #117649

Merged
vincentkoc merged 1 commit into
mainfrom
perf/gateway-health-connection-trace
Aug 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
perf/gateway-health-connection-trace

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Related: #117525

What Problem This Solves

Startup benchmark warmups were discarded entirely. A failed or timed-out
warmup could leave the report green, and maintainers could not correlate an
observed Gateway failure with warmup versus measured samples.

Why This Change Was Made

The benchmark now retains warmup samples separately from measured samples,
records wall-clock start and end timestamps for every execution, and applies
the existing sample validity checks to warmups. Measured summaries and baseline
comparisons remain unchanged.

Maintainer Decision

Fail closed when a warmup fails. A warmup exercises the same command and
environment as measured samples; silently discarding its failure produces a
misleading green report. Warmups remain excluded from measured summaries, so
this does not bias performance statistics.

The prior exact-head source failure was classified from run 30719599205. Its
connected-health warmup began 378 ms after HTTP readiness and timed out after
10 seconds while the Gateway later logged a WebSocket handshake timeout. That
was the HTTP-versus-WebSocket readiness race fixed by
#117655, not a benchmark-script
regression.

User Impact

No product runtime behavior changes. Maintainers get fail-closed startup reports
and enough timing context to correlate CLI executions with Gateway logs.

Exact-Head Evidence

  • Head: bb36df0ab806b56264ab3020ab8757a0d85da235.
  • Exact Kova/source-performance run:
    https://github.com/openclaw/openclaw/actions/runs/30722795395
  • All workflow jobs passed: source probes, 10/10 normal mock records, deep
    profile, and live OpenAI.
  • Source artifact:
    • connected-health warmup: 665 ms, exit 0
    • first-device warmup: 634 ms, exit 0
    • config-get warmup: 821 ms, exit 0
    • measured summaries remain five samples per case
    • connected-health measured p50/p95: 725/739 ms
    • first-device measured p50/p95: 631/644 ms
  • Normal Kova:
    • agent RSS median/p95/max: 837/847/849 MB
    • cold/warm agent turn median: 3267/3304 ms
    • pre-provider p95 median: 3183 ms
  • Live OpenAI: passed; cold/warm 6421/5726 ms.
  • Deep-profile diagnostics retained the known profiler-overhead RSS thresholds
    (status-cli 921 MB over 900 MB; agent 1046 MB over 1000 MB). The workflow
    classified these as profiling-only diagnostics and passed; this PR does not
    change runtime memory behavior.

Local Verification

  • node scripts/run-vitest.mjs test/scripts/bench-cli-startup.test.ts test/scripts/cli-startup-bench-spawner.test.ts
    • 29/29 passed.
  • oxfmt --check passed for all three changed files.
  • Focused oxlint passed for all three changed files.
  • git diff --check passed.
  • P2-wide autoreview completed clean with no accepted/actionable findings.
  • The rebased patch is equivalent to the previously reviewed patch.
  • Current main at 6c9b38862d2d32133edde3127b3eeb0056feb90f
    has not changed the three touched files, and git merge-tree --write-tree
    is clean.

Storage And Compatibility

No persisted state, schema, config, protocol, or product runtime contract
changes. The serialized JSON report gains additive warmupSamples and sample
timestamps for internal performance automation only.

@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@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 Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 7:37 PM ET / 23:37 UTC.

ClawSweeper review

What this changes

The PR records startup-benchmark warmup results and wall-clock timestamps, then applies existing execution-health validation to warmups while leaving measured summaries and comparisons unchanged.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

The patch correctly retains and validates startup warmups without contaminating measured performance statistics. The explicit workflow-owner approval resolves the prior policy question; because this is a MEMBER-authored PR with a protected maintainer label, it should remain open for normal maintainer landing rather than automated cleanup.

Priority: P3
Reviewed head: bb36df0ab806b56264ab3020ab8757a0d85da235

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused patch, direct source-performance evidence, and regression coverage support normal maintainer landing.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This MEMBER-authored automation PR is not subject to the external-contributor proof gate; its body nevertheless links an exact-head workflow artifact showing retained warmups and successful post-fix behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored automation PR is not subject to the external-contributor proof gate; its body nevertheless links an exact-head workflow artifact showing retained warmups and successful post-fix behavior.
Evidence reviewed 6 items Existing failure boundary: The PR adds a separate warmup collection and passes it through the same failure validator as measured samples, fixing the prior path where only measured samples determined benchmark health.
Measured metrics remain isolated: buildSuiteResult records warmupSamples but invokes summarizeSamples(samples), so baseline comparison and summary statistics remain measured-only.
Regression coverage: Focused coverage asserts a failed warmup gets a warmup-specific error, and the spawner test verifies one warmup plus two measured records with ordered timestamps.
Findings None None.
Security None None.

How this fits together

The startup benchmark launches OpenClaw CLI commands and emits a JSON report for source-performance automation. Warmups establish runtime state before measured samples; this change makes their health observable without using them as performance data.

flowchart LR
  A[Benchmark cases] --> B[CLI sample runner]
  B --> C[Warmup records]
  B --> D[Measured records]
  C --> E[Execution-health validation]
  D --> E
  D --> F[Performance summaries]
  E --> G[Source-performance gate]
  F --> H[JSON report]
Loading

Before merge

  • Resolve merge risk (P1) - This intentionally makes source-performance automation fail when a warmup times out, exits unexpectedly, or lacks RSS evidence. The PR discussion accepts that stricter CI policy, but it remains a deliberate automation-behavior change.
Agent review details

Security

None.

PR surface

Tests +50, Other +18. Total +68 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 53 3 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 43 25 +18
Total 3 96 28 +68

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: test/scripts/cli-startup-bench-spawner.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the fail-closed benchmark policy (recommended)
    Land the approved change so failed warmups record diagnostic evidence and correctly fail source-performance automation without affecting measured summaries.
  2. Pause for a looser policy
    Keep the measured-samples-only gate if maintainers no longer want runner or warmup health to control source-performance status.

Technical review

Best possible solution:

Land the focused runner-boundary change so warmups provide diagnostic health evidence while measured samples remain the sole source of performance statistics.

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

Yes. Current-main source discards warmup results before the sample-health validator, so a failed warmup can leave only valid measured samples to determine the result; the supplied exact-head workflow run exercises the repaired path.

Is this the best way to solve the issue?

Yes. Capturing warmups at the runner boundary and feeding them to the existing validator is the narrowest maintainable repair, preserving the measured-only summary and comparison contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

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

Label justifications:

  • P3: The PR affects internal benchmark and CI diagnostics rather than shipped user-facing runtime behavior.
  • merge-risk: 🚨 automation: Warmup failures now intentionally change a source-performance workflow result from passing to failing.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored automation PR is not subject to the external-contributor proof gate; its body nevertheless links an exact-head workflow artifact showing retained warmups and successful post-fix behavior.

Evidence

What I checked:

  • Existing failure boundary: The PR adds a separate warmup collection and passes it through the same failure validator as measured samples, fixing the prior path where only measured samples determined benchmark health. (scripts/bench-cli-startup.ts:1075, bb36df0ab806)
  • Measured metrics remain isolated: buildSuiteResult records warmupSamples but invokes summarizeSamples(samples), so baseline comparison and summary statistics remain measured-only. (scripts/bench-cli-startup.ts:1149, bb36df0ab806)
  • Regression coverage: Focused coverage asserts a failed warmup gets a warmup-specific error, and the spawner test verifies one warmup plus two measured records with ordered timestamps. (test/scripts/bench-cli-startup.test.ts:313, bb36df0ab806)
  • Current-main compatibility: There is no touched-path drift from the PR base a8d4642408c2fef9464daf88a87a835b72eb5843 to current main. GitHub context reports the PR as mergeable; local git merge-tree --write-tree could not run because it writes a temporary object in the read-only checkout. (scripts/bench-cli-startup.ts:1, 2f06ed30d8b1)
  • History and ownership: Blame attributes the new warmup-validation loop to this PR head, while the preceding measured-sample validator traces to Peter Steinberger’s existing benchmark path; the linked warm/first-device and WebSocket-readiness fixes were merged immediately beforehand. (scripts/bench-cli-startup.ts:1081, bb36df0ab806)
  • Real automation proof and policy approval: The PR body links an exact-head source-performance run with retained successful warmups and measured-only five-sample summaries. The latest MEMBER discussion explicitly approves fail-closed warmup validation. (bb36df0ab806)

Likely related people:

  • vincentkoc: Authored this focused benchmark repair and the immediately preceding merged warm/first-device and WebSocket-readiness benchmark work. (role: recent benchmark contributor; confidence: high; commits: bb36df0ab806, 6531ca91f457, a8d4642408c2; files: scripts/bench-cli-startup.ts, test/scripts/bench-cli-startup.test.ts, test/scripts/cli-startup-bench-spawner.test.ts)
  • steipete: History and blame connect Peter Steinberger to the existing measured-sample validation path this patch extends. (role: preceding validation-path author; confidence: high; commits: 17eafa716248; files: scripts/bench-cli-startup.ts, test/scripts/bench-cli-startup.test.ts)

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 (5 earlier review cycles)
  • reviewed 2026-08-01T21:45:04.865Z sha 36a7385 :: needs maintainer review before merge. :: none
  • reviewed August 1, 2026, 6:08 PM ET / 22:08 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T23:15:16.887Z sha bb36df0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T23:24:56.609Z sha bb36df0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T23:30:57.775Z sha bb36df0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 1, 2026
@vincentkoc
vincentkoc force-pushed the perf/gateway-health-connection-trace branch from 36a7385 to bb36df0 Compare August 1, 2026 23:10
@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 23:19
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

All prior before-merge items are resolved on
bb36df0ab806b56264ab3020ab8757a0d85da235:

  • classified the old failed source artifact as the HTTP-vs-WebSocket readiness
    race fixed by fix(perf): wait for gateway WebSocket readiness #117655;
  • exact merged-result run 30722795395 passes source, normal mock, deep profile,
    and live OpenAI;
  • source artifact retains three successful warmups separately while each
    measured summary remains five samples;
  • maintainer decision is explicit: warmup failures fail closed;
  • current-main merge-tree is clean and none of the touched files changed;
  • no persisted state or migration surface changed.

Please refresh the durable review against this exact head.

@clawsweeper

clawsweeper Bot commented Aug 1, 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 repository_dispatch).
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 rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Final exact-head landing gate for
bb36df0ab806b56264ab3020ab8757a0d85da235:

  • every current-head GitHub check is complete and successful;
  • exact Kova run 30722795395 passes source, normal mock, deep profile, and live
    OpenAI;
  • the maintainer decision is to adopt fail-closed warmups while keeping measured
    summaries measured-only;
  • the old failed artifact was the HTTP-vs-WebSocket readiness race already fixed
    by fix(perf): wait for gateway WebSocket readiness #117655;
  • the merge result against current main is clean and touched files have no
    main-side drift;
  • no persisted state or migration surface changed.

Please close every remaining before-merge item in the durable review if this
evidence is sufficient.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Maintainer and benchmark-workflow owner decision for
bb36df0ab806b56264ab3020ab8757a0d85da235:

I approve the fail-closed policy. A warmup is required command-health evidence,
not a disposable timing sample. If it times out, exits unexpectedly, omits RSS
evidence, or otherwise violates the same execution contract as a measured
sample, source-performance CI should fail while preserving the warmup in the
report for diagnosis. Measured summaries and baseline comparisons must continue
to use measured samples only.

All exact-head checks and Kova lanes are green, and the merge tree against
e8a158e4f5096e5200dc47c8d5d5148770ace234 is clean with no touched-file drift.
Please close the remaining policy item in the durable review.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 1, 2026
@vincentkoc
vincentkoc merged commit 825a794 into main Aug 1, 2026
155 of 161 checks passed
@vincentkoc
vincentkoc deleted the perf/gateway-health-connection-trace branch August 1, 2026 23:43
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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