(executionId: string)
| 147 | } |
| 148 | |
| 149 | async function getLatestRunForExecution(executionId: string) { |
| 150 | return withDbSpan( |
| 151 | TraceSpan.CopilotAsyncRunsGetLatestForExecution, |
| 152 | 'SELECT', |
| 153 | 'copilot_runs', |
| 154 | { [TraceAttr.CopilotExecutionId]: executionId }, |
| 155 | async () => { |
| 156 | const [run] = await db |
| 157 | .select() |
| 158 | .from(copilotRuns) |
| 159 | .where(eq(copilotRuns.executionId, executionId)) |
| 160 | .orderBy(desc(copilotRuns.startedAt)) |
| 161 | .limit(1) |
| 162 | return run ?? null |
| 163 | } |
| 164 | ) |
| 165 | } |
| 166 | |
| 167 | // Un-instrumented: called from a 4 Hz resume poll; per-call spans |
| 168 | // swamped traces. Use Prom histograms if latency visibility is needed. |
nothing calls this directly
no test coverage detected