Repository navigation
improve(status): report external and ArrayBuffer memory - #141902
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 9:26 AM ET / 13:26 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds external and ArrayBuffer memory counters to Gateway status and includes their values and growth in concurrency benchmark reports. Merge readiness✅ Ready for maintainer review The PR remains useful: current main and v2026.9.4 lack these status counters. No actionable correctness or security defect was found, and the prior review recorded no findings. Member authorship and the protected maintainer label also preclude automated closure. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway answers status requests with a snapshot of its Node.js memory usage. The concurrency benchmark reads that response before and after a workload, converts bytes to MiB, and summarizes the observations. flowchart LR
A[Status request] --> B[Gateway status handler]
C[Node memory snapshot] --> B
B --> D[Status response in bytes]
D --> E[Benchmark memory reader]
E --> F[Optional counters in MiB]
F --> G[Observed values and growth summaries]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +128, Other +45. Total +178 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one status memory snapshot and one benchmark reader, preserving unknown optional counters and documenting that ArrayBuffer memory overlaps external memory. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this adds diagnostics. Source inspection confirms that current main omits the requested counters from Gateway status. Is this the best way to solve the issue? Yes. Extending the existing snapshot and benchmark reader is a narrow solution; existing diagnostic-event sampling serves a different output path and need not be invoked by status. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a7b7fecfd7f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
* commit '0ac8a700e43efceef73d92fe8e50b185819e38ad': (27 commits) test(acpx): prove targeted turn cancellation (#137049) fix(ci): honor realtime meeting live-test opt-in (#147044) improve: reduce heartbeat enrollment work for large fleets (#147055) fix(gateway): install despite stale Linux session bus addresses (#146569) chore(i18n): refresh native locales (#147025) fix: avoid Gateway reinstalls when macOS service inspection is inconclusive (#146880) fix(pairing): QR setup rejects trusted-proxy gateways without a shared secret (#147036) fix(update): bound activation and accept slow Windows identity reads (#147019) perf(accounts): avoid materializing avatars for owner checks (#147032) improve(status): report external and ArrayBuffer memory (#141902) fix(update): preserve linked plugins during post-core sync (#147009) fix(channels): keep replies working after hot config reloads (#147001) refactor(gateway): defer worker transcript runtime loading (#143495) improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021) fix(test): avoid settings lock writer startup timeouts (#147029) fix(update): correct backup guidance and cover incident regressions (#147023) refactor(gateway): share connection lifecycle across transports (#145950) refactor(telegram): share HTML text escaping (#146936) perf(build): reduce disk use in UI performance checks (#146687) refactor(memory-wiki): share freshness result construction (#146935) ... # Conflicts: # src/config/sessions/session-accessor.sqlite-reclamation-memory.test.ts
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Resolves a problem where operators inspecting Gateway status or concurrency
benchmark results could see RSS and V8 heap usage but lacked the corresponding
external and ArrayBuffer memory counters.
Why This Change Was Made
Add optional
externalBytesandarrayBuffersBytesto the existingprocessMemoryresponse using the sameprocess.memoryUsage()snapshot alreadyused for RSS and heap. Carry those counters through the existing benchmark
observations and summaries without new polling, forced garbage collection,
runtime configuration, or a protocol version change.
User Impact
existing
Mbnaming convention with values converted to MiB.unknown rather than becoming zero, while actual zero values are preserved.
before/after observations for that counter and preserve zero or negative
changes.
responding Node thread/isolate, not an aggregate across worker threads.
to sum with it. These observations do not identify individual allocators,
establish memory peaks, or measure a process tree.
This is an additive diagnostics change, not a claim of lower memory use or
faster runtime performance.
Evidence
Reconciled Remote Wire Proof
September 13, 2026: configured Blacksmith Testbox/Linux, Node 24.19.0,
pnpm 12.3.4, Vitest 5.0.0, with source, package, lockfile, and candidate file
hashes bound to the native capsule/receiver. The tested source was
c6923b4c99a971ef73a943fdc973a2c42a5deb9f; all seven P00 files, package.json,and pnpm-lock.yaml remain byte-identical in the main-reconciled head
55079d16e561f991f129c74340548d9b8d1e9352.src/gateway/server.health.test.ts, 4 insrc/gateway/server-methods/health.owner-routing.test.ts, and 39 intest/scripts/bench-gateway-concurrency.test.ts.WebSocket response through
readGatewayMemory. All five byte counters mustbe finite and nonnegative; each sample field must equal the same response's
counter divided by 1048576. There is no second memory sample.
Expected numeric process memory field: externalBytes. The producer wasrestored byte-for-byte before all three green suites ran. That intended-red
proof is retained; it was not repeated for the byte-identical reconciliation.
status handler, WebSocket transport, and production benchmark reader are
real. This is not an operator Gateway workload.
erasability, and production core types passed. The remaining changed checks
were interrupted during core-test types by the local controller's disk
safety guard. No final aggregate success record was emitted.
reconciliation did not alter the seven-file patch. Complete client-side
logs were retained, and exact lease cleanup was confirmed.
The Actions run
records the Testbox lifecycle; application results were captured by the client.
Complete captured stdout SHA256:
b3413319aa17949f34ce34126d9edbad7ad62bd67fefd25031a93e7618021aff;stderr SHA256:
3613de49b1c91e6f23797759c2a344bf8563439c8ec8933e0c0b0e10e0c67b51.Historical Proof and Remaining Gates
The unchanged original six-file candidate previously passed 35 focused tests,
all four tsgo lanes (including all 17 core-test shards), and 13 additional
selected guards with the frozen pnpm 12.3.4 installation. Earlier 16 guard
passes and three targeted type-aware lint passes used a different installation
and are retained only as historical evidence.
The initial changed-check run passed its first 10 steps, then stopped on the
untouched
sdk-untrusted-context-identifier-aliasescompatibility deadline inthe old base. The reconciled run passed main's separate
removal-pendingdisposition before the disk-guard interruption described above. This PR changes
no aliases, deadlines, or exceptions.
The prior exact-head CI failure was in an unrelated SQLite reclamation-memory
test. Its owner fix landed in
PR147028, and the native
main reconciliation includes that fix without adding it to this PR's seven-file
delta.
Landed: squash-merged on September 13, 2026 as
c8d4673c294c6b543533c5f03eb09115a4eb60b0after native review, hosted-evidenceprepare, and merge completed. Required
CI passed for
exact head
55079d16e561f991f129c74340548d9b8d1e9352. The interruptedchanged-check invocation above remains incomplete; it is not relabeled as a
pass. No application tests, checks, builds, or benchmarks ran locally.