[PR #1147] [MERGED] fix(browser): report Windows HAR heap exhaustion #2680

Closed
opened 2026-10-17 21:09:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1147
Author: @Bortlesboat
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/har-windows-heap-exhaustion


📝 Commits (1)

  • 566f9f6 fix(browser): report Windows HAR heap exhaustion

📊 Changes

3 files changed (+85 additions, -3 deletions)

View changed files

📝 src/browser/history/CaptureFailures.test.ts (+77 -0)
📝 src/browser/history/CaptureFailures.ts (+6 -2)
📝 tests/acceptance/tools/historicalCaptureResources.test.ts (+2 -1)

📄 Description

Summary

Windows HAR heap exhaustion now reports resource_constraint with guidance to export a smaller capture. Previously, the same failure reported execution_failure and suggested retrying or running rea doctor.

Related: #1128

Problem and expected behavior

A dense HAR can exhaust the decoder's fixed 192 MiB V8 old-generation heap while remaining within the input-size limit. On Windows, the observed child termination is exit code 134 with no signal; the existing heap classification required SIGABRT. Both representations should produce a non-retryable memory error when stderr contains the V8 fatal heap diagnostic.

Change and scope

Keep the decision in the existing historical-capture failure classifier. Require the HAR decoder stage, a process failure, a recognized termination, and the V8 heap diagnostic together. Unrelated crashes retain their existing classification.

Contract and boundary impact

  • Semantic owner and earliest changed stage: historical-capture decoder failure classification.
  • CLI and MCP/tool-catalog contract: both surfaces receive the existing memory-error projection; reported_limits.observed_exit_code is additive diagnostic evidence.
  • Provider, bridge, target-format, or platform compatibility: Windows HAR termination support; existing POSIX SIGABRT support retained.
  • Evidence, artifact, provenance, or reconstruction contract: preserve captured output, exit code, and signal.
  • Process execution, authorization, cleanup, or containment impact: none; existing cancellation, timeout, and cleanup precedence retained.
  • Generated metadata, package, or installation impact: none; the existing reported-limits schema already accepts the added field.

Evidence and regression coverage

  • Tests added or updated: POSIX and Windows heap failures, three unrelated-crash cases, and host-specific expectations in the real CLI/MCP heap-exhaustion acceptance test.

  • Base reproduction: on 70e5c247, the production Windows MCP test failed with execution_failure, exit code 134, no signal, and V8 heap-exhaustion stderr. The updated acceptance test passes through both CLI and MCP and confirms the server can process a subsequent small HAR.

  • User-visible CLI/MCP output: representative fields after the fix:

    code: resource_constraint
    retryable: false
    details.resource: memory
    details.reported_limits.observed_exit_code: 134
    details.reported_limits.observed_signal: null
    remediation.action: Use a smaller capture exported by its producer...
    
  • Local proof gaps: no Linux/macOS execution; the real mitmproxy workflow requires Linux and caller-supplied mitmdump 12.2.3. One POSIX permission-denial test is skipped on Windows. The full deterministic suite was not run locally. Upstream CI has since passed all four test shards and the real Linux capture workflow below.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Windows, Node 24.18.0 / npm 11.16.0:

  • npm run test:local -- src/browser/history/CaptureFailures.test.ts src/browser/history/HarCapture.test.ts src/application/WebNetworkCaptureService.test.ts — 84 passed.
  • npm run test:focused -- tests/acceptance/tools/historicalCaptureResources.test.ts tests/boundary/browser/historicalCaptureDecoder.test.ts tests/boundary/browser/historicalWebCapture.test.ts tests/boundary/mcp/webNetworkCaptureMcp.test.ts — 20 passed, one POSIX-only skip.
  • npm run check — all six tasks passed, including typecheck, lint, format, knip, and metadata checks.
  • git diff --check — passed.
  • node scripts/verify-web-network-captures.mjs — stopped at the documented Linux/mitmdump preflight on Windows.

Upstream CI on 566f9f6:

The Windows runs used the SHA-256-verified native helper from the published rea-agents@6.0.0 package, whose native source is unchanged in this checkout, with the ignored local manifest's package version set to the source version. This does not verify a new native release artifact.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: real Windows HAR decoder, CLI, and stdio MCP; POSIX termination covered by unit regression. Other providers are not exercised by this change.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: existing redaction and server-recovery acceptance assertions pass; no changes to heap limits, process ownership, or cleanup.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Compound Engineering


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1147 **Author:** [@Bortlesboat](https://github.com/Bortlesboat) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/har-windows-heap-exhaustion` --- ### 📝 Commits (1) - [`566f9f6`](https://github.com/morluto/rea/commit/566f9f64d8236cf90a356a2920b0e585f3a3a08f) fix(browser): report Windows HAR heap exhaustion ### 📊 Changes **3 files changed** (+85 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/history/CaptureFailures.test.ts` (+77 -0) 📝 `src/browser/history/CaptureFailures.ts` (+6 -2) 📝 `tests/acceptance/tools/historicalCaptureResources.test.ts` (+2 -1) </details> ### 📄 Description ## Summary Windows HAR heap exhaustion now reports `resource_constraint` with guidance to export a smaller capture. Previously, the same failure reported `execution_failure` and suggested retrying or running `rea doctor`. Related: #1128 ## Problem and expected behavior A dense HAR can exhaust the decoder's fixed 192 MiB V8 old-generation heap while remaining within the input-size limit. On Windows, the observed child termination is exit code 134 with no signal; the existing heap classification required `SIGABRT`. Both representations should produce a non-retryable memory error when stderr contains the V8 fatal heap diagnostic. ## Change and scope Keep the decision in the existing historical-capture failure classifier. Require the HAR decoder stage, a process failure, a recognized termination, and the V8 heap diagnostic together. Unrelated crashes retain their existing classification. ## Contract and boundary impact - Semantic owner and earliest changed stage: historical-capture decoder failure classification. - CLI and MCP/tool-catalog contract: both surfaces receive the existing memory-error projection; `reported_limits.observed_exit_code` is additive diagnostic evidence. - Provider, bridge, target-format, or platform compatibility: Windows HAR termination support; existing POSIX `SIGABRT` support retained. - Evidence, artifact, provenance, or reconstruction contract: preserve captured output, exit code, and signal. - Process execution, authorization, cleanup, or containment impact: none; existing cancellation, timeout, and cleanup precedence retained. - Generated metadata, package, or installation impact: none; the existing reported-limits schema already accepts the added field. ## Evidence and regression coverage - Tests added or updated: POSIX and Windows heap failures, three unrelated-crash cases, and host-specific expectations in the real CLI/MCP heap-exhaustion acceptance test. - Base reproduction: on `70e5c247`, the production Windows MCP test failed with `execution_failure`, exit code 134, no signal, and V8 heap-exhaustion stderr. The updated acceptance test passes through both CLI and MCP and confirms the server can process a subsequent small HAR. - User-visible CLI/MCP output: representative fields after the fix: ```text code: resource_constraint retryable: false details.resource: memory details.reported_limits.observed_exit_code: 134 details.reported_limits.observed_signal: null remediation.action: Use a smaller capture exported by its producer... ``` - Local proof gaps: no Linux/macOS execution; the real mitmproxy workflow requires Linux and caller-supplied mitmdump 12.2.3. One POSIX permission-denial test is skipped on Windows. The full deterministic suite was not run locally. Upstream CI has since passed all four test shards and the real Linux capture workflow below. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Windows, Node 24.18.0 / npm 11.16.0: - `npm run test:local -- src/browser/history/CaptureFailures.test.ts src/browser/history/HarCapture.test.ts src/application/WebNetworkCaptureService.test.ts` — 84 passed. - `npm run test:focused -- tests/acceptance/tools/historicalCaptureResources.test.ts tests/boundary/browser/historicalCaptureDecoder.test.ts tests/boundary/browser/historicalWebCapture.test.ts tests/boundary/mcp/webNetworkCaptureMcp.test.ts` — 20 passed, one POSIX-only skip. - `npm run check` — all six tasks passed, including typecheck, lint, format, knip, and metadata checks. - `git diff --check` — passed. - `node scripts/verify-web-network-captures.mjs` — stopped at the documented Linux/mitmdump preflight on Windows. Upstream CI on `566f9f6`: - [Real historical web network captures](https://github.com/morluto/rea/actions/runs/37867342112) — passed on Ubuntu 24.04 with SHA-256-verified mitmdump 12.2.3, through the public CLI and MCP. - [Real browser verification](https://github.com/morluto/rea/actions/runs/37867342068) — passed. - [Main CI test shards](https://github.com/morluto/rea/actions/runs/37867342135) — all four passed. The Windows runs used the SHA-256-verified native helper from the published `rea-agents@6.0.0` package, whose native source is unchanged in this checkout, with the ignored local manifest's package version set to the source version. This does not verify a new native release artifact. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: real Windows HAR decoder, CLI, and stdio MCP; POSIX termination covered by unit regression. Other providers are not exercised by this change. - Package or release metadata impact: none. - Security, privacy, process, or containment review: existing redaction and server-recovery acceptance assertions pass; no changes to heap limits, process ownership, or cleanup. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- [![Compound Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2680
No description provided.