stablyai/orca · error · Error
Repo path must be an absolute path
Error message
Repo path must be an absolute path
What it means
Thrown by validateNestedRepoScanRoot when a nested-repo scan is requested with a non-absolute path on the local host. The guard is skipped entirely when a connectionId (remote/SSH host) is supplied, because absolute-vs-relative is only meaningful for local filesystem scans. The check uses node's isAbsolute and rejects any path that is not rooted.
Source
Thrown at src/main/ipc/repos.ts:1022
scanId: z.string().min(1).optional(),
mode: z.literal('separate')
})
])
function parseProjectGroupIpcArgs<T>(schema: z.ZodType<T>, value: unknown, errorCode: string): T {
const result = schema.safeParse(value)
if (result.success) {
return result.data
}
throw new Error(errorCode)
}
function validateNestedRepoScanRoot(path: string, connectionId?: string): void {
if (connectionId) {
return
}
if (!isAbsolute(path)) {
throw new Error('Repo path must be an absolute path')
}
}
function rememberCompletedNestedRepoScan(
scanId: string | undefined,
context: { parentPath: string; connectionId?: string },
scan: NestedRepoScanResult
): void {
if (!scanId) {
return
}
completedNestedRepoScans.set(scanId, {
scan,
parentPath: scan.selectedPath,
connectionId: context.connectionId ?? null
})
while (completedNestedRepoScans.size > MAX_COMPLETED_NESTED_SCAN_RESULTS) {
const oldestScanId = completedNestedRepoScans.keys().next().valueView on GitHub (pinned to 1136503c6a)
Solutions
- Resolve the path against an absolute base with path.resolve() (or path.join(root, relative)) before invoking the nested scan IPC.
- If the input may contain '~', expand it via os.homedir() before resolving.
- Ensure folder-workspace base directories are stored and forwarded in absolute form from the point they are first computed.
- Add a renderer-side precondition that rejects relative paths with a user-facing message before the IPC round-trip.
Example fix
// before
startNestedRepoScan({ parentPath: relativePath })
// after
import { path } from '@tauri-apps/api' // or node path in preload bridge
const absolute = path.isAbsolute(relativePath)
? relativePath
: path.resolve(workspaceRoot, relativePath)
startNestedRepoScan({ parentPath: absolute }) Defensive patterns
Strategy: validation
Validate before calling
import { isAbsolute, resolve } from 'path'
function ensureAbsoluteScanRoot(path: string, workspaceRoot: string): string {
if (isAbsolute(path)) return path
const resolved = resolve(workspaceRoot, path)
if (!isAbsolute(resolved)) {
throw new Error('Nested scan root could not be resolved to an absolute path')
}
return resolved
}
// before IPC:
const parentPath = ensureAbsoluteScanRoot(rawPath, workspaceRoot)
startNestedRepoScan({ parentPath /*, connectionId omitted for local */ }) Type guard
function isAbsolutePathLocal(p: unknown): p is string {
return typeof p === 'string' && p.length > 0 && (p.startsWith('/') || /^[A-Za-z]:[\\/]/.test(p))
} Try / catch
try {
await startNestedRepoScan({ parentPath })
} catch (e) {
if (/absolute path/i.test((e as Error).message)) {
showError('Select a folder inside the workspace root.')
} else throw e
} Prevention
- Store all workspace/folder base paths in absolute form from creation.
- Resolve any user or paste input through path.resolve against a known root before scanning.
- Skip this guard only when connectionId is set (remote host), matching the source's short-circuit.
When it happens
Trigger: Calling the nested-repo-scan IPC with a relative or empty path while no connectionId is set. This happens when a renderer passes a workspace-relative path (e.g. "./subdir" or "repos/foo") instead of a fully resolved local path, or when a folder-workspace path was never resolved against the workspace root before the scan was triggered.
Common situations: A folder workspace (non-git) whose base path was not resolved to absolute before the scan; a renderer bug that forwards a tilde path like "~/code" unexpanded; passing a worktree-relative path for a local nested scan. Not seen for SSH/remote scans since connectionId short-circuits the check.
Related errors
- Selected file is not a markdown document.
- Cannot download to a directory
- Cannot download a directory
- content is required
- Unsupported host: ${args.hostId}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/47ee9aa9cf8df4c6.
Report an issue: GitHub.