Skip to content

test(infra): measure worker Buffer storage directly - #207663

Merged
vincentkoc merged 1 commit into
mainfrom
test-worker-buffer-storage-20261129
Nov 28, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test-worker-buffer-storage-20261129

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The worker reclamation test can fail after its Buffer has been freed because external memory accounting still includes the prior allocation.

User Impact

No production behavior changes. Keep the allocation, reclamation, worker reuse and heap-limit assertions, using the Buffer backing-store counter for the Buffer row.

Why This Change Was Made

Measure arrayBuffers for the off-heap Buffer payload. Leave the heap row and all limits unchanged; add no waits, extra collection or runtime branches.

Evidence

  • The original Node test fails while arrayBuffers has already returned to its warm baseline.
  • Candidate: all 32 Node cases pass; Bun passes 24 cases with eight existing Node-only skips.
  • Retaining only the backing ArrayBuffer makes the reclamation assertion fail on Node and Bun, even after its Buffer wrapper finalizes.
  • Targeted formatting, lint, infrastructure test types and diff checks pass. No test cases or production lines added.
  • Worker group wall time: 15.38s on Node and 11.73s on Bun; both retained-buffer controls fail at the reclamation assertion.
  • Local ClawSweeper reviewed the complete committed range 501ee91..2aba799 with no findings.
  • Exact-head native suite and review-artifact validation pass.

@vincentkoc vincentkoc self-assigned this Nov 28, 2026
@clawsweeper

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

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR measures Buffer backing storage with arrayBuffers in the worker reclamation test.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is source-correct; execution confidence rests on reported worker-harness results because behavioral CI is skipped and tests were not rerun.
Proof confidence 🦐 gold shrimp (3/6) No shipped behavior changes; the body reports passing Node and Bun worker tests plus failing retained-backing-store controls, but provides no attached execution transcript for independent inspection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers can receive a false reclamation-test failure after the Buffer backing storage has been freed.
Reason: The maintainer-authored change aligns the measurement with the fixture allocation without adding waits, weakening thresholds, or changing runtime behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored draft makes a focused test-oracle correction with no actionable code findings; current main still uses the broader external-memory counter.

Reviewed head: 2aba799feea9798385ef5eac8cebf76fd1d7f3e0

Before merge

None.

Findings

None.

Agent review details

How this fits together

The memory test sends allocations through WorkerTaskPool, receives worker-local memory samples after finalization, and checks reclamation, worker reuse, and resource limits.

flowchart TD
  A[Memory test] --> B[WorkerTaskPool]
  B --> C[Allocation fixture]
  C --> D[Idle garbage collector]
  D --> E[Finalization receipt]
  E --> F[Memory and reuse assertions]
Loading

Technical review

Best possible solution:

Use arrayBuffers for the Buffer reclamation oracle while preserving the existing production collector and all behavioral assertions.

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

The body reports an original Node failure after backing storage returned to baseline, but this read-only review did not execute tests or independently reproduce the accounting lag.

Is this the best way to solve the issue?

This is the smallest complete correction: measure the allocated Buffer storage directly, retain the allocation and reclamation bounds, and avoid changing production GC behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Buffer reclamation measurement changes intended behavior with a stated reason (35d2e97: Check collection of completed large buffers independently of JavaScript heap growth while preserving worker reuse.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change preserves the behavioral checks: The introduced diff replaces external with arrayBuffers in fixture samples and the Buffer assertion selector; allocation sizes, thresholds, finalization receipts, heap checks, reuse, and resource limits remain intact. (src/infra/worker-task-pool.memory.test.ts:42, 2aba799feea9)
  • Current main still has the original oracle: Fetched main samples external for this Buffer row, so this correction is not already implemented there. (src/infra/worker-task-pool.memory.test-support.ts:11, 946fc2bc609c)
  • Runtime counter contract: The fixture directly calls process.memoryUsage(); Node documentation specifies that arrayBuffers includes Buffer allocations and is worker-local, whereas external also includes other native allocations. (doc/api/process.md)
  • Original reclamation intent: The earlier worker repair introduced the Buffer case to check dead external-buffer reclamation while retaining warm workers; this PR preserves that contract. (src/infra/worker-task-pool.memory.test-support.ts:25, 35d2e97a4af7)
  • Draft and validation state: GitHub confirms MEMBER authorship, draft status, and a clean mergeable head; the successful checks are ancillary checks, while behavioral CI is skipped. (2aba799feea9)
  • Inspection scope and history limit: Both changed files, their original blobs, complete memory-test history, production idle-GC owner, and sibling threshold tests were inspected; traversal into older worker-pool history stopped at an unavailable object. (src/infra/worker-idle-gc.ts:17, 2aba799feea9)

Likely related people:

  • Peter Steinberger: Raw commit 34cb8f7 adds src/infra/worker-task-pool.memory.test-support.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 34cb8f754344; files: src/infra/worker-task-pool.memory.test-support.ts)
  • Dallin Romney: Raw commit 35d2e97 adds src/infra/worker-task-pool.memory.test-support.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 35d2e97a4af7; files: src/infra/worker-task-pool.memory.test-support.ts)

PR surface

Tests 0. Total 0 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 5 5 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 5 5 0

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:

No label changes.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 28, 2026, 1:49 PM ET / 18:49 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 28, 2026 23:24
@vincentkoc
vincentkoc merged commit c384d29 into main Nov 28, 2026
198 of 199 checks passed
@vincentkoc
vincentkoc deleted the test-worker-buffer-storage-20261129 branch November 28, 2026 23:36
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 29, 2026
…or baseline

