Repository navigation
fix(process): report the effective regex heap and uncertain signal retry - #6099
Conversation
Node gives --max-old-space-size, including NODE_OPTIONS, precedence over the worker's 128 MiB resourceLimits request. Name that effective old-generation heap and stop saying the request has no runtime override. The matching deadline stays a fixed cap. Co-authored-by: morluto <morluto@users.noreply.github.com>
The signal does not prove the retained rlimit was exhausted, so an unchanged retry may succeed. Project that retry as possible instead of saying it fails the same way. Co-authored-by: morluto <morluto@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issue was established. SummaryThe PR corrects regex heap reporting and makes signal retry advice reflect an uncertain cause. Since the previous review:
Both numbered previous findings are fixed. No new actionable issue or security issue was established. Supersession could not be checked because GitHub authentication was unavailable. Reviews (8) · Last reviewed commit: "fix(process): leave a title-overwritten ..." · Reviewed by Greptile |
--max-old-space-size-percentage takes precedence over the absolute flag in either order. Node computes that MiB from startup memory, which a later read does not recover, so the effective heap stays unknown instead of the 128 MiB request or an absolute flag. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e4b70ecf7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A preload can rewrite process.env.NODE_OPTIONS after V8 has applied the original flags, and those flags are not copied into execArgv. Use the initial environment block when it can be read, and leave the effective heap unestablished when that provenance cannot be recovered. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d615858a4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
--env-file and --env-file-if-exists can supply NODE_OPTIONS when that variable was absent from the initial environment. The file is not in /proc/self/environ, so a missing entry is not the 128 MiB request. An initial NODE_OPTIONS is still parsed, because Node does not let the file replace it. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc0c9daaa3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A positive --max-heap-size or --max_heap_size sets the total heap, not the old generation, and can stay below the 128 MiB worker request when an old-space flag is also present. The effective old generation stays unestablished while that value is in effect. Zero or empty clears it. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8e194acb6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
--experimental-config-file and --experimental-default-config-file can apply a heap percentage from a file that is not launch provenance. The effective old generation stays unestablished when either flag is present, including beside an absolute --max-old-space-size. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93db004ba3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
process.execArgv can be cleared after V8 applies --max-old-space-size. Linux recovers those tokens from /proc/self/cmdline and leaves the heap unestablished when that vector cannot be separated from the program entry. Heap probes compare pinned absolute limits instead of a percentage of host memory. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2dcae68fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
process.title and --title replace /proc/self/cmdline with the title. A buffer without a program entry is not an empty option list, so the heap stays unknown instead of the 128 MiB request. The command-line probe does not read /proc off Linux. Co-authored-by: morluto <morluto@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
* fix(mcp)!: return a compact binary_session status by default
binary_session {} with no target open returned about 66 KB, most of it
provider rejection diagnostics and candidate capability sets that the
skill's recovery flow re-reads on every retry. 6.8.0 grew it by 21%
because the shared regex capability limitation began repeating setting
bounds and step-by-step recovery for every search operation of every
provider (#6099, #6267, #6301, #7049) and IDA gained that limitation for
its two search operations (#4862).
The regex limitation now states the effective deadline and heap, their
sources and where to change them; the deadline and heap errors keep the
full recovery. binary_session gains detail: summary (default) or
complete. The summary keeps open state, target identity, the binding,
route capabilities, run, activity and health status, each candidate's
availability and target-support status, code and reason, and every
tool's availability, reason, remediation and modes, and lists the
fields it leaves out in omitted_fields. Complete detail returns the
previous shape. The CLI capabilities and providers commands keep
complete provider facts through the same application projection.
BREAKING CHANGE: binary_session {} no longer returns
analysis_provider_candidates[].availability.diagnostics,
target_support.diagnostics or capabilities, or tool_availability group
surface, effects and annotations. Pass {"detail": "complete"} to get
them.
Fixes #7109
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(mcp): key binary_session output fields by detail
The output schema accepted detail: "complete" with summary candidates or
tool groups, and a summary without omitted_fields, so detail did not
tell callers which fields existed. Each session kind is now crossed
with a detail-specific shape: a summary requires omitted_fields and
summary-only candidates and tool groups; complete requires diagnostics,
candidate capabilities and static tool flags and forbids omitted_fields.
Both the canonical schema and the SDK-validated advertised schema reject
mismatched shapes.
The verifier helper accepts summary candidates only for a validated MCP
summary; CLI provider output still requires candidate capabilities.
Regex limitation tests check values, sources and setting names instead
of whole sentences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Follow-up to #6071 for post-merge Codex P2 findings, plus the Greptile percentage-heap finding, the Codex launch-
NODE_OPTIONSfinding, the env-file heap finding, the--max-heap-sizefinding, the Node config-file finding, the mutable-execArgvfinding, and the command-line title finding. Part of #5910 (parent #5808).The regex worker reports the effective old-generation heap instead of an unchangeable 128 MiB cap. A launch
--max-old-space-size-percentagetakes precedence over that absolute flag and leaves the effective heap unestablished. The launchNODE_OPTIONSvalue is read from the process initial environment, not from a laterprocess.envedit. The launch Node options are read from the initial command line when that buffer still has a program entry, not from a laterprocess.execArgvedit.process.titleand--titleoverwrite that command line, so a buffer without a program entry leaves the heap unestablished.--env-fileand--env-file-if-existsleave the heap unestablished when that variable was absent, because the file can supply it. A positive--max-heap-sizeleaves the old generation unestablished, because that flag sets the total heap and can be lower than the 128 MiB request.--experimental-config-fileand--experimental-default-config-fileleave the heap unestablished, because the config file can supply a heap percentage and is not read back. SIGXCPU and SIGXFSZ no longer say an unchanged retry fails the same way when the signal's cause is not established.Problem and expected behavior
REGEX_MATCHING_LIMITATIONand the heap error said the worker heap was a fixed 128 MiB cap and that this release has no runtime override. Node gives--max-old-space-size, including a value supplied only throughNODE_OPTIONS, precedence overresourceLimits.maxOldGenerationSizeMb(Worker API). The worker can exceed 128 MiB and may not raiseERR_WORKER_OUT_OF_MEMORYat that budget.NODE_OPTIONSis not copied intoprocess.execArgv.--max-old-space-size-percentagealso overrides the 128 MiB request and takes precedence over--max-old-space-sizein either order (CLI). Node computes that MiB from constrained or total memory while parsing options. On this host, cgroupmemory.highmoved between reads, and some Node versions also cap total memory at 4 GiB when pointer compression is on. A later read is not the value Node applied. Reporting 128 or the absolute flag is the wrong heap.process.env.NODE_OPTIONSis mutable. A preload started from that variable can clear or rewrite it after V8 has already applied the original flags. Reading the rewritten string reports 128 MiB, or some other false effective limit, whileprocess.execArgvstill does not contain the original flag.process.execArgvis mutable too. On Node 24.15.0,node --max-old-space-size=64 --require=preload.cjsstill applied the 64 MiB heap after the preload setprocess.execArgv.length = 0. Deriving the heap from the emptied array reports the 128 MiB request.process.titleand--titleoverwrite the argv memory behind/proc/self/cmdline. On Node v22.23.3,node --max-old-space-size=64with a preload that setsprocess.title = "rea", andnode --title=rea --max-old-space-size=64, both left that file asreafollowed by NULs while the worker heap stayed at 64 MiB. Treating that buffer as an empty option list advertised the 128 MiB request. Node documents that setting the title overwrites argv memory.--env-fileand--env-file-if-existsset environment variables from a file at startup. WhenNODE_OPTIONSis absent from the initial environment,NODE_OPTIONS=--max-old-space-size=256in that file raises the worker heap, but/proc/self/environhas noNODE_OPTIONSentry andprocess.execArgvrecords only the file flag. Classifying the missing entry as recovered advertises 128 MiB. The file is not an immutable launch source: it can change after startup, and--env-file-if-existsmay have been missing. A percentage in the file also beats a later absolute flag. Node does not let the file replace aNODE_OPTIONSvalue that was already in the initial environment.--max-heap-sizesets the total heap, not the old generation. On Node v22.23.3,node --max-heap-size=64with a workermaxOldGenerationSizeMbof 128 kept that resource limit at 128 and reportedheap_size_limitof exactly 64 MiB. The underscore form did the same. A later--max-old-space-sizedid not restore a pure old-generation size. Treating the flag as absent advertised an effective 128 MiB old generation. Node 22.23.3 rejects the flag insideNODE_OPTIONS; Node 24 and later allow it there. A zero or empty value cleared the total-heap cap and left the old-space result. A split value and a non-integer aborted the process.--experimental-config-fileand--experimental-default-config-fileload a Node config whosenodeOptionscan includemax-old-space-size-percentage. On Node v22.23.3, a config of{"nodeOptions":{"max-old-space-size-percentage":"1"}}keptresourceLimits.maxOldGenerationSizeMbat 128 and lowered the workerheap_size_limiton this host.process.execArgvcontained only the config-file flag. The same lowered heap remained when--max-old-space-size=256followed the flag. Node accepts the path as=or the next argument.--experimental-default-config-filereadsnode.config.jsonfrom the working directory. The file is not an immutable launch source. A 1% heap is not a stable comparison: on a large host without Node's 4 GiB cap it can exceed the 128 MiB request.The SIGXCPU/SIGXFSZ remediation said
Repeating the unchanged request fails the same wayin the same branch that says the signal's exact cause is not independently established. A producer can self-raise or externally receive either signal without exhausting the reported rlimit, so an unchanged retry may succeed.The matching deadline remains a fixed cap with no runtime override. The inherited producer ceiling still has no REA setting that raises it.
Change and scope
Wording and error projection.
resolveRegexWorkerHeapderives the effective old-generation heap from a recovered launchNODE_OPTIONSstring, then recovered launch Node options. It does not readprocess.envorprocess.execArgv. A positive--max-old-space-sizeor--max_old_space_sizeis that heap. A zero or empty value leaves the 128 MiB request in effect. An unparsed absolute flag leaves the effective heap unestablished instead of claiming 128.Any
--max-old-space-size-percentagetoken, including the underscore form and a value passed as the next argument, leaves the effective heap unestablished. It wins over an absolute flag in either source and either order, including a later zero or a value Node rejects. The rawNODE_OPTIONSstring is not retained. OOM details reportworker_heap_mibonly for an established heap andrequested_worker_heap_mibas 128.On Linux, the launch string is the
NODE_OPTIONSentry in/proc/self/environ, theexecveenvironment block. A laterprocess.envassignment does not change that block. The rest of the block is not retained. When that block cannot be read, or the platform has no equivalent immutable block, the effective heap stays unestablished. A missing reading is not treated as an absentNODE_OPTIONS.On Linux, the launch Node options are recovered from
/proc/self/cmdlineonly when that buffer still has a program entry: a script path, stdin-, an eval or print argument, or the token after--. The parser skips the executable and omits arguments after the entry. A title overwrite is one token plus NUL padding and has no program entry, so it is unrecoverable rather than an empty option list. An unrecognized option immediately before the entry, invalid UTF-8, or a failed read is also unrecoverable. Other platforms have no equivalent block. Unrecoverable provenance stays unknown.process.execArgvis not a fallback.When
NODE_OPTIONSis absent and the recovered command line contains--env-fileor--env-file-if-exists, including a path in the next argument, the effective heap stays unestablished. An initialNODE_OPTIONS, including an empty one, is still parsed together with the command line, because the file does not replace it.A positive
--max-heap-sizeor--max_heap_size, on the CLI or in the recoveredNODE_OPTIONSstring, leaves the old generation unestablished. An old-space flag does not restore a claimed MiB while that total-heap value is in effect. A final zero or empty value clears it and the old-space result stands. An unparsed value stays unestablished, including when a later zero or old-space flag follows it.When the recovered command line or the recovered
NODE_OPTIONSstring contains--experimental-config-fileor--experimental-default-config-file, including a path in=or the next argument, the effective heap stays unestablished. That is true when an absolute--max-old-space-sizeis also present and whenNODE_OPTIONSwas recovered. The config file is not read.SIGXCPU/SIGXFSZ remediation says an unchanged retry may succeed or may fail the same way. The projected
retryableflag is true so it does not contradict that sentence.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Not applicable. This stays inside existing process error text. No new provider, target execution, injection, mutation, or protection recovery.
Contract and boundary impact
RegexMatcher; producer signal recovery is owned byArtifactAnalysisResources.commandFailure.maxOldGenerationSizeMb: 128. Linux can recover launchNODE_OPTIONSfrom the initial environment block and launch Node options from the initial command line when a program entry is still present. Other platforms leave that heap unestablished.NODE_OPTIONS, a positive--max-heap-size, a Node config-file flag, a title-overwritten command line, and an unrecoverable command line are reported as unestablished rather than a reconstructed MiB. The currentprocess.env.NODE_OPTIONSstring and the currentprocess.execArgvarray are not launch provenance. An env file and a Node config file are not reread.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): docs updated indocs/kuna-provider.mdanddocs/native-investigation.md. No package or catalog source change.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
The SIGXCPU/SIGXFSZ projection now reports
retryable: true. That matches "an unchanged retry may succeed." It does not change target interaction. Reading/proc/self/environretains only theNODE_OPTIONSentry long enough to parse heap flags. Reading/proc/self/cmdlineretains only the recovered Node option tokens, and only when a program entry is present.Evidence and regression coverage
src/process/RegexMatcher.test.ts,tests/boundary/process/regexMatcher.test.ts,src/process/ArtifactAnalysisResources.test.ts.resourceLimits.maxOldGenerationSizeMb: 128kept reporting that resource limit whilev8.getHeapStatistics().heap_size_limitfollowed--max-old-space-size. Comparisons use pinned 64 MiB and 256 MiB heaps rather than an unconstrained baseline.node --max-old-space-size=64 --require=preload.cjswith the preload settingprocess.execArgv.length = 0reported an emptyprocess.execArgvand a worker heap within 5% of a pinned 64 MiB child. The intact/proc/self/cmdlinestill contained the 64 MiB flag, and the resolver reported effective 64 MiB. Passing the emptied array toresolveRegexWorkerHeapwould report the 128 MiB request.process.title = "rea"after--max-old-space-size=64, and--title=rea --max-old-space-size=64, both replaced/proc/self/cmdlinewithreaand NUL padding. The worker heap stayed within 5% of the pinned 64 MiB child andresourceLimits.maxOldGenerationSizeMbstayed 128. The parser returned unrecoverable, and the launch heap was unknown rather than 128 MiB. A synthetic command line ofnodeplusscript.jsand no heap flag still recovers an empty option list. A singlereatoken andreaplus NUL padding do not.readLaunchExecArgvis unrecoverable and the launch heap stays unknown even when a recoveredNODE_OPTIONSstring contains--max-old-space-size=64. The boundary probe that reads/proc/self/cmdlinedoes not spawn on those platforms.--max-heap-size, and config-file evidence from the earlier commits on this branch still applies. Percentage and config-file probes no longer compareheap_size_limitwith a host-memory baseline.NODE_OPTIONS, an unrecoverable command line, a title-overwritten command line, an env-file launch with no initialNODE_OPTIONS, a positive--max-heap-size, or a Node config-file flag says the effective heap was not established.reaplus NUL shape. macOS and Windows have no equivalent command-line block, so those platforms leave the heap unestablished. Anodelaunch with no script, such as a REPL, is unrecoverable because it has no program entry.For evidence-bearing changes:
Validation performed
npx oxfmton the touched files, thennpm run format:check— all matched files use the correct format (4736 files).npm run check:fast— typecheck and lint succeeded (turbo 2.11.7, 2 tasks, 4.195s) after the title-overwrite change.npm run test:focused -- src/process/RegexMatcher.test.ts tests/boundary/process/regexMatcher.test.ts— 2 files passed, 58 tests passed. The env-file probe passed in 321ms. The config-file probe passed in 329ms.npm run test:focused -- src/process/ArtifactAnalysisResources.test.ts tests/boundary/captures/captureProvider.test.ts tests/boundary/signals/recordingProvider.test.tscovered the SIGXCPU/SIGXFSZ wording. Those later edits do not change that path.Compatibility, safety, and release
retryable: true. A clearedprocess.execArgvno longer changes the reported heap. A title-overwritten command line no longer reports 128 MiB. A missing command-line reading no longer reports 128 MiB. A percentage flag, env-file launch with no initialNODE_OPTIONS, positive--max-heap-size, or Node config-file flag no longer reports a MiB that the launch provenance does not establish./proc/self/environ,/proc/self/cmdline, title, env-file,--max-heap-size, and config-file probes only.process.execArgv, a title-overwritten command line, a percentage flag, an env file, a positive--max-heap-size, or a Node config file. The initial environment block is read only to parseNODE_OPTIONS. The command line is read only to recover Node option tokens when a program entry is present. The env file and the Node config file are not read back.Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.