{"record":{"id":"946ed9fc753c5546","repo":"stablyai/orca","slug":"timed-out-finding-dispatched-mac-release-build-wor","errorCode":null,"errorMessage":"Timed out finding dispatched mac release build workflow run named \"${expectedTitle}\".","messagePattern":"Timed out finding dispatched mac release build workflow run named \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-release-mac-build-workflow.mjs","lineNumber":110,"sourceCode":"      `/repos/${api.owner}/${api.repo}/actions/workflows/${encodeURIComponent(\n        options.workflow\n      )}/runs?event=workflow_dispatch&per_page=20`\n    )\n    const workflowRuns = Array.isArray(response?.workflow_runs) ? response.workflow_runs : []\n    const match = workflowRuns.find((run) => {\n      const createdAtMs = Date.parse(run.created_at ?? '')\n\n      return createdAtMs >= deps.dispatchStartedAtMs && run.display_title === expectedTitle\n    })\n\n    if (match) {\n      return match\n    }\n\n    await sleep(options.pollSeconds * 1000)\n  }\n\n  throw new Error(\n    `Timed out finding dispatched mac release build workflow run named \"${expectedTitle}\".`\n  )\n}\n\nexport async function waitForReleaseMacBuildRun(api, workflowRunId, options, deps = {}) {\n  const now = deps.now ?? Date.now\n  const sleep = deps.sleep ?? sleepMilliseconds\n  const deadlineMs = now() + options.timeoutMinutes * 60 * 1000\n\n  while (now() <= deadlineMs) {\n    const run = await api.request(\n      'GET',\n      `/repos/${api.owner}/${api.repo}/actions/runs/${workflowRunId}`\n    )\n\n    if (run.status === 'completed') {\n      return run\n    }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-release-mac-build-workflow.mjs#L92-L128","documentation":"Thrown by findDispatchedReleaseMacBuildRun when, within RUN_DISCOVERY_TIMEOUT_SECONDS (120s), no workflow run matching the dispatch can be found. A match requires created_at >= dispatchStartedAtMs (now-10s) AND display_title === expectedReleaseMacBuildRunTitle ('Mac release build <tag> (<releaseRunId>)').","triggerScenarios":"After dispatchReleaseMacBuildWorkflow, polling GET .../actions/workflows/<wf>/runs?event=workflow_dispatch&per_page=20 never yields a run whose title and creation time match. Possible because the dispatch was accepted but the run is slow to register, the title format changed, or per_page=20 omits it behind many newer runs.","commonSituations":"Workflow file renamed/mismatched, tag or releaseRunId mismatch, high workflow churn pushing the new run past the first 20, clock skew on created_at, dispatch actually 202 (queued) but not yet creating a run object.","solutions":["Confirm options.workflow (RELEASE_MAC_BUILD_WORKFLOW) matches the actual workflow file name.","Verify tag and releaseRunId produce the exact expected title via expectedReleaseMacBuildRunTitle.","Reduce concurrent dispatches or bump per_page/poll if the run falls outside the first 20.","Re-run; transient GitHub lag under heavy load is common."],"exampleFix":"// before\nconst workflowRun = await findDispatchedReleaseMacBuildRun(api, options, deps)\n// after\n// confirm title formula matches what the workflow produces\nconsole.log(expectedReleaseMacBuildRunTitle(options))\n// and widen discovery by increasing pollSeconds / re-dispatching if GitHub lagged","handlingStrategy":"retry","validationCode":"const expectedTitle = expectedReleaseMacBuildRunTitle(options)\n// sanity-check inputs that form the title before dispatching\nif (!options.tag || !options.releaseRunId) {\n  throw new Error('tag and releaseRunId are required to match the dispatched run title')\n}","typeGuard":"function isWorkflowRun(value) {\n  return value != null && (typeof value.id === 'number') && (typeof value.display_title === 'string')\n}","tryCatchPattern":"try {\n  workflowRun = await findDispatchedReleaseMacBuildRun(api, options, deps)\n} catch (err) {\n  if (/Timed out finding dispatched mac release build/.test(err.message)) {\n    // GitHub lag: wait and re-dispatch/re-poll once, with a wider per_page\n  }\n  throw err\n}","preventionTips":["Confirm RELEASE_MAC_BUILD_WORKFLOW matches the workflow file name exactly.","Keep dispatch churn low so the new run stays within the first 20 results.","Verify tag/releaseRunId produce the exact title the workflow will display."],"tags":["ci","github-api","timeout","release","discovery"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}