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:
Elliot Liu
2026-03-15 21:45:56 +01:00
committed by GitHub
parent 268e60b601
commit c05e8a47a3
+2 -2
View File
@@ -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);