{"record":{"id":"722f078df7aca896","repo":"coleam00/Archon","slug":"ambiguous-project-name-name-did-you-mean-n","errorCode":null,"errorMessage":"Ambiguous project name '${name}'. Did you mean:\\n${candidates}","messagePattern":"Ambiguous project name '(.+?)'\\. Did you mean:\\\\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/orchestrator/orchestrator-agent.ts","lineNumber":506,"sourceCode":" *\n * Mirrors `resolveWorkflowName` (packages/workflows/src/router.ts) but uses\n * prefix instead of suffix for tier 3 — project names don't follow the\n * `archon-X` suffix convention workflows use.\n */\nfunction resolveCodebaseName(name: string, codebases: readonly Codebase[]): Codebase | undefined {\n  const exact = codebases.find(c => c.name === name);\n  if (exact) return exact;\n\n  const lowerName = name.toLowerCase();\n\n  function checkTier(matches: readonly Codebase[], logEvent: string): Codebase | undefined {\n    if (matches.length === 1) {\n      getLog().debug({ requested: name, matched: matches[0].name }, logEvent);\n      return matches[0];\n    }\n    if (matches.length > 1) {\n      const candidates = matches.map(c => `  - ${c.name}`).join('\\n');\n      throw new Error(`Ambiguous project name '${name}'. Did you mean:\\n${candidates}`);\n    }\n    return undefined;\n  }\n\n  return (\n    checkTier(\n      codebases.filter(c => c.name.toLowerCase() === lowerName),\n      'project.set_resolve_case_insensitive_match'\n    ) ??\n    checkTier(\n      codebases.filter(c => c.name.toLowerCase().startsWith(lowerName)),\n      'project.set_resolve_prefix_match'\n    ) ??\n    checkTier(\n      codebases.filter(c => c.name.toLowerCase().includes(lowerName)),\n      'project.set_resolve_substring_match'\n    )\n  );","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/orchestrator/orchestrator-agent.ts#L488-L524","documentation":"resolveCodebaseName's checkTier throws when a project name supplied by the user matches more than one configured project/codebase entry. The engine refuses to guess and lists the matching candidate names so the caller can disambiguate.","triggerScenarios":"Configuring two projects (e.g. in different name tiers) whose names both match the requested name — exact duplicates or overlapping matches — then starting a run or conversation that references the ambiguous name.","commonSituations":"Two client repos with the same basename in different directories ('api' for both frontend-api and backend-api); a project renamed so an old alias now collides with a new entry; case-insensitive matching colliding 'MyApp'/'myapp'.","solutions":["Rename one of the colliding project entries so names are unique.","Use the fully qualified or more specific name of the intended project.","Review the candidates listed in the error and update the calling config/command to use one exactly."],"exampleFix":"// before (archon config)\nprojects: [{ name: 'api', path: '~/frontend-api' }, { name: 'api', path: '~/backend-api' }]\n// after\nprojects: [{ name: 'frontend-api', path: '~/frontend-api' }, { name: 'backend-api', path: '~/backend-api' }]","handlingStrategy":"validation","validationCode":"const projects = listProjects();\nconst matches = projects.filter(p => nameMatches(p.name, requested));\nif (matches.length > 1) throw new Error(`Ambiguous '${requested}': ${matches.map(m => m.name).join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await startRun({ codebase: requested });\n} catch (e) {\n  if (e.message.startsWith('Ambiguous project name')) {\n    const candidates = e.message.split('\\n').slice(1);\n    promptUserToChoose(candidates);\n  } else throw e;\n}","preventionTips":["Keep project names unique across all config tiers; enforce uniqueness at config load.","Avoid multiple projects sharing a directory basename.","Surface the candidate list to users in interactive flows instead of free-text names."],"tags":["configuration","naming","ambiguity"],"backgroundTag":"ambiguous-name","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}