[GH-ISSUE #3538] [Bug] Parent-budget exhaustion after a static checkpoint advises "retry with sufficient memory" #1312

Closed
opened 2026-10-16 21:04:06 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Rinkia on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/3538

Before submitting

  • I searched the open and closed issues for a related report. Related: #1911 / #1915 (parent budget reservation and remediation; this path appears to have been missed).
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

A whole-application analyze_javascript_application run stopped with:

code: resource_constraint, resource: memory
message: The parent's result capacity was exhausted after retaining static facts for app.asar/node_modules/onnxruntime-web/dist/ort.all.mjs; remaining sources were not analyzed
remediation: Review the reported worker memory limits and available host memory. Retry with sufficient memory or a smaller artifact; REA retains tighter inherited limits.
reported_limits: { worker_old_space_mb: 1024, worker_heap_limit_bytes: 1098907648, worker_timeout_ms: 300000,
                   parent_result_budget_bytes: 961153232, parent_result_budget_exhausted: true }

The remediation tells the user to raise memory. Every other parent-budget path says the opposite:

This limit belongs to the parent result budget; increasing the worker heap alone does not increase it.

Cause (source-derived, main @ eb44921c4)

  • src/javascript/analysis/JavaScriptAnalysisWorker.ts:244-253: after a static checkpoint, when #parentCapacityExhausted, it throws AnalysisResourceConstraintError(OPERATION, "memory", …, { …, parent_result_budget_exhausted: true }) without a remediationAction.
  • src/domain/analysisErrorPresentation.ts:49-60: with no remediationAction, a memory resource falls back to "Retry with sufficient memory or a smaller artifact".
  • The sibling parent-budget paths in the same file set specific remediations: line 334 ("Use the retained static facts or analyze fewer source files. This limit belongs to the parent result budget; …"), line 374 (static and module facts variant), and line 620 (expanded relationships variant).

Reproduction

Public target: Joplin desktop 3.7.21 (Joplin-3.7.21.deb from the GitHub release, sha256 14de2d5524e45341de5f0b68a1e78191b796a6c9817949c49b80afe5cd6ab965, matching the release digest). Unpack with dpkg-deb -x, then:

rea analyze-javascript-application /path/opt/Joplin/resources --json

Exit 1 after about 243 s, at source 3,880 of 5,427 (app.asar/node_modules/onnxruntime-web/dist/ort.all.mjs), with the error above. Container: 6 GB, rea-agents@6.5.0.

Two related observations, for context (not the main point):

  • The error output is 244 MB, because it carries the partial observation (graph about 105 MB, semantic_graph about 138 MB). Over MCP that can't be delivered as-is.
  • The partial observation is useful (4 windows, 66 IPC operations, 11 main handlers, 2 native add-on bindings), and the documented --source-path workflow succeeds (scoped to the app's entry, preload and bridge files: exit 0, 143 s). The remediation could point there.

Expected behavior

  • This path uses the same parent-budget remediation as its siblings (retained static facts are available; analyze fewer sources, e.g. --source-path; the worker heap doesn't raise this limit).
  • Optionally, a test asserting that every parent_result_budget_exhausted: true error carries a parent-budget remediation, so new paths can't regress to the generic memory advice.

Impact and scope

  • Large Electron and JS apps (here 233 MB app.asar) hit this path. Following the advice (more memory / --max-heap-mb) doesn't help, which wastes long runs (4 minutes each here).
  • Deterministic for this target.

REA version

rea-agents@6.5.0; the source path is unchanged on main @ eb44921c4.

Runtime and platform

Linux x64 Docker container (Ubuntu 24.04) on Windows 11 / Docker Desktop, Node 24.21.0.

Target and artifact context

Public Joplin release listed above.

Interface

CLI (MCP shares the error presentation).

Originally created by @Rinkia on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/3538 ### Before submitting - [x] I searched the open and closed issues for a related report. Related: #1911 / #1915 (parent budget reservation and remediation; this path appears to have been missed). - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior A whole-application `analyze_javascript_application` run stopped with: ```text code: resource_constraint, resource: memory message: The parent's result capacity was exhausted after retaining static facts for app.asar/node_modules/onnxruntime-web/dist/ort.all.mjs; remaining sources were not analyzed remediation: Review the reported worker memory limits and available host memory. Retry with sufficient memory or a smaller artifact; REA retains tighter inherited limits. reported_limits: { worker_old_space_mb: 1024, worker_heap_limit_bytes: 1098907648, worker_timeout_ms: 300000, parent_result_budget_bytes: 961153232, parent_result_budget_exhausted: true } ``` The remediation tells the user to raise memory. Every other parent-budget path says the opposite: > This limit belongs to the parent result budget; increasing the worker heap alone does not increase it. ### Cause (source-derived, `main` @ `eb44921c4`) - `src/javascript/analysis/JavaScriptAnalysisWorker.ts:244-253`: after a static checkpoint, when `#parentCapacityExhausted`, it throws `AnalysisResourceConstraintError(OPERATION, "memory", …, { …, parent_result_budget_exhausted: true })` **without** a `remediationAction`. - `src/domain/analysisErrorPresentation.ts:49-60`: with no `remediationAction`, a `memory` resource falls back to "Retry with sufficient memory or a smaller artifact". - The sibling parent-budget paths in the same file set specific remediations: line 334 ("Use the retained static facts or analyze fewer source files. This limit belongs to the parent result budget; …"), line 374 (static and module facts variant), and line 620 (expanded relationships variant). ### Reproduction Public target: Joplin desktop 3.7.21 (`Joplin-3.7.21.deb` from the GitHub release, sha256 `14de2d5524e45341de5f0b68a1e78191b796a6c9817949c49b80afe5cd6ab965`, matching the release digest). Unpack with `dpkg-deb -x`, then: ```bash rea analyze-javascript-application /path/opt/Joplin/resources --json ``` Exit 1 after about 243 s, at source 3,880 of 5,427 (`app.asar/node_modules/onnxruntime-web/dist/ort.all.mjs`), with the error above. Container: 6 GB, `rea-agents@6.5.0`. Two related observations, for context (not the main point): - The error output is 244 MB, because it carries the partial observation (graph about 105 MB, semantic_graph about 138 MB). Over MCP that can't be delivered as-is. - The partial observation is useful (4 windows, 66 IPC operations, 11 main handlers, 2 native add-on bindings), and the documented `--source-path` workflow succeeds (scoped to the app's entry, preload and bridge files: exit 0, 143 s). The remediation could point there. ### Expected behavior - This path uses the same parent-budget remediation as its siblings (retained static facts are available; analyze fewer sources, e.g. `--source-path`; the worker heap doesn't raise this limit). - Optionally, a test asserting that every `parent_result_budget_exhausted: true` error carries a parent-budget remediation, so new paths can't regress to the generic memory advice. ### Impact and scope - Large Electron and JS apps (here 233 MB `app.asar`) hit this path. Following the advice (more memory / `--max-heap-mb`) doesn't help, which wastes long runs (4 minutes each here). - Deterministic for this target. ### REA version `rea-agents@6.5.0`; the source path is unchanged on `main` @ `eb44921c4`. ### Runtime and platform Linux x64 Docker container (Ubuntu 24.04) on Windows 11 / Docker Desktop, Node 24.21.0. ### Target and artifact context Public Joplin release listed above. ### Interface CLI (MCP shares the error presentation).
Author
Owner

@morluto commented on GitHub (Oct 23, 2026):

Resolved by github.com/morluto/rea@3f9357b599. The static-checkpoint parent-capacity branch uses parent-owned recovery. A tiny real-worker checkpoint exhausts only parent result capacity and asserts retained complete static facts plus explicit advice that worker heap does not increase the parent budget. Validation: tests/boundary/javascript/javascriptParentResultAdmission.test.ts passed in the recorded round2/3 execution; this review did not rerun tests. Coverage is limited to the cited control; no broader real-provider, Windows or performance claim.

<!-- gh-comment-id:6376121071 --> @morluto commented on GitHub (Oct 23, 2026): Resolved by https://github.com/morluto/rea/commit/3f9357b5990d166a38440f56f439452266650093. The static-checkpoint parent-capacity branch uses parent-owned recovery. A tiny real-worker checkpoint exhausts only parent result capacity and asserts retained complete static facts plus explicit advice that worker heap does not increase the parent budget. Validation: `tests/boundary/javascript/javascriptParentResultAdmission.test.ts` passed in the recorded round2/3 execution; this review did not rerun tests. Coverage is limited to the cited control; no broader real-provider, Windows or performance claim.
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#1312
No description provided.