Skip to content

Commit 8c68233

Browse files
committed
Fix tests
1 parent a7f995e commit 8c68233

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/agent-runtime/src/run-agent-step.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,10 @@ export const runAgentStep = async (
261261
const iterationNum = agentState.messageHistory.length
262262
const systemTokens = countTokensJson(system)
263263

264-
const cacheDebugCorrelation = CACHE_DEBUG_FULL_LOGGING
265-
? createCacheDebugSnapshot({
264+
let cacheDebugCorrelation: ReturnType<typeof createCacheDebugSnapshot> | undefined
265+
if (CACHE_DEBUG_FULL_LOGGING) {
266+
try {
267+
cacheDebugCorrelation = createCacheDebugSnapshot({
266268
agentType: String(agentType),
267269
system,
268270
toolDefinitions: params.tools
@@ -284,7 +286,10 @@ export const runAgentStep = async (
284286
agentStepId,
285287
model,
286288
})
287-
: undefined
289+
} catch (err) {
290+
logger.warn({ error: err }, '[Cache Debug] Failed to create snapshot')
291+
}
292+
}
288293

289294
const onCacheDebugProviderRequestBuilt =
290295
cacheDebugCorrelation

0 commit comments

Comments
 (0)