MCPcopy Index your code
hub / github.com/simstudioai/sim / getLatestRunForExecution

Function getLatestRunForExecution

apps/sim/lib/copilot/async-runs/repository.ts:149–165  ·  view source on GitHub ↗
(executionId: string)

Source from the content-addressed store, hash-verified

147}
148
149async 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.

Callers

nothing calls this directly

Calls 2

withDbSpanFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected