Skip to content

test(perf): exercise dashboard traffic and large worktrees in gateway soaks - #179074

Merged
steipete merged 3 commits into
mainfrom
steipete/perf-micro-dev-gateway-stress-r176-shape-20260919
Oct 21, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/perf-micro-dev-gateway-stress-r176-shape-20260919

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The memory-soak harness did not exercise populated dashboard RPCs, multiple project diffs, preserved deep foreground histories, or large/nested worktrees. That left important Gateway stress paths outside the existing reproducible fixture.

User Impact

Developers can opt into these synthetic workload shapes through the existing isolated Gateway/provider harness. No production behavior, schema, or configuration surface changes.

Why This Change Was Made

The existing fixture owners now seed long histories with distinct thinking signatures, twelve registered worktrees and a bounded tracked inventory. --dashboard-rpc adds populated board/workboard reads, model/auth reads, session descriptions, synthetic GitHub previews, PR-subscription admission and rotating worktree diffs. Setup timings remain separate from measured cohorts. Writes remain sequential and observe the documented dirty-memory bound.

--verify-history-replay preserves foreground sessions between invocations and checks all seeded reasoning ciphertext at the provider boundary on every primary request. Its explicitly synthetic model has a finite 2,000,000-token effective context, sufficient for the preserved 500-turn histories; configurable oversized-history stress remains separate. Native profiling requests worker-memory sampling explicitly without regressing no-loader child startup. Reused dashboard fixtures paginate and reconcile cards to the requested viewer count.

Evidence

Two consecutive 25-minute runs on the same pinned runtime 544130c1623c (main base 5a97c908928f), with a graceful restart and preserved state, completed 50.0001 measured minutes. The final PR has a later main rebase and diagnostic-string-only type repair; this is runtime characterization, not a final-head performance or optimization A/B claim.

The fixture used 5,000 retained sessions, 6,000 retained runs, twelve worktrees, 270,000 unchanged tracked files, a nested repository, large retained transcripts and sixteen active 500-turn histories. Forty sockets exercised thirteen mixed RPC methods, paced streaming, Code Mode tools, native subagents and cron.

Metric Window 1 After restart
Verified primary turns / tool results 208 / 208 208 / 208
Native subagent cycles / in-window cron completions 13 / 50 13 / 50
Polling RPCs 12,025 12,068
Delivered frames 268,159 268,631
sessions.diff client p99 / maximum 16.122 s / 31.019 s 369 ms / 1.181 s
Main post-GC observed peak 1,239.7 MiB 1,200.9 MiB
Largest sampled transcript isolate 99.5 MiB 100.6 MiB
Main CPU per primary turn, including concurrent work 1,104 ms 1,068 ms
Main promotion per primary turn 111.12 MB 119.30 MB
Real-edit visibility control 188 ms 189 ms

All 1,000 seeded reasoning hashes were verified on every primary request, with zero foreground resets. One 31-second summary-worker operation caused head-of-line blocking in window 1; its nine Git subprocesses totaled only 184 ms. The remaining internal interval is unattributed, so this PR does not introduce a speculative production optimization. One short internal reservation rejection is also unexplained; all asserted user flows completed.

Earlier interrupted attempts are excluded from the accepted pair. One exceeded the original 8,000,000-byte hydration capacity after accumulated turns: seeded data remained durable, but full replay failed. The explicit verified-replay fixture mode increases only synthetic capacity and preserves the full assertion. The exact failed provider selection was not captured.

Limits: synthetic provider/GitHub transport, disconnected accounts, PR-subscription admission rather than remote discovery, backend clients rather than browser rendering, unequal real-world RPC mix, no presence traffic, burst streaming, tiny changed-file contents, warm filesystem caches, and sampled worker peaks. Transcript isolates had a measured 560 MiB limit. Post-GC values are latched observations; startup/final forced collections are excluded from the strict measured window. Main CPU profiling is separate from timing evidence; no worker CPU-profile claim.

Validation

Changed-file format, syntax, scoped lint and focused tests passed. Fresh independent autoreview found no actionable P0–P2 findings, including the subsequent diagnostic type repair. Exact-head CI run 39564692121 passes security, production types, benchmark/test types, lint, guards and selected test lanes. All four changed test files passed: fixture, resource sampling, calibration and RPC walk.

The only non-aggregate CI failure is check-test-types-core-2: two TS2345 errors in the unchanged CI-planning test at lines 813 and 891. The single-file native tsrs probe reproduces exactly those two diagnostics (exit 2) on measured head 544130c1623c and CI main parent 09cbdfea8784; all relevant test/type/config/runner sources are identical to the final PR head. The existing sandbox/install was reused after the campaign, without another checkout or install. CI tested merge f74abf984df83bb3d6cc96ac589aadeb3e206d27, whose parents are that main commit and final head 90649a9fd204. Main already contains the targeted fix 5ceb735696cd. The classifier called this new because the comparison main job used a different selected scope; the exact baseline reproduction establishes inherited attribution. Landing uses the authorized inherited-failure exception; CI is not claimed green. A local scripts typecheck could not complete because the shared installation lacks openid-client; no extra install was made under the host constraints.

The diff contains eleven benchmark/test/documentation files; production runtime LOC delta is zero. Added harness code supplies the requested workload/evidence through existing owners, without a runtime cache, fast path or compatibility layer. No Testbox/Crabbox lease was allocated.

@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@steipete
steipete marked this pull request as ready for review October 21, 2026 05:41
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T08:21:46.037406Z 90649a9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 165bec5b85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds dashboard RPC traffic, multiple worktree diffs, long reasoning histories, large checkouts, and worker-memory observations to Gateway benchmarks.

Example: Run a Gateway memory soak with 40 viewers and three registered worktrees.

  • Before: Polling covers four RPC methods and one worktree diff.
  • After: Dashboard mode covers 13 RPC methods and rotates diffs across all three worktrees.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The reported Gateway smoke supports the intended workload, but source-verified integration and measurement defects prevent a clean review.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored benchmark PR is outside the ordinary contributor proof gate; its body reports a real isolated Gateway smoke with 40 viewers, 13 RPC methods, and three worktree diffs, but supplies no linked raw terminal or log artifact.
Patch quality 🦪 silver shellfish (2/6) 4 actionable review findings remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers cannot measure dashboard traffic and large, nested worktrees with the existing Gateway soak workload.
Reason: The host identifies this as maintainer-authored work, and the requested workload shapes extend existing isolated tooling without changing product defaults.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep this useful, maintainer-directed benchmark expansion open; fix profiler loading, typed snapshot consumers, retained-card reconciliation, and memory-sampling cadence before merging.

Priority: P2
Reviewed head: 165bec5b85e6c9b3f02228ca9222c486f1ddab77

Before merge

  • Preserve bare-Node loading of the shared profiler preload (P2) - Existing profiler tests launch plain Node and import this preload without scripts/tsx.mjs. The new worker-cpu.ts dependency imports ../shared/global-singleton.js and other .js paths whose source files exist only as .ts, so those children fail module resolution before sending ready. The concurrency benchmark's direct preload consumers are affected too. Preserve a native-resolvable import closure or supply the supported resolver consistently to every affected consumer; the soak's explicit tsx preload alone does not repair this shared contract.
  • Update typed snapshot consumers for the new required fields (P2) - Making heapSpaces and workers required invalidates existing GatewayResourceSnapshot constructors in test/scripts/kitchen-sink-resources.test.ts and test/scripts/kitchen-sink-calibration.test.ts, plus the inferred snapshot passed by kitchen-sink-rpc-walk.test.ts. These objects omit both fields and therefore fail typechecking. Update those consumers together with the shared type, using valid empty observations where the fixtures have no workers.
  • Reconcile every persisted dashboard card before measurement (P2) - workboard.cards.list returns at most 100 cards and a nextCursor, but setup treats the first page length as the board's total. Running twice with --clients 120 creates 120 cards initially and adds another 20 on the next run; reducing 40 viewers to 20 also leaves all 40 cards. The measured retained state therefore depends on previous invocations. Follow pagination and reconcile the dedicated synthetic board to exactly clientCount, or reset that board before seeding. This confirms the existing connector finding.
  • Honor the memory interval across paced cohort boundaries (P2) - The wait is shortened to the end of each cohort gap, but sampleMemory runs unconditionally afterward. With --memory-interval-ms 60000 and --round-interval-ms 15000, short foreground cohorts now produce memory samples roughly every 15 seconds instead of every 60 seconds. This adds unintended sampling and output work to the measured workload. Schedule against the previous sample's deadline and sample only when that deadline is reached.

Findings

  • [P2] Preserve bare-Node loading of the shared profiler preload — scripts/lib/gateway-bench-profile-preload.ts:7
  • [P2] Update typed snapshot consumers for the new required fields — scripts/lib/gateway-bench-profile.ts:36-37
  • [P2] Reconcile every persisted dashboard card before measurement — scripts/perf/transcript-broadcast-measure.ts:2347-2351

Tests

  • Low-value test test/scripts/team-shape-fixture.test.ts: Replace the exact synthetic commit-subject assertion with verification that the nested repository has a committed HEAD; retain the clean-tree and tracked-inventory assertions.
  • Missing end-to-end proof: The reported smoke runs do not establish repeated-run card reconciliation above 100 viewers, reduced viewer counts, or preservation of the configured memory-sampling cadence.
Agent review details

How this fits together

The developer benchmark generates isolated synthetic state, drives a real Gateway through WebSocket RPCs, and exports workload, latency, allocation, and memory measurements.

flowchart LR
  A[Fixture options] --> B[Synthetic databases and worktrees]
  B --> C[Isolated Gateway]
  D[Benchmark viewers] --> C
  C --> E[Bundled dashboard plugins]
  E --> F[Synthetic GitHub transport]
  C --> G[Profiler and measurement reports]
Loading

Technical review

Best possible solution:

Keep the existing fixture and profiler owners, restore native loading and typed consumers, and make repeated dashboard runs honor their requested card count and sampling interval.

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

The introduced failures are traceable through existing subprocess entry points, typed snapshot constructors, Workboard pagination, and the pacing loop; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Extending the established benchmark owners is appropriate, and the added workload machinery serves the requested coverage; focused integration repairs are preferable to another launcher, registry, or configuration layer.

Full review comments:

  • [P2] Preserve bare-Node loading of the shared profiler preload — scripts/lib/gateway-bench-profile-preload.ts:7
    Existing profiler tests launch plain Node and import this preload without scripts/tsx.mjs. The new worker-cpu.ts dependency imports ../shared/global-singleton.js and other .js paths whose source files exist only as .ts, so those children fail module resolution before sending ready. The concurrency benchmark's direct preload consumers are affected too. Preserve a native-resolvable import closure or supply the supported resolver consistently to every affected consumer; the soak's explicit tsx preload alone does not repair this shared contract.
    Confidence: 0.99
  • [P2] Update typed snapshot consumers for the new required fields — scripts/lib/gateway-bench-profile.ts:36-37
    Making heapSpaces and workers required invalidates existing GatewayResourceSnapshot constructors in test/scripts/kitchen-sink-resources.test.ts and test/scripts/kitchen-sink-calibration.test.ts, plus the inferred snapshot passed by kitchen-sink-rpc-walk.test.ts. These objects omit both fields and therefore fail typechecking. Update those consumers together with the shared type, using valid empty observations where the fixtures have no workers.
    Confidence: 0.99
  • [P2] Reconcile every persisted dashboard card before measurement — scripts/perf/transcript-broadcast-measure.ts:2347-2351
    workboard.cards.list returns at most 100 cards and a nextCursor, but setup treats the first page length as the board's total. Running twice with --clients 120 creates 120 cards initially and adds another 20 on the next run; reducing 40 viewers to 20 also leaves all 40 cards. The measured retained state therefore depends on previous invocations. Follow pagination and reconcile the dedicated synthetic board to exactly clientCount, or reset that board before seeding. This confirms the existing connector finding.
    Confidence: 1
  • [P2] Honor the memory interval across paced cohort boundaries — scripts/perf/transcript-broadcast-measure.ts:2912-2913
    The wait is shortened to the end of each cohort gap, but sampleMemory runs unconditionally afterward. With --memory-interval-ms 60000 and --round-interval-ms 15000, short foreground cohorts now produce memory samples roughly every 15 seconds instead of every 60 seconds. This adds unintended sampling and output work to the measured workload. Schedule against the previous sample's deadline and sample only when that deadline is reached.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6eec479dbdfa.

Provenance checked

  • Synthetic transcript and project fixtures keeps the original intent (a2d5c3c: Provide reproducible realistic state through canonical storage owners while refusing existing destinations.)
  • Streaming mixed-RPC soak and diff controls keeps the original intent (db44c87: Measure allocation, promotion, GC, and latency together, with real RPC traffic and an edit-visibility control.)
  • Shared resource profiler keeps the original intent (50ea179: Collect resource snapshots through the private benchmark IPC owner without exposing a Gateway profiling endpoint.)

Testing

Proof path: none.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/scripts/gateway-bench-profile.test.ts test/scripts/bench-gateway-concurrency.test.ts test/scripts/kitchen-sink-resources.test.ts test/scripts/kitchen-sink-calibration.test.ts test/scripts/kitchen-sink-rpc-walk.test.ts test/scripts/team-shape-fixture.test.ts --maxWorkers=1
  • pnpm tsgo:test:root
  • pnpm tsgo:scripts
  • pnpm check:script-erasability
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit a2d5c3c adds scripts/perf/team-shape-fixture.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a2d5c3c4f070; files: scripts/perf/team-shape-fixture.ts)
  • Vincent Koc: Raw commit 50ea179 adds scripts/lib/gateway-bench-profile-preload.ts:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 50ea1795fc80; files: scripts/lib/gateway-bench-profile-preload.ts)

PR surface

Tests +74, Docs +65, Other +374. Total +513 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 74 0 +74
Docs 1 65 0 +65
Config 0 0 0 0
Generated 0 0 0 0
Other 6 405 31 +374
Total 8 544 31 +513

Review metrics

Metric Value Why it matters
Benchmark controls 5 new opt-in CLI flags Adds dashboard-rpc, long-transcript-entries, long-transcript-sessions, worktree-files, and nested-repository without adding runtime configuration.

Labels

Label changes:

  • add P2: The defects affect developer benchmark correctness and validation, with no changed production runtime behavior.
  • add merge-risk: 🚨 automation: The shared preload's new dependency closure breaks existing bare-Node test children, and required snapshot fields break typed test consumers.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The defects affect developer benchmark correctness and validation, with no changed production runtime behavior.
  • merge-risk: 🚨 automation: The shared preload's new dependency closure breaks existing bare-Node test children, and required snapshot fields break typed test consumers.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 21, 2026, 1:59 AM ET / 05:59 UTC.

@steipete
steipete force-pushed the steipete/perf-micro-dev-gateway-stress-r176-shape-20260919 branch from 165bec5 to d5381e2 Compare October 21, 2026 06:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5381e231a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete
steipete force-pushed the steipete/perf-micro-dev-gateway-stress-r176-shape-20260919 branch from d5381e2 to 544130c Compare October 21, 2026 07:29
Seed provider-bound reasoning history and verify full ciphertext replay at the mock boundary. Keep worker memory sampling opt-in for native profiling children, reconcile dashboard cards across reused fixtures, and update resource snapshot fixtures.
@steipete
steipete force-pushed the steipete/perf-micro-dev-gateway-stress-r176-shape-20260919 branch from 544130c to 90649a9 Compare October 21, 2026 07:49
@steipete
steipete merged commit 493ee24 into main Oct 21, 2026
105 of 108 checks passed
@steipete
steipete deleted the steipete/perf-micro-dev-gateway-stress-r176-shape-20260919 branch October 21, 2026 08:28
@steipete

Copy link
Copy Markdown
Contributor Author

Landed the reviewed head 90649a9fd204c339671bbec1ad50cefa9142eb49 under the authorized inherited-CI exception.

Run 39564692121 passed security, production/benchmark types, lint, guards and selected tests. The only non-aggregate failure was check-test-types-core-2: TS2345 at test/scripts/ci-changed-node-test-plan.test.ts:813 and :891. A focused single-file native tsrs probe reproduced the exact two diagnostics and exit 2 on CI's unchanged main parent 09cbdfea87849c465c398202b4164cfc1cd979f3, using the same isolated installation. Relevant test/type/config/runner sources are identical to the reviewed PR. Upstream 5ceb735696cd fixes that shared-key comparison contract. CI was not rerun or represented as green.

The accepted same-build stress pair completed 50 measured minutes, 416 verified history/tool turns, 26 subagent cycles, 100 cron completions and 24,093 polling RPCs. Full synthetic measurements and limitations are in the PR body. No production optimization is claimed; the initiating interval behind the reproduced 31-second diff stall remains unattributed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
… soaks (openclaw#179074)

* test(perf): exercise dashboard traffic and large worktrees in gateway soaks

* test(perf): preserve deep foreground histories across gateway soaks

Seed provider-bound reasoning history and verify full ciphertext replay at the mock boundary. Keep worker memory sampling opt-in for native profiling children, reconcile dashboard cards across reused fixtures, and update resource snapshot fixtures.

* test(perf): keep replay failure diagnostics type-safe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant