Skip to content

improve(agents): isolate concurrency benchmark workers - #119749

Merged
vincentkoc merged 1 commit into
mainfrom
perf/agent-concurrency-benchmark-v2
Aug 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
perf/agent-concurrency-benchmark-v2

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Closes #119568
Issue: #119568

What Problem This Solves

Resolves a maintainer-tooling problem where the agent concurrency benchmark mixed process-global state, detached completion work, and durable SQLite writes across samples. The resulting timings and RSS values could not be attributed to one scenario and overstated percentile confidence.

Why This Change Was Made

The benchmark now uses one fresh worker process per scenario and size, emits schema v2, validates a framed worker result, and separates in-memory spawn registration from isolated durable SQLite registration. Spawn timing ends before completion is released; teardown then proves task, registry, wait, and durable rows are clean. Recovery still exercises interrupted-recovery coordinator routing, and completion dedupe now covers newest-first and oldest-first inputs.

Worker progress is written to stderr so the default multi-minute run remains observable without contaminating JSON stdout.

No production runtime, config, protocol, migration, or package surface changes.

User Impact

Maintainers get comparable agent-concurrency measurements with attributable process high-water RSS, deterministic cleanup, explicit durable-state proof, and honest p50/max reporting for the default five samples. p95/p99 appear only when at least 20 measured samples support them.

Evidence

Review Notes

  • Schema v2 intentionally removes the misleading process-wide peak RSS field and reports per-worker high-water RSS.

  • No latency thresholds are added; timings remain advisory.

  • Recovery full-map ownership optimization is deliberately deferred to a separate PR after this measurement contract lands.

  • AI-assisted implementation and review

  • I understand the code and validation evidence

@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 5, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 21:53
@vincentkoc
vincentkoc force-pushed the perf/agent-concurrency-benchmark-v2 branch from 7c6a0f4 to 57f0b50 Compare August 5, 2026 22:05
@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer reconciliation for exact head 57f0b505a347750c0581757ec666c2a81732a559:

  • Exact-head ClawSweeper artifact verdict: patch is correct (confidence 0.88); no findings; security cleared.
  • Rank-up moves reconciled: exact-head CI is green, and the review and rank-up guidance have been read and satisfied.
  • The public placeholder remained because the successful publisher artifact contained review_comment_sha256: none and unknown review comment id and URL, so there was no comment mutation payload.
  • No code or head changes were made. I am not requesting another re-review because the head is unchanged and the unchanged-head policy and loop guard say not to repeat it.

@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 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 6:41 PM ET / 22:41 UTC.

ClawSweeper review

What this changes

This PR runs each agent-concurrency benchmark scenario in a fresh worker process, validates framed results, and expands lifecycle-cleanup coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main still has the original shared-process benchmark, while this PR supplies the linked isolated-worker implementation. The reviewed patch has no actionable correctness or security finding, but its maintainer label and fresh member assignment require human landing judgment.

Priority: P3
Reviewed head: 57f0b505a347750c0581757ec666c2a81732a559
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent benchmark-infrastructure patch with strong supplied validation and no source-backed defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored maintainer-tooling PR is exempt from the external-contributor real-behavior-proof gate; the supplied benchmark and CI runs remain useful supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored maintainer-tooling PR is exempt from the external-contributor real-behavior-proof gate; the supplied benchmark and CI runs remain useful supplemental evidence.
Evidence reviewed 5 items Isolated worker boundary: The parent invokes a fresh worker per scenario and validates exit status, one result frame, identity, samples, memory, required invariants, and success before accepting measurements.
Lifecycle-owner coverage: The worker exercises real registration, completion, durable-state, recovery, and cleanup paths, then removes its isolated state directory on terminal paths.
Current-main comparison: Current main retains the original benchmark and none of the four touched paths changed between the PR base and current main, so the PR is not superseded.
Findings None None.
Security None None.

How this fits together

The maintainer benchmark invokes real subagent registration, admission, recovery, and completion paths, then emits JSON measurements. Isolated workers prevent one scenario’s process state or SQLite data from affecting the next measurement.

