Fission-AI/OpenSpec · error
Managed Copilot path is not a regular file
Error message
Managed Copilot path is not a regular file: ${filePath} What it means
Pre-write/unlink guard in assertMissingOrRegularFile: a path OpenSpec manages for Copilot exists but is not a regular file (e.g. a directory or special file). The operation refuses to proceed to avoid clobbering it.
Solutions
- Inspect the named path and remove the directory/special file if it was created in error
- Move your own content out of the managed path before retrying
- Re-run the Copilot install or uninstall step
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/github-copilot/cloud-agent.ts:380 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/25627220bdfbd61a.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/github-copilot/cloud-agent.ts:380
} catch (error) {
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
throw error;
}
}
const parent = path.dirname(candidate);
if (parent === candidate) {
throw new Error(`Cannot resolve a directory ancestor for: ${filePath}`);
}
candidate = parent;
}
}
async function assertMissingOrRegularFile(filePath: string): Promise<void> {
try {
const stats = await fs.stat(filePath);
if (!stats.isFile()) {
throw new Error(`Managed Copilot path is not a regular file: ${filePath}`);
}
} catch (error) {
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
throw error;
}
}
}
async function classifyCopilotAgentReconciliation(
agentPath: string,
alternateAgentPath: string
): Promise<'reconcile' | 'skip' | 'remove-managed'> {
if (!(await FileSystemUtils.fileExists(alternateAgentPath))) {
return 'reconcile';
}
if (!(await FileSystemUtils.fileExists(agentPath))) {
return 'skip';
}View on GitHub (pinned to 6926ccb18a)