File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/agent-runtime/src Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments