Tighten live run transcript streaming and stdout

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-03-11 13:29:40 -05:00
parent 98ede67b9b
commit 5e9c223077
5 changed files with 68 additions and 12 deletions

View File

@@ -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;
}