fix(test): also try findRepoRoot from cwd for A2UI path resolution

This commit is contained in:
Gareth Jones 2026-01-26 22:41:52 -08:00
parent ee51dec46c
commit 0cdaf9803c

View File

@ -51,8 +51,8 @@ async function resolveA2uiRoot(): Promise<string | null> {
if (process.execPath) {
candidates.unshift(path.resolve(path.dirname(process.execPath), "a2ui"));
}
// Find repo root by walking up from `here` (handles vitest/vite transforms).
const repoRoot = await findRepoRoot(here);
// Find repo root by walking up from `here` or cwd (handles vitest/vite transforms).
const repoRoot = (await findRepoRoot(here)) ?? (await findRepoRoot(process.cwd()));
if (repoRoot) {
candidates.push(path.resolve(repoRoot, "src/canvas-host/a2ui"));
candidates.push(path.resolve(repoRoot, "dist/canvas-host/a2ui"));