Skip to content

[CI] test: bound memory used by the runtime Electron audit - #26049

Merged
nwparker merged 2 commits into
mainfrom
nwparker/fix-runtime-audit-bundle-memory
Oct 7, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/fix-runtime-audit-bundle-memory

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

ELI5

CI can shut down before reporting tests because the Electron dependency audit runs out of memory. Check all the same entry files through one bundle so shared dependencies are emitted once.

What Changed

Each audit entry gets its own exported namespace in a single generated entry. The audit still reads esbuild's dependency metadata and checks the same Electron imports and baseline. A regression measures duplicated output and verifies every entry remains covered, including dependencies marked sideEffects: false.

Also consolidates duplicate imports from the structured-session delivery module. This corrects an unchanged main-base file at 301 lines without raising or suppressing its 300-line limit; the same factory remains responsible for delivery.

Why

The audit previously emitted a complete bundle for every entry although it only needed the dependency graph. During the #21489 review, esbuild reached 12.3 GiB on main and 13.5 GiB on the assembled fixes, exhausting the ARM runner and swap. Module start/end logging identified this audit as the only unfinished test. Sharing the output addresses that duplication instead of increasing runner memory or weakening the audit.

Linked Issue

Discovered while verifying #21489. Independent of its application fixes; merge separately.

Visual Proof

N/A — dependency audit and equivalent delivery-module import consolidation; no rendered behavior changes.

Testing

Review

Every entry is exported under a distinct name so its exports remain reachable. Existing package traversal, native-addon handling, platform path resolution, and baseline comparison are retained. The delivery import consolidation calls the same function and passes the existing host tests. No contributor replacement PR is involved in this separate fix.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused.
  • Explained behavior, mechanism, and why this approach.
  • Visual proof is N/A with reason.
  • Self-reviewed correctness and performance.
  • Cross-platform paths and remote runtime audit coverage considered.
  • Current-head required CI passes before merge.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7a0b1430-6b23-480d-bf8d-6be4c174ad80
📥 Commits

Reviewing files that changed from the base of the PR and between 44688e7 and a4370dd.

📒 Files selected for processing (1)
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

collectElectronImporters now bundles all supplied entry points through a generated TypeScript stdin module. Tests cover both package sideEffects settings and verify results for 40 entry points that share a dependency. The session host now uses a namespace import for conversation delivery; its construction and runtime wiring remain unchanged.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to a4370

The reviewed changes combine audit entries and retain importer checks, while preserving the session host’s delivery factory and type usage. No actionable merge-blocking risk is established by the available evidence.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: reducing memory use in the runtime Electron audit.
Description check ✅ Passed The description covers the change, rationale, testing, review, and visual-proof sections. It names #21489 as discovery context, but does not link an issue for this independent fix; the template requir…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker nwparker left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review: compared the same ARM shard on main and the assembled fixes. Main reached 12.3 GiB in esbuild; the candidate exhausted memory and swap. Module start/end logging left only check-runtime-electron-ratchet.test.mjs unfinished. The output-budget regression fails before the fix (2,674,080 bytes) and verifies all 40 entry importers after it; sideEffects:false packages, an otherwise unwired injected import, and the real-tree baseline remain covered.

One generated entry exports a distinct namespace for every source entry, sharing their dependency output instead of excluding entry points. The duplicate delivery imports are consolidated to satisfy the existing 300-line rule; the same factory remains called. No rule is disabled or raised. All 66 audit/host tests, Node typecheck, and changed-code quality pass locally; the assembled 150-file quality gate also passes.

The fixed ARM shard passes 22,312 tests (182 skips), with 55 samples peaking at 4,130 MiB runner memory and zero swap. Windows passes all 19 audit tests. Proof: https://github.com/stablyai/orca/actions/runs/37562706124. Required CI is green on current head a4370dd0decc. Low-risk merge recommended. Merge independently, preferably before the #21489 application series to stabilize its baseline gates.

@nwparker
nwparker merged commit d3e1494 into main Oct 7, 2026
32 checks passed
@nwparker
nwparker deleted the nwparker/fix-runtime-audit-bundle-memory branch October 7, 2026 03:21
@nwparker nwparker changed the title test: bound memory used by the runtime Electron audit [CI] test: bound memory used by the runtime Electron audit Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant