From df0eda69e82805c679dc243cdb159c8d54eb8c24 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:00:55 -0800 Subject: [PATCH] docs(native-chat): describe held live-text bytes as an estimate --- src/main/native-chat/retention/chat-path-retained-bytes.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/native-chat/retention/chat-path-retained-bytes.ts b/src/main/native-chat/retention/chat-path-retained-bytes.ts index 0635949a052..ad049920c89 100644 --- a/src/main/native-chat/retention/chat-path-retained-bytes.ts +++ b/src/main/native-chat/retention/chat-path-retained-bytes.ts @@ -25,9 +25,10 @@ const VALUE_BYTES = 16 const sizes = new WeakMap() /** - * What a payload holds on the heap, from above for its strings: two bytes per character, plus a - * fixed cost per value. One visit per value and no serialization, so a growing reply costs its - * value count, not its text length; measured once per payload however many holders share it. + * Estimates what a payload holds on the heap: two bytes per character plus a fixed cost per value. + * One visit per value and no serialization, so a growing reply costs its value count, not its + * length; measured once per payload however many holders share it. A string sliced from a larger + * one would keep more alive, but live text is parsed provider output, never such a slice. */ export function heldBytesOf(payload: object): number { const cached = sizes.get(payload)