Skip to content

refactor(scripts): share gateway benchmark runtime - #117769

Merged
steipete merged 2 commits into
mainfrom
codex/cleanup-scripts-packages-wave8
Aug 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/cleanup-scripts-packages-wave8

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Consolidates duplicated gateway benchmark infrastructure while preserving the distinct startup and restart lifecycles. Fixes startup output records split across stream chunks. Production LOC: +681/-890 (net -209); tests +27. Blacksmith proof: 111 focused tests, check:changed, and full build passed. Two independent xhigh reviews: clean, best fix.

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

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 11:29 PM ET / August 2, 2026, 03:29 UTC.

ClawSweeper review

What this changes

The branch moves common Gateway benchmark configuration, child-process, probe, trace, and output-buffer helpers into one shared runtime module, while preserving distinct startup and restart benchmark flows and fixing startup records split across output chunks.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-labeled, assigned PR open for normal maintainer review. Current main does not contain the shared runtime or the split-output repair, and no concrete correctness or security finding emerged from the startup/restart lifecycle and sibling-test review.

Priority: P3
Reviewed head: 0ce27603d072e6311f593b7aa749fcf114f98a64

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has a coherent owner-boundary refactor, sibling coverage for the extracted line-buffer behavior, and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This PR is labeled maintainer and assigned for maintainer handling, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Blacksmith validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This PR is labeled maintainer and assigned for maintainer handling, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Blacksmith validation.
Evidence reviewed 5 items Current main does not contain this PR: The PR head is not an ancestor of current main, while its base is; current main also has no changes to the two benchmark scripts or startup test since the PR base. The refactor therefore remains necessary rather than being implemented or superseded on main.
Canonical shared owner boundary: The added module owns the common Gateway child arguments, initial readiness probes, trace parsing, ready-log classification, and stream-line buffering used by both benchmarks.
Startup caller preserves lifecycle-specific behavior: The startup benchmark retains its own configuration and startup-trace projection while routing common environment, child-argument, ready-log, trace, and output-chunk behavior through the shared runtime.
Findings None None.
Security None None.

How this fits together

The Gateway benchmark scripts launch a local Gateway subprocess, probe readiness, parse logs and traces, then emit startup or restart measurements. The new shared runtime centralizes common CLI, fixture, process, probe, trace, and line-buffer handling used by both lifecycle-specific scripts.

flowchart LR
  Inputs[Benchmark command options] --> Shared[Shared benchmark runtime]
  Shared --> Startup[Startup benchmark]
  Shared --> Restart[Restart benchmark]
  Startup --> Gateway[Gateway subprocess]
  Restart --> Gateway
  Gateway --> Signals[Probe results and log records]
  Signals --> Results[Benchmark measurements]
Loading

Before merge

  • Add real behavior proof - Not applicable: This PR is labeled maintainer and assigned for maintainer handling, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Blacksmith validation.
  • Complete next step (P2) - The maintainer label and current assignment route this otherwise clean refactor to normal human review; there is no concrete narrow repair for an automated worker.
Agent review details

Security

None.

PR surface

Tests +27, Other -209. Total -182 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 27 0 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 681 890 -209
Total 4 708 890 -182

Review metrics

None.

Technical review

Best possible solution:

Land one shared benchmark-runtime module after the normal maintainer review and exact-head CI complete, keeping startup and restart lifecycle measurements as separate callers of the same common helpers.

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

Not applicable: this PR refactors benchmark tooling rather than reporting a user-facing defect. The branch includes a focused regression case for the concrete split-output condition, and existing restart tests cover the shared buffering semantics.

Is this the best way to solve the issue?

Yes. Centralizing the genuinely duplicated benchmark helpers while leaving lifecycle-specific startup and restart measurement logic in their callers is the narrowest maintainable repair; current main still carries the duplicated implementations.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded internal benchmark-tooling refactor with no demonstrated user-facing Gateway behavior change.
  • 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: This PR is labeled maintainer and assigned for maintainer handling, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Blacksmith validation.

Evidence

What I checked:

  • Current main does not contain this PR: The PR head is not an ancestor of current main, while its base is; current main also has no changes to the two benchmark scripts or startup test since the PR base. The refactor therefore remains necessary rather than being implemented or superseded on main. (scripts/bench-gateway-startup.ts:913, 14322647cd6c)
  • Canonical shared owner boundary: The added module owns the common Gateway child arguments, initial readiness probes, trace parsing, ready-log classification, and stream-line buffering used by both benchmarks. (scripts/lib/gateway-bench-runtime.ts:388, 0ce27603d072)
  • Startup caller preserves lifecycle-specific behavior: The startup benchmark retains its own configuration and startup-trace projection while routing common environment, child-argument, ready-log, trace, and output-chunk behavior through the shared runtime. (scripts/bench-gateway-startup.ts:550, 0ce27603d072)
  • Sibling lifecycle coverage already exercises extracted buffering helpers: The existing restart benchmark tests cover chunk carry-over, intentional partial-buffer retention, final flush behavior, and restart trace parsing; the branch adds the matching startup split-record regression case. (test/scripts/bench-gateway-restart.test.ts:148, 0ce27603d072)
  • PR provenance and release check: The refactor was introduced by the first branch commit and followed by a narrowly scoped helper-type privacy correction. No local release tag contains the branch head, so it is neither shipped nor present on current main. (scripts/lib/gateway-bench-runtime.ts:9, 0ce27603d072)

Likely related people:

  • steipete: Authored both branch commits and is the current assignee in the supplied PR timeline, making this the clearest routing contact for this proposed consolidation. (role: current refactor contributor and assignee; confidence: high; commits: 9f480fdb41cf, 0ce27603d072; files: scripts/bench-gateway-startup.ts, scripts/bench-gateway-restart.ts, scripts/lib/gateway-bench-runtime.ts)
  • Yiğit ERDOĞAN: Local blame attributes the current benchmark-script baseline to the available history boundary at commit 65d64818bb; the partial local history prevents stronger ownership attribution. (role: available-history baseline contributor; confidence: low; commits: 65d64818bb6b; files: scripts/bench-gateway-startup.ts, scripts/bench-gateway-restart.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 (1 earlier review cycle)
  • reviewed 2026-08-02T03:18:32.628Z sha 9f480fd :: needs real behavior proof before merge. :: none

@steipete
steipete merged commit f21ac5a into main Aug 2, 2026
101 checks passed
@steipete
steipete deleted the codex/cleanup-scripts-packages-wave8 branch August 2, 2026 03:33
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* refactor(scripts): share gateway benchmark runtime

* fix(scripts): keep benchmark helper types private
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: XL 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