Skip to content

Commit 071972e

Browse files
committed
docs(plugin): document thinking-only assistant message projection undercount
31% of assistant messages have reasoning parts but no text part. Their reasoning bytes are freed when the associated tool tag drops, but are not reflected in any tag's reasoningByteSize. This is a known conservative undercount that may be addressed in a future pass.
1 parent da03b91 commit 071972e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/plugin/src/hooks/magic-context/compartment-trigger.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ function estimateProjectedPostDropPercentage(
7070

7171
// 2. Heuristic auto-drop: old tool outputs outside protected tail
7272
// 3. Reasoning clearing: reasoning bytes on message tags between watermark and age cutoff
73+
// Note: reasoning on thinking-only assistant messages (no text part) is attributed to
74+
// subsequent tool tags at runtime via precedingThinkingParts, but not reflected in any
75+
// tag's reasoningByteSize. This is a known conservative undercount (~31% of assistant
76+
// messages are thinking-only). Those bytes are freed when the tool tag is dropped, but
77+
// the projection doesn't account for them.
7378
const maxTag = activeTags.reduce((max, t) => Math.max(max, t.tagNumber), 0);
7479
if (autoDropToolAge !== undefined && protectedTags !== undefined) {
7580
const toolAgeCutoff = maxTag - autoDropToolAge;

0 commit comments

Comments
 (0)