From e32dfd9c430e92bfd46085a7f0f8faf5596bef41 Mon Sep 17 00:00:00 2001 From: bowenliang123 Date: Fri, 14 Aug 2026 22:48:08 +0800 Subject: [PATCH] perf(host): raise the folded-history caps so turn mode covers more turns The host kept only the newest 160 request records and 150 events, so turn granularity (which collapses steps into turns) could not show a meaningful number of turns. Raised to 500 requests / 400 events. --- src/host.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/host.ts b/src/host.ts index e6f11c8..c979bf2 100644 --- a/src/host.ts +++ b/src/host.ts @@ -443,8 +443,10 @@ function foldInto(st: FoldState, events: readonly SessionEvent[]): void { } } st.n = events.length - if (st.requests.length > 160) st.requests = st.requests.slice(-160) - if (st.events.length > 150) st.events = st.events.slice(-150) + // Keep a deep-enough history for both display granularities: turn mode + // collapses steps, so these bounds must cover many turns, not just steps. + if (st.requests.length > 500) st.requests = st.requests.slice(-500) + if (st.events.length > 400) st.events = st.events.slice(-400) } function buildResult(st: FoldState): Snapshot {