From 1e42501bb335789b8c5971d5810a49c0a40064d0 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 24 Oct 2026 08:35:20 +0000 Subject: [PATCH] fix(durable): keep pi.live cached in the partial-commit cost test The suite's evicting run (PI_DURABLE_DOCUMENT_RETENTION_MS=0) evicts the unwatched pi.live after every commit, so each partial commit replayed the document's delta chain and the per-commit cost grew with the stream. Pin the document retention in that test so it measures appends, as the default retention does. --- packages/durable/test/harness-events.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/durable/test/harness-events.test.ts b/packages/durable/test/harness-events.test.ts index e12d7d295..fac02d049 100644 --- a/packages/durable/test/harness-events.test.ts +++ b/packages/durable/test/harness-events.test.ts @@ -690,6 +690,9 @@ describe("streamed partials", () => { const stream = async (size: number) => { const setup = chatSetup({ tokensPerSecond: 64_000, tokenSize: { min: 64, max: 64 } }); setup.settings.progress = { partialIntervalMs: 1, outputIntervalMs: 100 }; + // Keep `pi.live` cached between commits, as the default retention does. Evicted after each use (the suite's + // evicting run), every commit replays the document's delta chain: a cost of eviction, not of appending. + setup.settings.documentRetentionMs = 60_000; const text = 'streamed text with "quotes" and \\ escapes\n'.repeat(size / 40); setup.faux.setResponses([ fauxAssistantMessage(