Skip to content

The agent that grows with you

fix(desktop): a kept truncated tail entry still counts as a use

kshitijk4poorfbb0181224e5
diff --git a/apps/desktop/src/store/transcript-tail.ts b/apps/desktop/src/store/transcript-tail.ts
index 797b928d208..4fe84396725 100644
--- a/apps/desktop/src/store/transcript-tail.ts
+++ b/apps/desktop/src/store/transcript-tail.ts
@@ -178,16 +178,16 @@ export function recordTranscriptTail(
}
const key = transcriptTailKey(storedSessionId, owner)
+ const existing = $transcriptTailBySessionId.get()[key]
// This runs before the active refresh decides whether the page is
// authoritative (use-background-sync). A transient zero-row read must not
// turn a known-truncated tail into "nothing earlier", or "Show earlier"
- // disarms while the rows are still on the backend.
- if (page.messages.length === 0 && $transcriptTailBySessionId.get()[key]?.possiblyTruncated) {
- return
- }
+ // disarms while the rows are still on the backend. Re-recording the kept
+ // entry (a no-op write) still bumps it to the MRU end.
+ const keepTruncated = page.messages.length === 0 && existing?.possiblyTruncated
- setTranscriptTailEntry(key, tailStateFromPage(page, route))
+ setTranscriptTailEntry(key, keepTruncated ? existing : tailStateFromPage(page, route))
}
/** Advance the bookkeeping after one older backfill page landed. */