Fission-AI/OpenSpec · error

Parent path is not a directory: ${candidate}

Error message

Parent path is not a directory: ${candidate}

What it means

Error "Parent path is not a directory: ${candidate}" thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/github-copilot/cloud-agent.ts:359

  if (isCurrentCopilotCloudFile(relPath, existingContent)) {
    return false;
  }
  if (!isLegacyCopilotCloudFile(relPath, existingContent)) {
    return false;
  }

  await FileSystemUtils.writeFile(fullPath, currentContent);
  return true;
}

async function assertCreatableFilePath(filePath: string): Promise<void> {
  let candidate = path.dirname(filePath);

  while (true) {
    try {
      const stats = await fs.stat(candidate);
      if (!stats.isDirectory()) {
        throw new Error(`Parent path is not a directory: ${candidate}`);
      }
      return;
    } 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 {

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at src/core/github-copilot/cloud-agent.ts:359 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/08b713dfe92fae9f. Report an issue: GitHub.