Skip to content

fix(perf): give each concurrency sample a full deadline - #119164

Merged
vincentkoc merged 1 commit into
mainfrom
fix/gateway-concurrency-per-run-deadline
Aug 4, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/gateway-concurrency-per-run-deadline

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Follow-up to #118364 and #119063.

What Problem This Solves

Fixes an issue where release validation running the gateway concurrency benchmark with a warmup and multiple measured samples could time out a later sample even when that sample completed within the configured timeout. The benchmark treated --timeout-ms as one shared budget, so earlier runs consumed the time available to later runs.

Why This Change Was Made

Each warmup or measured gateway sample now receives its own pre-warmup timeout budget. The existing per-sample probe-warmup exclusion remains in runGatewaySample, and the sample loop is extracted behind focused injection points so deadline renewal is covered without booting a gateway.

This is the benchmark owner boundary. Increasing the release workflow timeout would only hide the shared-deadline bug and would leave later samples with progressively less time.

Provenance: the shared whole-benchmark deadline originated with the concurrency benchmark in #118193 (3f3ceb2defbe) and was carried forward when probe warmup was added in #118364 (347f16d5565d). Beta 8 full validation made the failure deterministic by running one warmup plus three measured samples.

User Impact

Tooling only. Release and performance validation can run repeated gateway concurrency samples without false late-run timeouts caused by earlier samples.

Evidence

AI-assisted: yes. I reviewed the implementation and validation evidence.

@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 4, 2026 08:48
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 5:03 AM ET / 09:03 UTC.

ClawSweeper review

What this changes

This PR gives each gateway-concurrency warmup or measured sample its own timeout budget and adds a regression test for the renewed deadline.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness or security finding: this is the focused owner-boundary repair for a shared benchmark deadline. It remains open for explicit maintainer handling because it is Member-authored and carries the protected maintainer label.

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

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The focused owner-boundary fix, deterministic regression test, exact-head runtime evidence, and clean review support a strong rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.
Evidence reviewed 7 items Current-main defect: Current main creates one deadline before the entire warmup-plus-run loop and reuses it for every sample; elapsed earlier samples therefore reduce later samples' load budget.
Owner-boundary repair: The PR renews the deadline immediately before each sample while preserving the callee's separate probe-warmup exclusion and routes main through the extracted loop.
Regression coverage: The focused test injects time and the sample runner, proving a warmup and measured run receive independent deadlines of 6000 and 14000 milliseconds and that only measured runs are retained.
Findings None None.
Security None None.

How this fits together

Release validation invokes the gateway concurrency benchmark to run warmups and measured synthetic agent-load samples. The benchmark establishes deadlines for gateway startup, probe warmup, load, and emits JSON telemetry for the validation workflow.

flowchart LR
  A[Release validation] --> B[Concurrency benchmark]
  B --> C[Warmup and measured sample loop]
  C --> D[Per-sample deadline]
  D --> E[Gateway probe warmup]
  E --> F[Concurrent load probes]
  F --> G[Benchmark JSON telemetry]
Loading

Decision needed

Question Recommendation
Should this maintainer-owned benchmark contract change land with --timeout-ms applying independently to each warmup and measured sample? Land per-sample deadlines: Accept the focused fix so every requested concurrency sample receives the documented full timeout budget.

Why: The source and proof support the repair, but the protected maintainer label requires explicit human handling.

Before merge

  • Complete next step (P2) - The protected maintainer label and Member authorship require explicit maintainer review; no mechanical repair remains.
Agent review details

Security

None.

PR surface

Tests +28, Other +13. Total +41 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 28 0 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 31 18 +13
Total 2 59 18 +41

Review metrics

Metric Value Why it matters
Production versus test LOC production +31/-18; tests +28/-0 The net production growth is the narrowly scoped injectable sample-loop boundary needed to regression-test sequential deadline renewal.

Technical review

Best possible solution:

Keep deadline renewal in the sample-loop owner, preserving the existing probe-warmup exclusion rather than masking the defect with a longer release-workflow timeout.

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

Yes, from current source: one pre-loop deadline is consumed across sequential samples, and the PR body supplies a matching before-run on the same benchmark path; this read-only review did not execute it locally.

Is this the best way to solve the issue?

Yes. Renewing the deadline at the sample-loop boundary preserves the callee's existing probe-warmup accounting; increasing the enclosing workflow timeout would only hide the shared-budget bug.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This corrects release-validation benchmark tooling with limited direct user blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.

Label justifications:

  • P3: This corrects release-validation benchmark tooling with limited direct user blast radius.
  • 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. Sufficient (live_output): Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Exact-head Blacksmith Testbox evidence in the PR body shows the repaired multi-sample benchmark completing after the previously observed late-sample timeout, with focused regression coverage as supplemental proof.

Evidence

What I checked:

  • Current-main defect: Current main creates one deadline before the entire warmup-plus-run loop and reuses it for every sample; elapsed earlier samples therefore reduce later samples' load budget. (scripts/bench-gateway-concurrency.ts:824, da3b5edf40d9)
  • Owner-boundary repair: The PR renews the deadline immediately before each sample while preserving the callee's separate probe-warmup exclusion and routes main through the extracted loop. (scripts/bench-gateway-concurrency.ts:817, dd3ee190d375)
  • Regression coverage: The focused test injects time and the sample runner, proving a warmup and measured run receive independent deadlines of 6000 and 14000 milliseconds and that only measured runs are retained. (test/scripts/bench-gateway-concurrency.test.ts:79, dd3ee190d375)
  • Caller and sibling convention: The CPU-scenarios wrapper passes warmup and run counts to this benchmark, while startup and restart benchmark loops already allocate their timeout per sample; extending the workflow timeout would leave the local shared-deadline defect intact. (scripts/check-gateway-cpu-scenarios.mjs:411, da3b5edf40d9)
  • Clean three-way merge: Merging the PR head with current main succeeds cleanly; current main's only intervening commit changes the Crabbox wrapper and its test, not either benchmark path. (scripts/bench-gateway-concurrency.ts:817, dd3ee190d375)
  • Area provenance: Commit metadata identifies Peter Steinberger's benchmark and warmup work, followed by Vincent Koc's recent merged benchmark repair; unavailable promisor history prevented a complete line-level blame pass. (scripts/bench-gateway-concurrency.ts:824, 98feafe78506)

Likely related people:

  • vincentkoc: Authored this change and the immediately preceding merged gateway-benchmark repair. (role: recent area contributor; confidence: high; commits: 98feafe78506, dd3ee190d375; files: scripts/bench-gateway-concurrency.ts, test/scripts/bench-gateway-concurrency.test.ts)
  • steipete: Merged benchmark creation and its probe-warmup follow-up establish the surrounding deadline design. (role: benchmark origin contributor; confidence: medium; commits: 3f3ceb2defbe, 347f16d5565d; files: scripts/bench-gateway-concurrency.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.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision: land the per-sample --timeout-ms contract.

Rank-up move handled: the protected maintainer label is deliberate, and the exact-head Testbox benchmark, green hosted CI, clean P1 autoreview, and ClawSweeper review provide the required owner proof. No mechanical repair remains.

@vincentkoc
vincentkoc merged commit 4def15d into main Aug 4, 2026
130 of 140 checks passed
@vincentkoc
vincentkoc deleted the fix/gateway-concurrency-per-run-deadline branch August 4, 2026 09:05
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
…checkpoint

* origin/main: (46 commits)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  fix(scripts): prevent gateway benchmarks from stalling on probes (#119063)
  test(channels): verify built sanitizer semantics (#119151)
  fix: prevent live updater from leaving Gateway offline indefinitely (#119116)
  test(qa): restore memory tools primary ownership (#119142)
  fix(agents): settle yielded fanout at harness boundary (#118703)
  fix(codex): cap compaction override warning cache via createDedupeCache (#101745)
  fix(daemon): skip unlabeled launchd plists (#119091)
  test(qa): repair QA catalog integrity (#119140)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (208 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
…time

* origin/main: (177 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (openclaw#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (openclaw#119218)
  test(qa): cover Canvas agent and node controls (openclaw#119047)
  fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051)
  fix(gateway): keep agents list on prepared model facts (openclaw#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (openclaw#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575)
  fix(agents): recover from invalid compaction summaries (openclaw#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166)
  fix(plugins): preserve metadata reloads during models status (openclaw#119183)
  fix(test): bound direct gateway server runs (openclaw#119184)
  test(tui): prove command surfaces through PTY (openclaw#119165)
  fix(testbox): restore claims across path aliases (openclaw#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (openclaw#119164)
  fix(testbox): remove changed-gate sync residue (openclaw#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (openclaw#118998)
  ...
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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