Skip to content

fix(bench): require the state-reader task counter - #198912

Merged
RomneyDa merged 1 commit into
mainfrom
fix/state-read-bench-task-census
Nov 14, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/state-read-bench-task-census

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Related: #197510, #198894; follows the optional broker metric introduced by #198866.

What Problem This Solves

check-test-types fails at scripts/perf/state-read-worker-bench.ts:373 with TS18048 after tasksCompleted became optional for broker workers. The benchmark selects the state-read pool worker, where a completed-task count is required to verify every measured reply.

Why This Change Was Made

Assert that the selected worker supplies its task count before summing it. This narrows the real contract without a cast or a fabricated zero. Missing telemetry now fails clearly; the task-delta assertion, measurement boundaries and GC calculations stay unchanged. One script changes: four lines added, one removed. No production runtime, schema, configuration or dependency change.

User Impact

Restores script typechecking and keeps benchmark results from silently treating unavailable counters as measured zero. No user-facing runtime behavior changes.

Evidence

  • Pinned base b27440329b4c450ec4c572e40ed338ed98f3d9c7: exact node scripts/run-tsgo.mjs -p tsconfig.scripts.json --noEmit fails with TS18048 at the unchanged reduction. The same graph passes with this fix; the negative-control swap restored the candidate and verified byte equality.
  • Targeted typed lint, oxfmt and git diff --check pass.
  • Real benchmark entry point on a new synthetic fixture: node --import ./scripts/tsx.mjs scripts/perf/state-read-worker-bench.ts --output <new-fixture> --iterations 1 --rows 500 exits 0. After the required 200 warmups, the measured worker counter advances 200 → 201 and the existing complete-reply assertion passes. This is functional smoke evidence, not a performance comparison.
  • Complete-source independent autoreview through the OpenClaw engine (P0–P2) is scoped-clean.
  • Hosted exact-head CI is complete: build, script/core types, lint, selected tests and the aggregate CI gate pass at 346f83a28308f15240cb345c6bab35862a2539f0. The hosted review reports no findings at that same head, and the complete review-thread query has zero threads. This does not qualify fix: reduce Gateway stalls under filesystem pressure #197510’s integrated Linux/btrfs, Doctor/upgrade or performance campaign. No merge or backport requested.

Broker worker metrics can omit tasksCompleted, while this benchmark requires the state-reader pool counter to validate reply coverage. Assert that contract before summing rather than treating missing telemetry as zero.

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 14, 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The benchmark asserts that state-reader task counts exist before adding them.

Example: Typecheck the benchmark after worker metrics made tasksCompleted optional.

  • Before: The unguarded addition fails with TS18048.
  • After: The assertion narrows the counter to number while preserving task-delta validation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal contract-preserving repair supported by exact-head CI and a reported real-worker smoke; no actionable defects or unnecessary machinery found.
Proof confidence 🐚 platinum hermit (4/6) This benchmark-only type repair needs no shipped-product demonstration; the supplied smoke reports a real state-reader counter advancing from 200 to 201, and exact-head CI verifies type compatibility.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Repository script typechecking fails after broker diagnostics made task counts optional.
Reason: The maintainer-authored direction repairs a concrete validation failure without changing runtime behavior or introducing another metrics owner.

Regression provenance

Regression provenance — verified: source commit d8b6c2838082 by Peter Steinberger; canonical PR #198866 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

This PR is a focused, correct repair for a current script-typechecking failure. No actionable findings remain, and exact-head typechecking and the CI gate pass; maintainer authorship also requires keeping it open.

Priority: P2
Reviewed head: 346f83a28308f15240cb345c6bab35862a2539f0

Before merge

None.

Findings

None.

Agent review details

How this fits together

The benchmark sends synthetic state-read requests through real workers and consumes lifecycle metrics to verify reply coverage and calculate GC measurements.

flowchart LR
  A[Synthetic state fixture] --> B[Benchmark requests]
  B --> C[State reader pool]
  C --> D[Worker lifecycle metrics]
  D --> E[Required counter assertion]
  E --> F[Reply coverage and GC results]
Loading

Technical review

Best possible solution:

Retain this local assertion so the benchmark accepts the broader metrics type without weakening its required task-count invariant.

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

The pinned main reduction adds a number to an optional counter, establishing the TS18048 path; the author reports a failing-base/passing-head comparison, and exact-head typechecking passes.

Is this the best way to solve the issue?

This is the smallest complete fix: assert the benchmark's stronger counter requirement at consumption while leaving broker metrics optional and preserving the existing reply-coverage assertion.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Benchmark task census keeps the original intent (6eab5d6: The original real-worker benchmark checks complete replies and measures allocation, CPU, and GC under a fixed synthetic workload.)
  • Optional broker task counter keeps the original intent (d8b6c28: Broker workers contribute GC metrics but do not participate in the pool task-reply protocol, so they must not invent completed-task counts.)

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6eab5d6 adds scripts/perf/state-read-worker-bench.ts:161 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6eab5d6a6483; files: scripts/perf/state-read-worker-bench.ts)

PR surface

Other +3. Total +3 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 1 +3
Total 1 4 1 +3

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Repairs a current shared script-typechecking failure with limited tooling impact and no production runtime change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repairs a current shared script-typechecking failure with limited tooling impact and no production runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 November 14, 2026, 9:42 AM ET / 14:42 UTC.

@RomneyDa
RomneyDa merged commit 5e302bd into main Nov 14, 2026
123 checks passed
@RomneyDa
RomneyDa deleted the fix/state-read-bench-task-census branch November 14, 2026 14:45
vincentkoc added a commit that referenced this pull request Nov 14, 2026
* commit 'e741fd0d21ff7f9857a9c49f91d95166beaae83f':
  feat: invite members as existing people on a claw (#198773)
  fix(anthropic): report owner loss after a broken CLI input pipe (#198778)
  feat(browser): support experimental Kitesurf browsing (#198833)
  fix(bench): require the state-reader task counter (#198912)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
Broker worker metrics can omit tasksCompleted, while this benchmark requires the state-reader pool counter to validate reply coverage. Assert that contract before summing rather than treating missing telemetry as zero.

Co-authored-by: RomneyDa <[email protected]>
roboclaw-bot pushed a commit that referenced this pull request Nov 15, 2026
Preserve the benchmark invariant when diagnostics also include worker kinds without task counters. Integrates the exact upstream #198912 repair for the PR merge type failure.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
roboclaw-bot pushed a commit that referenced this pull request Nov 16, 2026
Allow Kubernetes deployment help to print before deployment tools or cluster access are available, while preserving preflight checks for all operational modes.

Validated the exact script in 18 isolated base/head scenarios, including both help flags, absent tools, unreachable-cluster controls, and all three teardown modes.

CI exception: check-test-types in run 43605802000, attempt 2, fails on TS18048 in scripts/perf/state-read-worker-bench.ts:373. The tested baseline and merge have identical benchmark inputs; main already contains the repair from #198912. No passing CI conclusion is claimed for that failed attempt. Security and review gates remain required.

Closes #198913.

Co-authored-by: Leonardo Bohac <[email protected]>
Co-authored-by: sallyom <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
Allow Kubernetes deployment help to print before deployment tools or cluster access are available, while preserving preflight checks for all operational modes.

Validated the exact script in 18 isolated base/head scenarios, including both help flags, absent tools, unreachable-cluster controls, and all three teardown modes.

CI exception: check-test-types in run 43605802000, attempt 2, fails on TS18048 in scripts/perf/state-read-worker-bench.ts:373. The tested baseline and merge have identical benchmark inputs; main already contains the repair from openclaw#198912. No passing CI conclusion is claimed for that failed attempt. Security and review gates remain required.

Closes openclaw#198913.

Co-authored-by: Leonardo Bohac <[email protected]>
Co-authored-by: sallyom <[email protected]>
roboclaw-bot added a commit that referenced this pull request Nov 16, 2026
)

* fix(ui): reveal selected mobile pages without drawer delay

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(ui): show mobile destinations without the drawer exit delay

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 217faa0a-9598-84e4-bd22-22f7f548856b

* fix(perf): require the state-reader task census

Preserve the benchmark invariant when diagnostics also include worker kinds without task counters. Integrates the exact upstream #198912 repair for the PR merge type failure.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): expose pending end-to-end setup phases

Record opt-in setup starts before the fixture awaits that completed-only
intervals cannot identify when CI reaches its step deadline. Preserve the
completed schema and owner outcomes even when diagnostic writes fail.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): remove redundant phase log coercions

Use the already-string writeSync mock arguments directly so the phase
helper assertions satisfy the required type-aware lint rule.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): remove temporary setup investigation probes

Restore the five diagnostic-only files to their pre-investigation content.
Keep canonical completed phase records and error preservation while retaining
the mobile navigation fix and upstream task census repair.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(ui): simplify drawer close state

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…claw#198879)

* fix(ui): reveal selected mobile pages without drawer delay

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(ui): show mobile destinations without the drawer exit delay

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 217faa0a-9598-84e4-bd22-22f7f548856b

* fix(perf): require the state-reader task census

Preserve the benchmark invariant when diagnostics also include worker kinds without task counters. Integrates the exact upstream openclaw#198912 repair for the PR merge type failure.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): expose pending end-to-end setup phases

Record opt-in setup starts before the fixture awaits that completed-only
intervals cannot identify when CI reaches its step deadline. Preserve the
completed schema and owner outcomes even when diagnostic writes fail.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): remove redundant phase log coercions

Use the already-string writeSync mock arguments directly so the phase
helper assertions satisfy the required type-aware lint rule.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* test(ui): remove temporary setup investigation probes

Restore the five diagnostic-only files to their pre-investigation content.
Keep canonical completed phase records and error preservation while retaining
the mobile navigation fix and upstream task census repair.

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

* fix(ui): simplify drawer close state

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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