mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 09:52:27 +00:00
feat(mcp): support runtime analysis limit recovery (#7049)
* feat(mcp): support runtime analysis limit recovery * refactor(config): remove unused limit re-exports * fix(android): keep fixture release metadata dependency-free * fix(settings): preserve provider budgets and recovery facts * fix(tests): resolve lint plugins from their repository owner * refactor(mcp): verify guidance delivery without frozen wording * fix(android): align availability with runtime timeout * test(recovery): assert limit facts instead of frozen wording * fix(mcp): share runtime settings with the default JADX provider * test(mcp): bound acknowledgements and release held work on failure * fix(catalog): declare runtime settings tools as MCP-only
This commit is contained in:
1 parent
ab720b4216
commit
f3ed1657f8
120 files changed
+2899
-884
No files matched your search
@@ -5,6 +5,7 @@ import { projectJavaScriptModuleSemantics } from "../../domain/javascript/javasc
|
||||
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
||||
import {
|
||||
javaScriptForwardedTransferRemediation,
|
||||
javaScriptTransferByteBudget,
|
||||
javaScriptTransferCeilingRemediation,
|
||||
measureJavaScriptModuleTransfer,
|
||||
} from "./JavaScriptAnalysisTransfer.js";
|
||||
@@ -24,45 +25,35 @@ it("distinguishes the adjustable transfer file ceiling from the fixed record and
|
||||
if (!(caught instanceof AnalysisResourceConstraintError))
|
||||
throw new Error("Expected a transfer ceiling refusal");
|
||||
const projected = projectAnalysisError(caught);
|
||||
expect(projected.message).toContain("no runtime override");
|
||||
expect(projected.message).toContain(
|
||||
String(caught.reportedLimits?.transfer_file_bytes),
|
||||
expect(projected).toMatchObject({
|
||||
code: "resource_constraint",
|
||||
details: {
|
||||
resource: "transport",
|
||||
reported_limits: {
|
||||
transfer_record_bytes: 8388608,
|
||||
transfer_file_bytes: measured.bytes - 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(projected.remediation.action).toBe(
|
||||
javaScriptTransferCeilingRemediation(measured.bytes - 1),
|
||||
);
|
||||
expect(projected.remediation.action).toContain("no runtime override");
|
||||
expect(projected.remediation.action).toContain("max_heap_mb");
|
||||
expect(projected.remediation.action).toContain("8388608");
|
||||
expect(projected.remediation.action).toContain("2147483648");
|
||||
expect(projected.remediation.action).toContain("NODE_OPTIONS");
|
||||
expect(projected.remediation.action).toContain("--max-old-space-size=<MiB>");
|
||||
expect(projected.remediation.action).toContain(
|
||||
"Selecting fewer source_paths can",
|
||||
);
|
||||
expect(projected.remediation.action).not.toContain(
|
||||
"Selecting fewer source_paths does not raise them",
|
||||
);
|
||||
expect(projected.remediation.action).not.toContain("get_evidence_bundle");
|
||||
expect(projected.message).toContain("can rise until the maximum");
|
||||
const forwarded = javaScriptForwardedTransferRemediation(
|
||||
caught.reportedLimits,
|
||||
);
|
||||
expect(forwarded).toContain("NODE_OPTIONS");
|
||||
expect(forwarded).toContain("Selecting fewer source_paths can");
|
||||
expect(forwarded).toBe(projected.remediation.action);
|
||||
const recordOnly = javaScriptForwardedTransferRemediation({
|
||||
transfer_record_bytes: 8_388_608,
|
||||
});
|
||||
expect(recordOnly).toContain("NODE_OPTIONS");
|
||||
expect(recordOnly).toContain("can be lower than the maximum");
|
||||
expect(recordOnly).not.toContain(
|
||||
"The effective transfer file ceiling is the 2147483648-byte maximum",
|
||||
);
|
||||
expect(recordOnly).toBe(javaScriptTransferCeilingRemediation(undefined));
|
||||
expect(javaScriptForwardedTransferRemediation(null)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("keeps the 2 GiB transfer file maximum fixed", () => {
|
||||
const remediation = javaScriptTransferCeilingRemediation(2_147_483_648);
|
||||
expect(remediation).toContain("2147483648");
|
||||
expect(remediation).toContain("no runtime override");
|
||||
expect(remediation).not.toContain("NODE_OPTIONS");
|
||||
expect(remediation).toContain(
|
||||
"Selecting fewer source_paths does not raise the record ceiling",
|
||||
);
|
||||
const maximum = 2_147_483_648;
|
||||
expect(javaScriptTransferByteBudget(maximum * 8)).toBe(maximum);
|
||||
expect(javaScriptTransferByteBudget(maximum * 16)).toBe(maximum);
|
||||
expect(
|
||||
javaScriptForwardedTransferRemediation({ transfer_file_bytes: maximum }),
|
||||
).toBe(javaScriptTransferCeilingRemediation(maximum));
|
||||
});
|
||||
Reference in new issue
Block a user