From fa4f8abec51a86be3afae9d80a99009d2bb2400f Mon Sep 17 00:00:00 2001 From: cpacker Date: Wed, 3 Dec 2025 16:46:53 -0800 Subject: [PATCH] feat: add backfill count status message at start of history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows "Showing N most recent messages" with ADE link at the top of backfilled history so users know they are seeing partial history. 🤖 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta --- src/cli/App.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/cli/App.tsx b/src/cli/App.tsx index a4ba98d..ebd571c 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -584,7 +584,27 @@ export default function App({ // Use backfillBuffers to properly populate the transcript from history backfillBuffers(buffersRef.current, messageHistory); - // Inject status line at the end of the backfilled history + // Inject "showing N messages" status at the START of backfilled history + const backfillStatusId = `status-backfill-${Date.now().toString(36)}`; + const messageCount = messageHistory.length; + const agentUrl = agentState?.id + ? `https://app.letta.com/agents/${agentState.id}` + : null; + const backfillLines = [ + `Showing ${messageCount} most recent message${messageCount !== 1 ? "s" : ""}`, + agentUrl + ? ` → View full history in ADE: ${agentUrl}` + : " → View full history in ADE", + ]; + buffersRef.current.byId.set(backfillStatusId, { + kind: "status", + id: backfillStatusId, + lines: backfillLines, + }); + // Insert at the beginning of the order array + buffersRef.current.order.unshift(backfillStatusId); + + // Inject provenance status line at the END of the backfilled history const statusLines = generateStatusLines( continueSession, agentProvenance,