Fission-AI/OpenSpec · error
Conflicting Copilot agent profiles: preserve either
Error message
Conflicting Copilot agent profiles: preserve either ${COPILOT_AGENT_ALTERNATE_FILE} or ${COPILOT_CLOUD_FILES.agent} What it means
Reconciliation guard: both the primary Copilot agent file and an alternate agent profile exist, and the primary is not OpenSpec-managed content. Because the two files would conflict, the agent refuses to pick a survivor automatically.
Solutions
- Decide which agent profile to keep and delete or rename the other
- Merge the alternate profile's content into the file you keep
- Re-run the Copilot setup once only one profile remains
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/github-copilot/cloud-agent.ts:405 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/0c9cf6cd17d4a289.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/github-copilot/cloud-agent.ts:405
}
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';
}
const existingContent = await FileSystemUtils.readFile(agentPath);
if (isManagedCopilotCloudFile(COPILOT_CLOUD_FILES.agent, existingContent)) {
return 'remove-managed';
}
throw new Error(
`Conflicting Copilot agent profiles: preserve either ${COPILOT_AGENT_ALTERNATE_FILE} or ${COPILOT_CLOUD_FILES.agent}`
);
}
/**
* Reconcile Copilot cloud agent files in the project directory.
* Creates missing files and refreshes recognized legacy generated files while
* preserving current generated content and user customizations.
*
* @returns Object indicating which files were written.
*/
export async function writeCopilotCloudFiles(
projectPath: string
): Promise<{ setupStepsWritten: boolean; agentWritten: boolean }> {
const setupStepsPath = FileSystemUtils.resolveProjectArtifactPath(
projectPath,
COPILOT_CLOUD_FILES.setupSteps
);View on GitHub (pinned to 6926ccb18a)