fix(coding-agent): dedupe symlinked resources (#3818)

* fix(coding-agent): dedupe symlinked resources

Fixes #3767

* refactor(coding-agent): extract canonicalizePath util for symlink resolution
This commit is contained in:
Aliou Diallo
2026-04-27 18:33:10 +02:00
committed by GitHub
parent 6a10c17219
commit 10425abb87
8 changed files with 215 additions and 53 deletions

View File

@@ -8,7 +8,7 @@ import type { ResourceDiagnostic } from "./diagnostics.js";
export type { ResourceCollision, ResourceDiagnostic } from "./diagnostics.js";
import { isLocalPath } from "../utils/paths.js";
import { canonicalizePath, isLocalPath } from "../utils/paths.js";
import { createEventBus, type EventBus } from "./event-bus.js";
import { createExtensionRuntime, loadExtensionFromFactory, loadExtensions } from "./extensions/loader.js";
import type { Extension, ExtensionFactory, ExtensionRuntime, LoadExtensionsResult } from "./extensions/types.js";
@@ -664,8 +664,9 @@ export class DefaultResourceLoader implements ResourceLoader {
for (const p of [...primary, ...additional]) {
const resolved = this.resolveResourcePath(p);
if (seen.has(resolved)) continue;
seen.add(resolved);
const canonicalPath = canonicalizePath(resolved);
if (seen.has(canonicalPath)) continue;
seen.add(canonicalPath);
merged.push(resolved);
}