mirror of
https://github.com/TianyiDataScience/openclaw-control-center.git
synced 2026-08-14 00:47:58 +00:00
fix: show shared workspace files under all agents, not just the first (#35)
When two agents point to the same workspace directory, the Memory and Workspace workbenches deduplicated files by absolute path alone. This caused the second agent to show 'no matching files' because the first agent already claimed the shared paths. Fix: include facetKey (agent identifier) in the dedup key so the same physical file appears under each agent that owns it. Before: `seen.has(resolve(sourcePath))` After: `seen.has(facetKey + '::' + resolve(sourcePath))` Applied to both listEditableMemoryFiles() and listEditableWorkspaceFiles(). Closes #2
This commit is contained in:
+2
-2
@@ -9556,7 +9556,7 @@ async function listEditableMemoryFiles(): Promise<EditableFileEntry[]> {
|
||||
|
||||
const append = async (entry: EditableFileEntry | undefined): Promise<void> => {
|
||||
if (!entry) return;
|
||||
const key = resolve(entry.sourcePath);
|
||||
const key = `${entry.facetKey ?? ""}::${resolve(entry.sourcePath)}`;
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
output.push(entry);
|
||||
@@ -9653,7 +9653,7 @@ async function listEditableWorkspaceFiles(): Promise<EditableFileEntry[]> {
|
||||
|
||||
const append = async (entry: EditableFileEntry | undefined): Promise<void> => {
|
||||
if (!entry) return;
|
||||
const key = resolve(entry.sourcePath);
|
||||
const key = `${entry.facetKey ?? ""}::${resolve(entry.sourcePath)}`;
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
output.push(entry);
|
||||
|
||||
Reference in New Issue
Block a user