test(chatcore): wait for queued call log writes (#10683)

Merged — locally validated (70/70 combined chatcore-translation-paths tests, typecheck:core clean, gates green). Thanks!
This commit is contained in:
Aaron Scherer
2026-08-20 11:00:34 -05:00
committed by GitHub
parent 06315c445c
commit 2a10d16114

View File

@@ -36,7 +36,8 @@ const {
setBackgroundDegradationConfig,
resetStats: resetBackgroundStats,
} = await import("../../open-sse/services/backgroundTaskDetector.ts");
const { getCallLogs, getCallLogById } = await import("../../src/lib/usage/callLogs.ts");
const { getCallLogs, getCallLogById, waitForCallLogSaves } =
await import("../../src/lib/usage/callLogs.ts");
const {
handleChatCore,
shouldUseNativeCodexPassthrough,
@@ -286,6 +287,7 @@ async function flushAsyncSideEffects() {
}
async function getLatestCallLog() {
await waitForCallLogSaves(5000);
const rows = await getCallLogs({ limit: 5 });
if (!Array.isArray(rows) || rows.length === 0) return null;
return getCallLogById(rows[0].id);