Skip to content

Commit c6736be

Browse files
icecrasher321waleedlatif1
authored andcommitted
cleanup fallback code
1 parent 45d00f1 commit c6736be

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

apps/sim/executor/handlers/agent/agent-handler.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,12 +1161,7 @@ export class AgentBlockHandler implements BlockHandler {
11611161
streamingExec: StreamingExecution
11621162
): StreamingExecution {
11631163
return {
1164-
stream: memoryService.wrapStreamForPersistence(
1165-
streamingExec.stream,
1166-
ctx,
1167-
inputs,
1168-
streamingExec.execution?.output
1169-
),
1164+
stream: memoryService.wrapStreamForPersistence(streamingExec.stream, ctx, inputs),
11701165
execution: streamingExec.execution,
11711166
}
11721167
}

apps/sim/executor/handlers/agent/memory.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,7 @@ export class Memory {
660660
wrapStreamForPersistence(
661661
stream: ReadableStream<Uint8Array>,
662662
ctx: ExecutionContext,
663-
inputs: AgentInputs,
664-
executionOutput?: { content?: string }
663+
inputs: AgentInputs
665664
): ReadableStream<Uint8Array> {
666665
let accumulatedContent = ''
667666
const decoder = new TextDecoder()
@@ -673,15 +672,13 @@ export class Memory {
673672
},
674673

675674
flush: () => {
676-
const finalContent = executionOutput?.content || accumulatedContent
677-
678-
if (finalContent?.trim()) {
679-
this.persistMemoryMessage(ctx, inputs, { role: 'assistant', content: finalContent })
675+
if (accumulatedContent.trim()) {
676+
this.persistMemoryMessage(ctx, inputs, { role: 'assistant', content: accumulatedContent })
680677
.then(() => {
681678
logger.debug('Persisted streaming response to memory', {
682679
workflowId: ctx.workflowId,
683680
conversationId: inputs.conversationId,
684-
contentLength: finalContent.length,
681+
contentLength: accumulatedContent.length,
685682
})
686683
})
687684
.catch((error) => {

0 commit comments

Comments
 (0)