mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 21:46:53 +00:00
This commit is contained in:
@@ -59,6 +59,15 @@ function listExtensionFiles(): {
|
||||
};
|
||||
}
|
||||
|
||||
function listHighRiskRuntimeCfgFiles(): string[] {
|
||||
return [
|
||||
"src/agents/tools/telegram-actions.ts",
|
||||
"src/discord/monitor/reply-delivery.ts",
|
||||
"src/discord/monitor/thread-bindings.discord-api.ts",
|
||||
"src/discord/monitor/thread-bindings.manager.ts",
|
||||
];
|
||||
}
|
||||
|
||||
function extractOutboundBlock(source: string, file: string): string {
|
||||
const outboundKeyIndex = source.indexOf("outbound:");
|
||||
expect(outboundKeyIndex, `${file} should define outbound:`).toBeGreaterThanOrEqual(0);
|
||||
@@ -176,4 +185,12 @@ describe("outbound cfg-threading guard", () => {
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps high-risk runtime delivery paths free of loadConfig calls", () => {
|
||||
const runtimeFiles = listHighRiskRuntimeCfgFiles();
|
||||
for (const file of runtimeFiles) {
|
||||
const source = readRepoFile(file);
|
||||
expect(source, `${file} must not call loadConfig`).not.toMatch(loadConfigPattern);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user