{"record":{"id":"1d084cda57ce2cee","repo":"coleam00/Archon","slug":"failed-to-find-workflow-runs-by-id-prefix-err-m","errorCode":null,"errorMessage":"Failed to find workflow runs by id prefix: ${err.message}","messagePattern":"Failed to find workflow runs by id prefix: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/db/workflows.ts","lineNumber":508,"sourceCode":" * an ambiguous prefix. Scoped to `codebaseId` in the query, so it never crosses\n * projects. Run ids are UUIDs, so `idPrefix` is rejected unless it's within the\n * UUID charset — that keeps it out of LIKE-wildcard territory (`%` / `_`).\n */\nexport async function findWorkflowRunsByIdPrefix(\n  idPrefix: string,\n  codebaseId: string\n): Promise<WorkflowRun[]> {\n  if (idPrefix.length === 0 || !/^[0-9a-fA-F-]+$/.test(idPrefix)) return [];\n  try {\n    const result = await pool.query<WorkflowRun>(\n      'SELECT * FROM remote_agent_workflow_runs WHERE codebase_id = $1 AND id LIKE $2 LIMIT 2',\n      [codebaseId, `${idPrefix}%`]\n    );\n    return result.rows.map(normalizeWorkflowRun);\n  } catch (error) {\n    const err = error as Error;\n    getLog().error({ err }, 'db.workflow_run_find_by_prefix_failed');\n    throw new Error(`Failed to find workflow runs by id prefix: ${err.message}`);\n  }\n}\n\nexport async function getWorkflowRunStatus(id: string): Promise<string | null> {\n  try {\n    const result = await pool.query<{ status: string }>(\n      'SELECT status FROM remote_agent_workflow_runs WHERE id = $1',\n      [id]\n    );\n    return result.rows[0]?.status ?? null;\n  } catch (error) {\n    const err = error as Error;\n    getLog().error({ err }, 'db.workflow_run_get_status_failed');\n    throw new Error(`Failed to get workflow run status: ${err.message}`);\n  }\n}\n\nexport async function getActiveWorkflowRun(conversationId: string): Promise<WorkflowRun | null> {","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/db/workflows.ts#L490-L526","documentation":"Error \"Failed to find workflow runs by id prefix: ${err.message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/db/workflows.ts:508 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":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}