mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Tighten live run transcript streaming and stdout
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
98ede67b9b
commit
5e9c223077
5 changed files with 68 additions and 12 deletions
|
|
@ -46,7 +46,7 @@ function parsePersistedLogContent(
|
|||
ts,
|
||||
stream,
|
||||
chunk,
|
||||
dedupeKey: `persisted:${runId}:${ts}:${stream}:${chunk}`,
|
||||
dedupeKey: `log:${runId}:${ts}:${stream}:${chunk}`,
|
||||
});
|
||||
} catch {
|
||||
// Ignore malformed log rows.
|
||||
|
|
@ -202,6 +202,7 @@ export function useLiveRunTranscripts({
|
|||
if (event.type === "heartbeat.run.log") {
|
||||
const chunk = readString(payload["chunk"]);
|
||||
if (!chunk) return;
|
||||
const ts = readString(payload["ts"]) ?? event.createdAt;
|
||||
const stream =
|
||||
readString(payload["stream"]) === "stderr"
|
||||
? "stderr"
|
||||
|
|
@ -209,10 +210,10 @@ export function useLiveRunTranscripts({
|
|||
? "system"
|
||||
: "stdout";
|
||||
appendChunks(runId, [{
|
||||
ts: event.createdAt,
|
||||
ts,
|
||||
stream,
|
||||
chunk,
|
||||
dedupeKey: `socket:log:${runId}:${event.createdAt}:${stream}:${chunk}`,
|
||||
dedupeKey: `log:${runId}:${ts}:${stream}:${chunk}`,
|
||||
}]);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue