Repository navigation
fix: source-host inspection exhausts the heap - #130
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 changes before merge. What this changesUse TypeScript’s type-information parsing mode throughout SDK analysis to discard TypeScript documentation trees while preserving JavaScript JSDoc types. Example: Inspect the 59-fixture corpus against OpenClaw source with a 2 GiB Node heap.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses a concrete memory problem with a focused change absent from main; no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherPlugin Inspector builds a bounded TypeScript program from plugin files and explicit host declarations, then extracts SDK identities, classifications, evidence, and coverage for compatibility reports. flowchart TD
A[Plugin files] --> C[SDK type program]
B[Explicit OpenClaw host] --> C
D[Reusable host inputs] --> C
C --> E[SDK provenance analysis]
E --> F[Inventory and compatibility reports]
Technical reviewBest possible solution: Keep the parser change in the existing program owner and qualify its consumer integration without raising heap limits or weakening inventory equivalence. Do we have a high-confidence way to reproduce the issue? The report identifies the host revision, 59-fixture population, Node version, heap ceiling, and preceding failure, but this read-only review did not independently reproduce heap exhaustion. Is this the best way to solve the issue? The change targets unnecessary AST retention through TypeScript’s documented parser mode and preserves JavaScript type information, existing ownership boundaries, and report contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 89a3fedad864. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 4, 2026, 2:57 AM ET / 07:57 UTC. |
What Problem This Solves
Fixes heap exhaustion during SDK usage analysis of large plugins against an OpenClaw source checkout.
User Impact
Source-host inspection completes the reproduced 59-fixture host corpus and the affected cold-process profile within the existing 2 GiB heap limit. Full report equivalence passed. JavaScript JSDoc typing and SDK findings remain intact.
Why This Change Was Made
The SDK type-program owner retained TypeScript documentation trees that inventory analysis does not consume. Use TypeScript's
ParseForTypeInfoconsistently across root, host, declaration, and cached source parsing. This preserves JavaScript JSDoc types and incoming compiler options without changing input coverage, module resolution, findings, timeouts, or heap limits.Production delta: +15/-8 (net +7), implementing one parser contract across the existing paths. Tests: +79 lines. No dependency, package-version, release, or workflow changes.
Related: openclaw/crabpot#705
Evidence
198c6d588ba427e58cfacbc50c19960c6cb05688, based on89a3fedad864844a276ae52b4011b9c65d47fe12.--max-old-space-size=2048: new JavaScript JSDoc inference and TypeScript/declaration inventory parity tests, plus existing host, cache-retention, and call-flow tests.de7e9c3e88cde66d5a68de8bdfc76707f13ba3b8.git diff --checkpassed.platform-probesdescriptor: three real cold samples completed in 264.234, 271.374, and 270.988 seconds, each with exit 0, no signal, no timeout/cancellation, and the unchanged 600-second sample limit. Node 24.22.1 and the 2 GiB heap limit were preserved. The owner completed in 1,251.557 seconds; its group and all three sample groups were verified gone. This is targeted API proof, not the full CLI matrix; ordinary downstream CI remains separate.program.jsrestored to base89a3feda, the new JavaScript JSDoc test failed its expected typed-documentation assertion; the other new test passed. The exact candidate source was restored and verified clean before smoke tests. Both new tests pass at the candidate as part of the 25-test run.--expected-ref 198c6d588ba427e58cfacbc50c19960c6cb05688; the two source-pin/default-smoke tests passed.@openclaw/plugin-inspector@0.4.5, Git head8ec7d359fd78c96e723ce77eb5cffb3fec6703ee; this PR does not claim that the source fix is published.Review Follow-through
The latest ClawSweeper review's before-merge source-pin/smoke item and cold-proof rank-up move are addressed by the completed evidence above. The dependent Crabpot pin was qualified locally before this source PR lands; after squash, PR705 will replace the candidate SHA with the actual merged Inspector SHA, verify identical source trees, and run its required native CI before landing. No npm version, tag, or publication is part of this change.
One earlier combined validation driver exhausted its 2 GiB heap after 152.95 seconds without a completed sample artifact. That driver retained full oracle reports; its exact internal failure stage and causal attribution were not established. The completed fresh-process proof matches the production process boundary, keeps oracle data outside the profile owner, and makes no source or limit changes. It supersedes the missing proof, without attributing that earlier failure to the harness.