mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
match_native_functions refused inventories above its fixed 96 MiB representation allowance with "This release has no runtime override", so ordinary 20k-50k function builds could not be matched at all. Add native.matching_representation_bytes (1 byte to 1 GiB, default 96 MiB, next operation) with the REA_NATIVE_MATCHING_REPRESENTATION_BYTES launch seed, copied by rea setup. MCP resolves the accepted operation's override over the launch value on each call; the CLI uses its launch environment. A refusal binds details.limit with the effective value, source and bounds, and its recovery names the setting and the seed. An invalid seed is refused by matching alone, so MCP stays available and a runtime value repairs it. Fixes #6406 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import type { DoctorProviderInspection } from "./Doctor.js";
|
|
import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js";
|
|
|
|
const SELECTED_REGISTRATION_SETTINGS = [
|
|
"REA_ANALYSIS_PROVIDER",
|
|
"REA_ASAR_MAX_HEADER_BYTES",
|
|
"REA_BRIDGE_MAX_REQUEST_BYTES",
|
|
"REA_CAPTURE_DECODER_OLD_GENERATION_MIB",
|
|
"REA_GHIDRA_DECOMPILE_TIMEOUT_SECONDS",
|
|
"REA_GHIDRA_STARTUP_TIMEOUT_MS",
|
|
"REA_HOPPER_STARTUP_TIMEOUT_MS",
|
|
"REA_JEB_MCP_TIMEOUT_MS",
|
|
"REA_MCP_INPUT_SCHEMA_PROFILE",
|
|
"REA_NATIVE_MATCHING_REPRESENTATION_BYTES",
|
|
"REA_REGEX_MATCHING_DEADLINE_MS",
|
|
"REA_REGEX_WORKER_HEAP_REQUEST_MIB",
|
|
"REA_MCP_INITIALIZE_BUDGET_MS",
|
|
"REA_MCP_TOOLS_LIST_BUDGET_MS",
|
|
"REA_MCP_FIRST_CATALOG_BUDGET_MS",
|
|
"REA_MCP_DOCTOR_DEADLINE_MS",
|
|
] as const;
|
|
|
|
/** Preserve selected setup settings without copying unrelated process values. */
|
|
export const explicitSetupRegistrationEnvironment = (
|
|
environment: Readonly<Record<string, string | undefined>>,
|
|
): Readonly<Record<string, string>> =>
|
|
Object.fromEntries(
|
|
SELECTED_REGISTRATION_SETTINGS.flatMap((key) => {
|
|
const value = environment[key];
|
|
return value === undefined ? [] : [[key, value]];
|
|
}),
|
|
);
|
|
|
|
/** Preserve adapter-published settings independently of runtime readiness. */
|
|
export const providerRegistrationEnvironment = (
|
|
inspections: readonly DoctorProviderInspection[],
|
|
): Readonly<Record<string, string>> =>
|
|
Object.fromEntries(
|
|
inspections
|
|
.flatMap(({ registrationEnvironment }) =>
|
|
Object.entries(registrationEnvironment),
|
|
)
|
|
.sort(([left], [right]) => compareUnicodeCodePoints(left, right)),
|
|
);
|