{"record":{"id":"0c9cf6cd17d4a289","repo":"Fission-AI/OpenSpec","slug":"conflicting-copilot-agent-profiles-preserve-eithe","errorCode":null,"errorMessage":"Conflicting Copilot agent profiles: preserve either ${COPILOT_AGENT_ALTERNATE_FILE} or ${COPILOT_CLOUD_FILES.agent}","messagePattern":"Conflicting Copilot agent profiles: preserve either (.+?) or (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/github-copilot/cloud-agent.ts","lineNumber":405,"sourceCode":"}\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  }\n\n  const existingContent = await FileSystemUtils.readFile(agentPath);\n  if (isManagedCopilotCloudFile(COPILOT_CLOUD_FILES.agent, existingContent)) {\n    return 'remove-managed';\n  }\n\n  throw new Error(\n    `Conflicting Copilot agent profiles: preserve either ${COPILOT_AGENT_ALTERNATE_FILE} or ${COPILOT_CLOUD_FILES.agent}`\n  );\n}\n\n/**\n * Reconcile Copilot cloud agent files in the project directory.\n * Creates missing files and refreshes recognized legacy generated files while\n * preserving current generated content and user customizations.\n *\n * @returns Object indicating which files were written.\n */\nexport async function writeCopilotCloudFiles(\n  projectPath: string\n): Promise<{ setupStepsWritten: boolean; agentWritten: boolean }> {\n  const setupStepsPath = FileSystemUtils.resolveProjectArtifactPath(\n    projectPath,\n    COPILOT_CLOUD_FILES.setupSteps\n  );","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/github-copilot/cloud-agent.ts#L387-L423","documentation":"Error \"Conflicting Copilot agent profiles: preserve either ${COPILOT_AGENT_ALTERNATE_FILE} or ${COPILOT_CLOUD_FILES.agent}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/github-copilot/cloud-agent.ts:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}