{"record":{"id":"cf9ab9fa003ec2db","repo":"coleam00/Archon","slug":"failed-to-list-recent-workflow-events-error-as","errorCode":null,"errorMessage":"Failed to list recent workflow events: ${(error as Error).message}","messagePattern":"Failed to list recent workflow events: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/db/workflow-events.ts","lineNumber":207,"sourceCode":"    if (since) {\n      const result = await pool.query<WorkflowEventRow>(\n        `SELECT * FROM remote_agent_workflow_events\n         WHERE workflow_run_id = $1 AND created_at > $2\n         ORDER BY created_at ASC, COALESCE(event_order, 0) ASC, id ASC`,\n        [workflowRunId, toDbDateParam(since)]\n      );\n      return [...result.rows].map(row => ({\n        ...row,\n        data: typeof row.data === 'string' ? JSON.parse(row.data) : row.data,\n      }));\n    }\n    return await listWorkflowEvents(workflowRunId);\n  } catch (error) {\n    getLog().error(\n      { err: error as Error, runId: workflowRunId },\n      'db.workflow_events_list_recent_failed'\n    );\n    throw new Error(`Failed to list recent workflow events: ${(error as Error).message}`);\n  }\n}\n\n/**\n * List workflow events across ALL runs created at or after `after`, oldest first,\n * capped at `limit`. Used by the dashboard event poller to tail events written by\n * any process (incl. out-of-process CLI runs) and replay them to the SSE dashboard.\n *\n * `>=` (not `>`) so events sharing the boundary timestamp are not skipped — SQLite's\n * `datetime('now')` is 1-second resolution, so ties are common; the caller dedupes by\n * id at the boundary and tolerates harmless duplicates (the dashboard reacts to events\n * by refetching, which is idempotent).\n *\n * `eventTypes` (when given) filters to those event types in SQL. The poller passes the\n * small set of dashboard-relevant types, which keeps high-frequency `tool_*` rows out of\n * the result — so a single 1-second bucket realistically never exceeds `limit`, and the\n * boundary `>=` + seen-set paging can't stall on overflow.\n */","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/db/workflow-events.ts#L189-L225","documentation":"Error \"Failed to list recent workflow events: ${(error as Error).message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/db/workflow-events.ts:207 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"}