{"record":{"id":"a1cea666c47c692f","repo":"coleam00/Archon","slug":"ambiguous-workflow-workflowname-did-you-mean","errorCode":null,"errorMessage":"Ambiguous workflow '${workflowName}'. Did you mean:\\n${candidates}","messagePattern":"Ambiguous workflow '(.+?)'\\. Did you mean:\\\\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/handlers/command-handler.ts","lineNumber":1172,"sourceCode":"          count: workflows.length,\n          names: workflows.map(w => w.name),\n          searchingFor: workflowName,\n        },\n        'cmd.workflows_discovered'\n      );\n\n      let workflow: WorkflowDefinition | undefined;\n      try {\n        workflow = resolveWorkflowName(workflowName, workflows);\n      } catch (err) {\n        // Ambiguous match — surface the candidates to the user\n        getLog().warn(\n          { requested: workflowName, error: (err as Error).message },\n          'cmd.workflow_resolve_ambiguous'\n        );\n        return {\n          success: false,\n          message: (err as Error).message,\n        };\n      }\n\n      if (!workflow) {\n        // Check if the requested workflow had a load error\n        const loadError = findWorkflowLoadError(loadErrors, workflowName);\n        if (loadError) {\n          return {\n            success: false,\n            message: `Workflow \\`${workflowName}\\` failed to load: ${loadError.error}\\n\\nFix the YAML file and try again.`,\n          };\n        }\n        getLog().warn(\n          { requested: workflowName, available: workflows.map(w => w.name) },\n          'cmd.workflow_not_found'\n        );\n        return {\n          success: false,","sourceCodeStart":1154,"sourceCodeEnd":1190,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/handlers/command-handler.ts#L1154-L1190","documentation":"Thrown when resolving a workflow name matches multiple loaded workflows, so the command cannot pick one unambiguously. handleWorkflowCommand catches the resolver's ambiguity error, logs it as cmd.workflow_resolve_ambiguous, and returns success:false with the message listing the candidate names after 'Did you mean:'.","triggerScenarios":"Invoking `/workflow <name>` (or the CLI equivalent) with a workflowName that prefix/fuzzy-matches several registered workflows — e.g. 'fix' matching 'fix-issue' and 'fix-lint', or two workflow packs exporting similarly named workflows.","commonSituations":"Typing a partial workflow name assuming unique-prefix resolution; installing an additional workflow pack whose names collide with existing ones; renamed workflows leaving an old alias that overlaps a new one.","solutions":["Re-run the command with the full, exact workflow name from the candidate list shown in the message.","List available workflows (`/workflow list` or `archon workflow list`) to confirm the exact identifier.","Rename or uninstall the colliding workflow pack if the ambiguity persists across authors."],"exampleFix":"// before\n/workflow fix\n// after\n/workflow fix-issue","handlingStrategy":"validation","validationCode":"const matches = listWorkflows().filter(w => w.name === requestedName);\nif (matches.length === 0) throw new Error(`Unknown workflow '${requestedName}'`);\nif (matches.length > 1) throw new Error(`Ambiguous workflow '${requestedName}'; use the exact name`);","typeGuard":null,"tryCatchPattern":"try {\n  await handleWorkflowCommand(name);\n} catch (e) {\n  if (/^Ambiguous workflow/.test((e as Error).message)) {\n    const candidates = (e as Error).message.split('Did you mean:')[1];\n    console.log(`Pick one of:${candidates}`);\n  } else throw e;\n}","preventionTips":["Always invoke workflows by their exact registered name (check `/workflow list`).","Avoid relying on prefix matching in scripts.","Rename colliding workflows when installing additional workflow packs.","Tab-complete or copy workflow names rather than typing abbreviations."],"tags":["workflow","resolution","ambiguity"],"backgroundTag":"ambiguous-identifier-match","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}