bugfix
This commit is contained in:
@@ -734,7 +734,7 @@ export class AgentHarness {
|
||||
* Yields typed HarnessEvents (chunk, tool_call, image, done) and saves the
|
||||
* conversation to the store once the done event has been emitted.
|
||||
*/
|
||||
async *streamMessage(message: InboundMessage): AsyncGenerator<HarnessEvent> {
|
||||
async *streamMessage(message: InboundMessage, options?: { saveUserMessage?: boolean }): AsyncGenerator<HarnessEvent> {
|
||||
this.config.logger.info(
|
||||
{ messageId: message.messageId, userId: message.userId, content: message.content.substring(0, 100) },
|
||||
'Processing user message'
|
||||
@@ -889,9 +889,11 @@ export class AgentHarness {
|
||||
blobRefs = blobIds.map((id, i) => ({ id, mimeType: collectedImages[i].mimeType, caption: collectedImages[i].caption }));
|
||||
}
|
||||
|
||||
if (options?.saveUserMessage !== false) {
|
||||
await this.conversationStore.saveMessage(
|
||||
this.config.userId, this.config.sessionId, 'user', message.content, undefined, channelKey
|
||||
);
|
||||
}
|
||||
await this.conversationStore.saveMessage(
|
||||
this.config.userId, this.config.sessionId, 'assistant', finalContent,
|
||||
blobRefs.length > 0 ? { blobs: blobRefs } : undefined,
|
||||
@@ -914,7 +916,7 @@ export class AgentHarness {
|
||||
content,
|
||||
timestamp: new Date(),
|
||||
};
|
||||
yield* this.streamMessage(greetingMessage);
|
||||
yield* this.streamMessage(greetingMessage, { saveUserMessage: false });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user