Add timestamp to messages

This commit is contained in:
Mario Zechner 2025-10-26 00:43:43 +02:00
parent ef09efaac9
commit 55dc0b6e08
24 changed files with 388 additions and 220 deletions

View file

@ -162,6 +162,7 @@ export class Agent {
role: "user",
content,
attachments: attachments?.length ? attachments : undefined,
timestamp: Date.now(),
};
this.abortController = new AbortController();
@ -311,6 +312,7 @@ export class Agent {
},
stopReason: this.abortController?.signal.aborted ? "aborted" : "error",
errorMessage: err?.message || String(err),
timestamp: Date.now(),
};
this.appendMessage(msg as AppMessage);
this.patch({ error: err?.message || String(err) });

View file

@ -48,6 +48,7 @@ function streamSimpleProxy(
cacheWrite: 0,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
timestamp: Date.now(),
};
let reader: ReadableStreamDefaultReader<Uint8Array> | undefined;