fix: expose workbench projection failures in otel (#1824)

This commit is contained in:
Lyon
2026-06-21 13:44:22 +08:00
committed by GitHub
parent 426048bca4
commit a5b47d5d8d
3 changed files with 51 additions and 2 deletions
+5 -1
View File
@@ -1095,7 +1095,11 @@ async function handleWorkbenchTurnSnapshot(response, url, options, actor, rawTur
}
const readModel = createWorkbenchReadModel(options, actor);
const result = await readModel.queryFacts({ traceId, limit: MAX_PAGE_LIMIT });
if (result.error) return sendJson(response, 503, workbenchProjectionStoreError(result.error));
if (result.error) {
const body = workbenchProjectionStoreError(result.error);
recordWorkbenchTurnReadMetric(options, url, 503, body, startedAt);
return sendJson(response, 503, body);
}
const session = visibleFactSessions(result.facts, actor).find((item) => item.lastTraceId === traceId) ?? visibleFactSessions(result.facts, actor)[0] ?? null;
const turn = factTurnForTrace(result.facts, traceId, turnId);
const found = Boolean(session || turn);