Hide saved-session resume noise from nice transcripts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -57,4 +57,28 @@ describe("RunTranscriptView", () => {
|
|||||||
expect(html).toContain("<li>first</li>");
|
expect(html).toContain("<li>first</li>");
|
||||||
expect(html).toContain("<li>second</li>");
|
expect(html).toContain("<li>second</li>");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("hides saved-session resume skip stderr from nice mode normalization", () => {
|
||||||
|
const entries: TranscriptEntry[] = [
|
||||||
|
{
|
||||||
|
kind: "stderr",
|
||||||
|
ts: "2026-03-12T00:00:00.000Z",
|
||||||
|
text: "[paperclip] Skipping saved session resume for task \"PAP-485\" because wake reason is issue_assigned.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
kind: "assistant",
|
||||||
|
ts: "2026-03-12T00:00:01.000Z",
|
||||||
|
text: "Working on the task.",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const blocks = normalizeTranscript(entries, false);
|
||||||
|
|
||||||
|
expect(blocks).toHaveLength(1);
|
||||||
|
expect(blocks[0]).toMatchObject({
|
||||||
|
type: "message",
|
||||||
|
role: "assistant",
|
||||||
|
text: "Working on the task.",
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -275,6 +275,11 @@ function parseSystemActivity(text: string): { activityId?: string; name: string;
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shouldHideNiceModeStderr(text: string): boolean {
|
||||||
|
const normalized = compactWhitespace(text).toLowerCase();
|
||||||
|
return normalized.startsWith("[paperclip] skipping saved session resume");
|
||||||
|
}
|
||||||
|
|
||||||
function groupCommandBlocks(blocks: TranscriptBlock[]): TranscriptBlock[] {
|
function groupCommandBlocks(blocks: TranscriptBlock[]): TranscriptBlock[] {
|
||||||
const grouped: TranscriptBlock[] = [];
|
const grouped: TranscriptBlock[] = [];
|
||||||
let pending: Array<Extract<TranscriptBlock, { type: "command_group" }>["items"][number]> = [];
|
let pending: Array<Extract<TranscriptBlock, { type: "command_group" }>["items"][number]> = [];
|
||||||
@@ -428,6 +433,9 @@ export function normalizeTranscript(entries: TranscriptEntry[], streaming: boole
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entry.kind === "stderr") {
|
if (entry.kind === "stderr") {
|
||||||
|
if (shouldHideNiceModeStderr(entry.text)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
blocks.push({
|
blocks.push({
|
||||||
type: "event",
|
type: "event",
|
||||||
ts: entry.ts,
|
ts: entry.ts,
|
||||||
|
|||||||
Reference in New Issue
Block a user