test(perf): cache redact hints and tune guardrail scan concurrency
This commit is contained in:
@@ -10,6 +10,7 @@ import type { ConfigFileSnapshot } from "./types.openclaw.js";
|
||||
import { OpenClawSchema } from "./zod-schema.js";
|
||||
|
||||
const { mapSensitivePaths } = __test__;
|
||||
const mainSchemaHints = mapSensitivePaths(OpenClawSchema, "", {});
|
||||
|
||||
type TestSnapshot<TConfig extends Record<string, unknown>> = ConfigFileSnapshot & {
|
||||
parsed: TConfig;
|
||||
@@ -757,7 +758,7 @@ describe("redactConfigSnapshot", () => {
|
||||
});
|
||||
|
||||
it("contract-covers dynamic catchall/record paths for redact+restore", () => {
|
||||
const hints = mapSensitivePaths(OpenClawSchema, "", {});
|
||||
const hints = mainSchemaHints;
|
||||
const snapshot = makeSnapshot({
|
||||
env: {
|
||||
GROQ_API_KEY: "gsk-contract-123",
|
||||
@@ -1035,7 +1036,7 @@ describe("realredactConfigSnapshot_real", () => {
|
||||
unrepresentable: "any",
|
||||
});
|
||||
schema.title = "OpenClawConfig";
|
||||
const hints = mapSensitivePaths(OpenClawSchema, "", {});
|
||||
const hints = mainSchemaHints;
|
||||
|
||||
const snapshot = makeSnapshot({
|
||||
agents: {
|
||||
|
||||
@@ -22,7 +22,7 @@ const DEFAULT_GUARDRAIL_SKIP_PATTERNS = [
|
||||
];
|
||||
|
||||
const runtimeSourceGuardrailCache = new Map<string, Promise<RuntimeSourceGuardrailFile[]>>();
|
||||
const FILE_READ_CONCURRENCY = 32;
|
||||
const FILE_READ_CONCURRENCY = 16;
|
||||
|
||||
export function shouldSkipGuardrailRuntimeSource(relativePath: string): boolean {
|
||||
return DEFAULT_GUARDRAIL_SKIP_PATTERNS.some((pattern) => pattern.test(relativePath));
|
||||
|
||||
Reference in New Issue
Block a user