@@ -113,7 +113,6 @@ const AGENT_RAW_PROVIDER_ERROR_INPUT_PATHS: readonly ResolvedSecretInputPath[] =
113113 [ 'promptCaching' ] ,
114114 [ 'previousInteractionId' ] ,
115115]
116- const AGENT_MEMORY_ERROR_INPUT_PATHS : readonly ResolvedSecretInputPath [ ] = [ [ 'conversationId' ] ]
117116
118117interface IndexedToolInput {
119118 tool : ToolInput
@@ -411,30 +410,14 @@ export class AgentBlockHandler implements BlockHandler {
411410 if ( this . isStreamingExecution ( result ) ) {
412411 const streamingResult = result as StreamingExecution
413412 streamingResult . diagnosticResolvedSecretTraceRegistry = providerErrorRegistry
414- const memoryErrorRegistry = settledInputRegistry ?. forkForInputPaths (
415- AGENT_MEMORY_ERROR_INPUT_PATHS
416- )
417413 if ( filteredInputs . memoryType && filteredInputs . memoryType !== 'none' ) {
418- return this . wrapStreamForMemoryPersistence (
419- ctx ,
420- filteredInputs ,
421- streamingResult ,
422- memoryErrorRegistry
423- )
414+ return this . wrapStreamForMemoryPersistence ( ctx , filteredInputs , streamingResult )
424415 }
425416 return streamingResult
426417 }
427418
428419 if ( filteredInputs . memoryType && filteredInputs . memoryType !== 'none' ) {
429- const memoryErrorRegistry = settledInputRegistry ?. forkForInputPaths (
430- AGENT_MEMORY_ERROR_INPUT_PATHS
431- )
432- await this . persistResponseToMemory (
433- ctx ,
434- filteredInputs ,
435- result as BlockOutput ,
436- memoryErrorRegistry
437- )
420+ await this . persistResponseToMemory ( ctx , filteredInputs , result as BlockOutput )
438421 }
439422
440423 return result
@@ -2484,8 +2467,7 @@ export class AgentBlockHandler implements BlockHandler {
24842467 private wrapStreamForMemoryPersistence (
24852468 ctx : ExecutionContext ,
24862469 inputs : AgentInputs ,
2487- streamingExec : StreamingExecution ,
2488- diagnosticRegistry ?: ResolvedSecretTraceRegistry
2470+ streamingExec : StreamingExecution
24892471 ) : StreamingExecution {
24902472 return {
24912473 ...streamingExec ,
@@ -2494,17 +2476,10 @@ export class AgentBlockHandler implements BlockHandler {
24942476 try {
24952477 await memoryService . appendToMemory ( ctx , inputs , { role : 'assistant' , content } )
24962478 } catch ( error ) {
2497- const memoryErrorRegistry = this . createErrorRegistry (
2498- diagnosticRegistry ,
2499- ctx . resolvedSecretTraceRegistry
2500- )
2501- const diagnosticCtx = memoryErrorRegistry
2502- ? { ...ctx , resolvedSecretTraceRegistry : memoryErrorRegistry }
2503- : ctx
25042479 logger . error (
25052480 'Failed to persist streaming response' ,
25062481 projectAgentDiagnosticMetadata (
2507- diagnosticCtx ,
2482+ ctx ,
25082483 getErrorDiagnosticMetadata ( error ) ,
25092484 getErrorDiagnosticFallback ( error )
25102485 )
@@ -2517,8 +2492,7 @@ export class AgentBlockHandler implements BlockHandler {
25172492 private async persistResponseToMemory (
25182493 ctx : ExecutionContext ,
25192494 inputs : AgentInputs ,
2520- result : BlockOutput ,
2521- diagnosticRegistry ?: ResolvedSecretTraceRegistry
2495+ result : BlockOutput
25222496 ) : Promise < void > {
25232497 const content = ( result as any ) ?. content
25242498 if ( ! content || typeof content !== 'string' ) {
@@ -2531,17 +2505,10 @@ export class AgentBlockHandler implements BlockHandler {
25312505 workflowId : ctx . workflowId ,
25322506 } )
25332507 } catch ( error ) {
2534- const memoryErrorRegistry = this . createErrorRegistry (
2535- diagnosticRegistry ,
2536- ctx . resolvedSecretTraceRegistry
2537- )
2538- const diagnosticCtx = memoryErrorRegistry
2539- ? { ...ctx , resolvedSecretTraceRegistry : memoryErrorRegistry }
2540- : ctx
25412508 logger . error (
25422509 'Failed to persist response to memory' ,
25432510 projectAgentDiagnosticMetadata (
2544- diagnosticCtx ,
2511+ ctx ,
25452512 getErrorDiagnosticMetadata ( error ) ,
25462513 getErrorDiagnosticFallback ( error )
25472514 )
0 commit comments