import os from "node:os"; import path from "node:path"; import { resolveRequiredHomeDir } from "../infra/home-dir.js"; import { DEFAULT_AGENT_ID, normalizeAgentId } from "../routing/session-key.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { resolveUserPath } from "../utils.js"; import { resolveStateDir } from "./paths.js"; import type { OpenClawConfig } from "./types.js";
export type DuplicateAgentDir = {
agentDir: string;
agentIds: string[];
};
export class DuplicateAgentDirError extends Error {
readonly duplicates: DuplicateAgentDir[];
for (const entry of agents) { if (entry?.id) {
ids.add(normalizeAgentId(entry.id));
}
}
const bindings = cfg.bindings; if (Array.isArray(bindings)) { for (const binding of bindings) { const id = binding?.agentId; if (typeof id === "string" && id.trim()) {
ids.add(normalizeAgentId(id));
}
}
}
export function formatDuplicateAgentDirError(dups: DuplicateAgentDir[]): string { const lines: string[] = [ "Duplicate agentDir detected (multi-agent config).", "Each agent must have a unique agentDir; sharing it causes auth/session state collisions and token invalidation.", "", "Conflicts:",
...dups.map((d) => `- ${d.agentDir}: ${d.agentIds.map((id) => `"${id}"`).join(", ")}`), "", "Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory).", "If you want to share credentials, copy auth-profiles.json instead of sharing the entire agentDir.",
]; return lines.join("\n");
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-09)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.