feat(captures): make the HAR/SAZ/qlog decoder heap configurable (#6299)

* feat(captures): make the HAR/SAZ/qlog decoder heap configurable

REA_CAPTURE_DECODER_OLD_GENERATION_MIB keeps the 192 MiB default and
refuses values outside 8 to 16384 MiB instead of falling back.

Co-authored-by: morluto <[email protected]>

* fix(captures): defer decoder startup and share one parsed heap

Invalid REA_CAPTURE_DECODER_OLD_GENERATION_MIB threw while CLI commands
were registered, so doctor and help never ran. Build the capture service
only when inspect-web-network-capture runs.

Resolve the heap once in composition and pass that fact to each Node
adapter. Limitation and memory-failure reports use the selected adapter's
heap, so a decoder built with a different environment does not describe
another limit.

Mock captureDecoderProcessMemoryLimitBytes in the Node adapter test so a
Windows Bun host still exercises the unavailable-bound refusal.

Co-authored-by: morluto <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-10-22 23:52:21 +08:00
1 parent 5375ff0f9a
commit 306ed79932
21 files changed
+634 -56

No files matched your search

+1 -1
View File
@@ -23,7 +23,6 @@ export const registerWebNetworkCaptureCommands = (
logger: Logger,
environment: Readonly<NodeJS.ProcessEnv>,
): void => {
const service = createWebNetworkCaptureService(environment);
cli.command(CLI_COMMANDS.inspectWebNetworkCapture, {
description:
"Inspect retained HAR, native mitmproxy, Fiddler SAZ or aioquic qlog records without fetching recorded URLs",
@@ -65,6 +64,7 @@ export const registerWebNetworkCaptureCommands = (
logger,
CLI_COMMANDS.inspectWebNetworkCapture,
async () => {
const service = createWebNetworkCaptureService(environment);
return deliverCliAnalysisEvidence({
run: () =>
service.inspect(