flowchart LR
  A[Benchmark command] --> B[Scenario scheduler]
  B --> C[Fresh worker process]
  C --> D[Subagent lifecycle owners]
  D --> E[Validated result frame]
  E --> F[JSON benchmark report]
Loading

Decision needed

Question Recommendation
Should this freshly assigned maintainer-owned benchmark implementation be landed after confirming the latest exact-head ClawSweeper rank-up guidance? Approve and land: Confirm the latest exact-head review has no remaining rank-up move, then land the isolated benchmark implementation.

Why: The patch is correct on reviewed source evidence, but the protected maintainer label and fresh member assignment require explicit human handling rather than automated cleanup.

Before merge

  • Resolve merge risk (P1) - The latest ClawSweeper comment body was unavailable in the supplied context, so the landing reviewer should confirm that no rank-up move remains for the exact head.
  • Complete next step (P2) - No mechanical repair is indicated; normal human handling is required because this is a freshly assigned maintainer-labeled PR.
Agent review details

Security

None.

PR surface

Tests +190, Other +780. Total +970 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 220 30 +190
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 1146 366 +780
Total 4 1366 396 +970

Review metrics

Metric Value Why it matters
Runtime, tooling, and test delta runtime +0; benchmark tooling +780 net; tests +190 net The added code is confined to maintainer measurement isolation and validation, not production runtime behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119568
Summary: This PR is the explicitly linked candidate implementation for the canonical benchmark request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the worker-isolation design and land it after the responsible maintainer confirms the exact-head review guidance is fully satisfied.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the worker-isolation design and land it after the responsible maintainer confirms the exact-head review guidance is fully satisfied.

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

Not applicable: this PR improves a maintainer benchmark rather than fixing a user-reported runtime failure; the supplied exact-head benchmark run is relevant validation.

Is this the best way to solve the issue?

Yes: process isolation fixes benchmark contamination at the measurement boundary without changing the production agent lifecycle owners.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is opt-in maintainer benchmarking infrastructure with no user-facing runtime, configuration, or protocol change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored maintainer-tooling PR is exempt from the external-contributor real-behavior-proof gate; the supplied benchmark and CI runs remain useful supplemental evidence.

Label justifications:

  • P3: This is opt-in maintainer benchmarking infrastructure with no user-facing runtime, configuration, or protocol 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 MEMBER-authored maintainer-tooling PR is exempt from the external-contributor real-behavior-proof gate; the supplied benchmark and CI runs remain useful supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Introduced the current benchmark and its test; blame and history retain this commit as the central current-main provenance. (role: benchmark introducer and recent area contributor; confidence: high; commits: 6edf4a2b7ed0, 40a3bd2e10; files: scripts/bench-agent-concurrency.ts, test/scripts/bench-agent-concurrency.test.ts, src/agents/subagent-registry-restart-recovery-coordinator.ts)

Rank-up moves

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

  • Confirm the latest exact-head ClawSweeper rank-up guidance before landing.

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.

@vincentkoc
vincentkoc merged commit b4e8295 into main Aug 5, 2026
113 checks passed
@vincentkoc
vincentkoc deleted the perf/agent-concurrency-benchmark-v2 branch August 5, 2026 22:49
@vincentkoc

Copy link
Copy Markdown
Member Author

Native squash merge completed.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main:
  perf(agents): isolate concurrency benchmark workers (openclaw#119749)
  fix(diagnostics): preserve OTEL startup failure (openclaw#119747)
  fix(agents): seed fresh session identity before transcript append (openclaw#119473)
  fix: steering reaches active runs across agent harnesses (openclaw#119594)
  fix(cli): report accurate filtered node totals (openclaw#119744)
  fix(skills): keep installed verdicts scoped to publisher (openclaw#119672)
  fix(diagnostics): honor signal-specific OTLP protocols (openclaw#119708)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
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.

[Feature]: Benchmark subagent concurrency hot paths

1 participant