* commit '2f2edbf36836a8ddc6758dfdcce872d4414a3a92': (520 commits)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  chore(release): update appcast for 2026.11.11 (#207504)
  fix: let updates back up deeply nested databases (#207756)
  fix(telegram): stop resending earlier messages to the model on every turn in DM topics (#207684)
  feat(workboard): choose which sessions appear on a board (#207781)
  fix: acknowledge updates when the Gateway first becomes ready (#207819)
  chore: stop the cron recovery test from failing CI on slow runners (#207837)
  fix: queue follow-ups when session creation reuses an active chat (#207800)
  feat(clawrouter): consume qualified native memory embeddings (#191874)
  fix: save the account for main-session prompts and converted reminders (#207776)
  test(infra): measure worker Buffer storage directly (#207663)
  feat(workboard): hide sessions and filter subagents per board (#207744)
  chore(i18n): refresh native locales (#207796)
  fix: name safe recovery when agent schema markers disagree (#207705)
  improve(ui): show only setup warnings on skill pages (#203750)
  fix(gateway): keep Linux legacy lock recovery explicit (#207340)
  fix: deliver a saved child answer after a Gateway crash (#207706)
  fix(ui): fold background command wakes into chat activity (#207305)
  fix: restore the Feishu proxy transport tests (#207782)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…aseline

* commit '2f2edbf36836a8ddc6758dfdcce872d4414a3a92': (520 commits)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  chore(release): update appcast for 2026.11.11 (#207504)
  fix: let updates back up deeply nested databases (#207756)
  fix(telegram): stop resending earlier messages to the model on every turn in DM topics (#207684)
  feat(workboard): choose which sessions appear on a board (#207781)
  fix: acknowledge updates when the Gateway first becomes ready (#207819)
  chore: stop the cron recovery test from failing CI on slow runners (#207837)
  fix: queue follow-ups when session creation reuses an active chat (#207800)
  feat(clawrouter): consume qualified native memory embeddings (#191874)
  fix: save the account for main-session prompts and converted reminders (#207776)
  test(infra): measure worker Buffer storage directly (#207663)
  feat(workboard): hide sessions and filter subagents per board (#207744)
  chore(i18n): refresh native locales (#207796)
  fix: name safe recovery when agent schema markers disagree (#207705)
  improve(ui): show only setup warnings on skill pages (#203750)
  fix(gateway): keep Linux legacy lock recovery explicit (#207340)
  fix: deliver a saved child answer after a Gateway crash (#207706)
  fix(ui): fold background command wakes into chat activity (#207305)
  fix: restore the Feishu proxy transport tests (#207782)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…aseline

* commit '2f2edbf36836a8ddc6758dfdcce872d4414a3a92': (520 commits)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  chore(release): update appcast for 2026.11.11 (#207504)
  fix: let updates back up deeply nested databases (#207756)
  fix(telegram): stop resending earlier messages to the model on every turn in DM topics (#207684)
  feat(workboard): choose which sessions appear on a board (#207781)
  fix: acknowledge updates when the Gateway first becomes ready (#207819)
  chore: stop the cron recovery test from failing CI on slow runners (#207837)
  fix: queue follow-ups when session creation reuses an active chat (#207800)
  feat(clawrouter): consume qualified native memory embeddings (#191874)
  fix: save the account for main-session prompts and converted reminders (#207776)
  test(infra): measure worker Buffer storage directly (#207663)
  feat(workboard): hide sessions and filter subagents per board (#207744)
  chore(i18n): refresh native locales (#207796)
  fix: name safe recovery when agent schema markers disagree (#207705)
  improve(ui): show only setup warnings on skill pages (#203750)
  fix(gateway): keep Linux legacy lock recovery explicit (#207340)
  fix: deliver a saved child answer after a Gateway crash (#207706)
  fix(ui): fold background command wakes into chat activity (#207305)
  fix: restore the Feishu proxy transport tests (#207782)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…line

* commit '652611b9d924c754ac7a18d0081cce6e1ec765df': (527 commits)
  refactor(infra): simplify audit recovery write progress (#157141)
  fix: show restart blockers in service logs (#207879)
  test(infra): exercise group identity in session roundtrip (#207671)
  test(infra): exercise live owner expiry policy (#207672)
  feat: let Knowledge learn from your Gmail through Composio (#207266)
  test: stop the history-worker overload test from failing CI on slow runners (#207862)
  test(auth): assert SecretRef plaintext is absent from storage (#207698)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  chore(release): update appcast for 2026.11.11 (#207504)
  fix: let updates back up deeply nested databases (#207756)
  fix(telegram): stop resending earlier messages to the model on every turn in DM topics (#207684)
  feat(workboard): choose which sessions appear on a board (#207781)
  fix: acknowledge updates when the Gateway first becomes ready (#207819)
  chore: stop the cron recovery test from failing CI on slow runners (#207837)
  fix: queue follow-ups when session creation reuses an active chat (#207800)
  feat(clawrouter): consume qualified native memory embeddings (#191874)
  fix: save the account for main-session prompts and converted reminders (#207776)
  test(infra): measure worker Buffer storage directly (#207663)
  feat(workboard): hide sessions and filter subagents per board (#207744)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
(cherry picked from commit c384d29)

Companion audit: No later follow-up found. Measure Buffer storage in the existing worker proof without changing thresholds.

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

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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