{"record":{"id":"25627220bdfbd61a","repo":"Fission-AI/OpenSpec","slug":"managed-copilot-path-is-not-a-regular-file-file","errorCode":null,"errorMessage":"Managed Copilot path is not a regular file: ${filePath}","messagePattern":"Managed Copilot path is not a regular file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/github-copilot/cloud-agent.ts","lineNumber":380,"sourceCode":"    } catch (error) {\n      if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n        throw error;\n      }\n    }\n\n    const parent = path.dirname(candidate);\n    if (parent === candidate) {\n      throw new Error(`Cannot resolve a directory ancestor for: ${filePath}`);\n    }\n    candidate = parent;\n  }\n}\n\nasync function assertMissingOrRegularFile(filePath: string): Promise<void> {\n  try {\n    const stats = await fs.stat(filePath);\n    if (!stats.isFile()) {\n      throw new Error(`Managed Copilot path is not a regular file: ${filePath}`);\n    }\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n      throw error;\n    }\n  }\n}\n\nasync function classifyCopilotAgentReconciliation(\n  agentPath: string,\n  alternateAgentPath: string\n): Promise<'reconcile' | 'skip' | 'remove-managed'> {\n  if (!(await FileSystemUtils.fileExists(alternateAgentPath))) {\n    return 'reconcile';\n  }\n  if (!(await FileSystemUtils.fileExists(agentPath))) {\n    return 'skip';\n  }","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/github-copilot/cloud-agent.ts#L362-L398","documentation":"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.","triggerScenarios":"Thrown at src/core/github-copilot/cloud-agent.ts:380 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}