Skip to content

perf(test): poll ClickClack gateway faster#109803

Merged
steipete merged 5 commits into
mainfrom
codex/test-performance-more-37
Jul 17, 2026
Merged

perf(test): poll ClickClack gateway faster#109803
steipete merged 5 commits into
mainfrom
codex/test-performance-more-37

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The ClickClack gateway suite accumulated Vitest's 50 ms default polling delay across asynchronous gateway-state assertions.

Why This Change Was Made

Route 25 safe assertions through a test-local helper with a 1 ms interval. Preserve every assertion and Vitest's default timeout. Leave two token-fixture-adjacent waits unchanged so credential-like fixture text never enters the review diff.

User Impact

No user-visible or production behavior changes. Controlled same-Testbox median test-body time drops from 1.890 seconds to 671 milliseconds.

Evidence

  • Before: 1.971/1.890/1.881 seconds; median 1.890 seconds.
  • After: 671/672/667 milliseconds; median 671 milliseconds (about 64% faster).
  • Testbox tbx_01kxqhvjqsje8kdjyd4p1vjxas: 20/20 tests passed across all comparison runs.
  • Same Testbox: pnpm check:changed passed after formatter correction.
  • Autoreview: clean, 0.99 confidence.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof:

  • Testbox tbx_01kxqhvjqsje8kdjyd4p1vjxas: 20/20 focused tests passed across three baseline and three patched runs.
  • Median test-body time: 1.890 seconds before, 671 milliseconds after (about 64% faster).
  • Same Testbox pnpm check:changed: passed.
  • Fresh autoreview: clean, 0.99 confidence.
  • No production or CI behavior changes.

@steipete

Copy link
Copy Markdown
Contributor Author

CI gap: check-test-types fails in unrelated release tooling at scripts/openclaw-npm-postpublish-verify.ts:32 because scripts/lib/error-format.mjs lacks a declaration. That surface entered main in 8858944a81c5 and is outside this test-only PR; the ClickClack diff does not touch scripts or CI. The exact patch passed the extension test typecheck inside pnpm check:changed, all 20 focused tests across three runs, and fresh autoreview. No CI behavior changes are included here.

@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 5:10 AM ET / 09:10 UTC.

Summary
Adds a test-local 1 ms vi.waitFor helper and routes 25 ClickClack gateway-state assertions through it while preserving the existing timeout.

PR surface: Tests +6. Total +6 across 1 file.

Reproducibility: not applicable. This PR optimizes existing test polling rather than reporting a production bug. Its performance claim has a controlled before-and-after Testbox comparison.

Review metrics: 1 noteworthy metric.

  • Polling assertions: 25 changed, 2 intentionally unchanged. The optimization is consistently applied to safe gateway-state waits while excluding the two credential-like fixture-adjacent locations described in the PR.

Merge readiness
Overall: 🦀 challenger crab
Proof: 🦀 challenger crab
Patch quality: 🦀 challenger crab
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The branch is behind current main, so the final merge result and exact-head required checks still need ordinary maintainer gating; stale-base drift alone does not indicate a patch defect.

Maintainer options:

  1. Decide the mitigation before merge
    Land the test-local helper after exact-head checks confirm the current merge result, keeping the default timeout and the intentionally unchanged token-fixture-adjacent waits rather than changing global Vitest polling behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the protected maintainer-labeled PR needs normal exact-head maintainer review and merge gating.

Security
Cleared: The one-file test-only diff adds no production execution, dependency, secret, permission, workflow, or supply-chain surface.

Review details

Best possible solution:

Land the test-local helper after exact-head checks confirm the current merge result, keeping the default timeout and the intentionally unchanged token-fixture-adjacent waits rather than changing global Vitest polling behavior.

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

Not applicable: this PR optimizes existing test polling rather than reporting a production bug. Its performance claim has a controlled before-and-after Testbox comparison.

Is this the best way to solve the issue?

Yes. A test-local wrapper is the narrowest maintainable fix because it preserves Vitest's timeout and avoids changing polling behavior for unrelated suites.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

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

Label justifications:

  • P3: This is a low-risk, test-only performance improvement with no production or user-visible behavior change.
  • rating: 🦀 challenger crab: Overall readiness is 🦀 challenger crab; proof is 🦀 challenger crab and patch quality is 🦀 challenger crab.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Controlled same-Testbox before-and-after runs show all focused tests passing with a repeatable median reduction from 1.890 seconds to 671 milliseconds, plus a passing changed-surface check.
  • proof: sufficient: Contributor real behavior proof is sufficient. Controlled same-Testbox before-and-after runs show all focused tests passing with a repeatable median reduction from 1.890 seconds to 671 milliseconds, plus a passing changed-surface check.
Evidence reviewed

PR surface:

Tests +6. Total +6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 31 25 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 31 25 +6

What I checked:

Likely related people:

  • zsxsoft: Recent merged ClickClack allowlist work touched the same gateway behavior and test surface, making this a useful adjacent routing candidate. (role: recent ClickClack behavior contributor; confidence: medium; files: extensions/clickclack/src/gateway.ts, extensions/clickclack/src/gateway.test.ts)
  • steipete: The submitted optimization and repeated exact-head maintenance commits show direct familiarity with this test suite; broader repository history also connects this person to gateway and test-infrastructure performance work. (role: recent test-performance contributor; confidence: medium; commits: 526c93b77cd6; files: extensions/clickclack/src/gateway.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-17T08:21:44.141Z sha 526c93b :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T08:47:48.509Z sha afb0196 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-17T08:57:15.688Z sha ec74ec0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Jul 17, 2026
@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 Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 17, 2026
@steipete
steipete merged commit d023e8b into main Jul 17, 2026
85 of 86 checks passed
@steipete
steipete deleted the codex/test-performance-more-37 branch July 17, 2026 09:22
@steipete

Copy link
Copy Markdown
Contributor 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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. 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