mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:34:31 +00:00
refactor: unify boundary-safe reads for bootstrap and includes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
filterBootstrapFilesForSession,
|
||||
loadExtraBootstrapFiles,
|
||||
loadExtraBootstrapFilesWithDiagnostics,
|
||||
} from "../../../agents/workspace.js";
|
||||
import { createSubsystemLogger } from "../../../logging/subsystem.js";
|
||||
import { resolveHookConfig } from "../../config.js";
|
||||
@@ -45,7 +45,19 @@ const bootstrapExtraFilesHook: HookHandler = async (event) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const extras = await loadExtraBootstrapFiles(context.workspaceDir, patterns);
|
||||
const { files: extras, diagnostics } = await loadExtraBootstrapFilesWithDiagnostics(
|
||||
context.workspaceDir,
|
||||
patterns,
|
||||
);
|
||||
if (diagnostics.length > 0) {
|
||||
log.debug("skipped extra bootstrap candidates", {
|
||||
skipped: diagnostics.length,
|
||||
reasons: diagnostics.reduce<Record<string, number>>((counts, item) => {
|
||||
counts[item.reason] = (counts[item.reason] ?? 0) + 1;
|
||||
return counts;
|
||||
}, {}),
|
||||
});
|
||||
}
|
||||
if (extras.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user