{"record":{"id":"f20158f01c492de4","repo":"coleam00/Archon","slug":"run-id-runid-matches-more-than-one-run-in-thi","errorCode":null,"errorMessage":"Run id '${runId}' matches more than one run in this project:\n${candidates}\nUse more characters or the full id.","messagePattern":"Run id '(.+?)' matches more than one run in this project:\n(.+?)\nUse more characters or the full id\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4084,"sourceCode":"  if (FULL_RUN_ID_RE.test(runId)) return runId;\n  if (cwd === undefined && codebaseId === undefined) {\n    if (requirePrefixMatch) {\n      throw new Error(`Cannot resolve run id prefix '${runId}' without a project directory.`);\n    }\n    return runId;\n  }\n  const resolvedCodebaseId =\n    codebaseId ?? (cwd === undefined ? undefined : (await findCodebaseForCheckoutPath(cwd))?.id);\n  if (!resolvedCodebaseId) {\n    if (requirePrefixMatch) {\n      throw new Error(`Cannot resolve run id prefix '${runId}' outside a registered project.`);\n    }\n    return runId;\n  }\n  const matches = await workflowDb.findWorkflowRunsByIdPrefix(runId, resolvedCodebaseId);\n  if (matches.length > 1) {\n    const candidates = matches.map(match => `  ${match.id}`).join('\\n');\n    throw new Error(\n      `Run id '${runId}' matches more than one run in this project:\\n${candidates}\\nUse more characters or the full id.`\n    );\n  }\n  if (matches.length === 0) {\n    if (requirePrefixMatch) {\n      throw new Error(`No workflow run matches prefix '${runId}' in this project.`);\n    }\n    return runId;\n  }\n  return matches[0].id;\n}\n\n/**\n * Shared `--detach` front half for `approve`/`reject`/`resume`. Validates the run\n * READ-ONLY via `precheck`, then hands the whole command to a detached child that\n * re-invokes the same argv (minus `--detach`/`--json`) and owns ALL state mutation\n * in its own process group — so killing the shell that hosted the parent cannot\n * zombie the run mid-resume. The parent must never call","sourceCodeStart":4066,"sourceCodeEnd":4102,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4066-L4102","documentation":"A short run-id prefix matched multiple runs within the resolved project, so the CLI refuses to guess and lists the candidate full ids, asking for a longer prefix.","triggerScenarios":"`workflow get/resume/approve` with a prefix (e.g. 2-4 chars) that is a prefix of two or more run ids in the same codebase.","commonSituations":"Sharing a session id prefix across many runs of the same project; copying only the first few characters of an id from a log line; tab-completion habits from other tools.","solutions":["Re-run with more characters of the id until it is unique.","Use the full run id copied from the run list or the candidates shown in the error.","Filter `archon workflow runs` by status/date first to find the exact id."],"exampleFix":"// before\narchon workflow get ab\n// after\narchon workflow get ab12cd34","handlingStrategy":"validation","validationCode":"const runs = await listRuns({ json: true }); const hits = runs.filter(r => r.id.startsWith(prefix)); if (hits.length !== 1) throw new Error('prefix not unique, use full id');","typeGuard":null,"tryCatchPattern":"try { await getRun(prefix); } catch (e) { const ids = [...String(e.message).matchAll(/\\s+([0-9a-f-]{36})/g)].map(m => m[1]); if (ids.length) return getRun(ids[0]); throw e; }","preventionTips":["Use at least 8+ characters of the id when using prefixes.","Generate a unique prefix per run when scripting (e.g. derive from timestamped ids).","Parse the candidate list out of the error message to disambiguate programmatically."],"tags":["cli","workflow","ambiguous-identifier"],"backgroundTag":"ambiguous-id-prefix","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}