anthropics / anthropics/claude-code

Between-tool assistant text intermittently NOT stored in session .jsonl — replaced by a summary typed as 'thinking' (permanent data loss, regression from display-only summarization)

未关闭
#94,336 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:core area:model bug has repro platform:windows
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

## Summary

The display-side summarization of assistant text emitted **between tool calls** (Fable 5 in Claude Code) is already documented in #77798, #86565, #80136, #81853, #67164. Until now, the mitigating fact — confirmed in our own sessions on 2026-09-03 by reading the session `.jsonl` — was that **the transcript on disk retained the verbatim text**; only the rendering was lossy.

**That is no longer reliably true.** We have a confirmed case (2026-09-14) where a substantive ~2,400-character assistant text block emitted between two tool calls **never reached the session `.jsonl` at all**. In its position, the transcript contains a ~40-word paraphrase of that text stored as a **`thinking`-type content block**. The original text is unrecoverable — it exists nowhere on disk. This upgrades a display annoyance to **permanent data loss**, and it also **mistypes content**: prose the model addressed to the user is stored as if it were internal reasoning.

## Environment

- Claude Code VS Code extension `anthropic.claude-code-2.1.270-win32-x64`
- Windows 11 Pro (build 26200)
- Model: `claude-fable-5` (subscription auth)
- Not observed on Opus turns in the same sessions (Opus days show zero summary artifacts)

## Evidence

**Incident (2026-09-14, ~16:34 UTC).** Sanitized entry-type sequence from the session `.jsonl` around the loss (line numbers from the file):

```
799 assistant TEXT (intro prose, stored verbatim — survives)
800 assistant tool_use: Read
801 user tool_result
803 assistant thinking (empty)
804 assistant thinking ← ~40-word SUMMARY of the missing text block
805 assistant tool_use: Edit
811 user tool_result
814 assistant TEXT (closing prose, stored verbatim — survives)
```

Between lines 801 and 805 the model emitted a four-paragraph text block (~2.4k chars) to the user. The UI displayed a summary of it (quote-block style); line 804 is that summary, stored as `thinking`. No `text` block containing the original exists anywhere in the file (verified by phrase search across all 848 lines).

**Baseline (the same measurement, previous 22 days).** We scanned our session transcripts and classified every assistant `text` block as mid-turn (a later `tool_use` occurs before the next real user message) or end-of-turn:

| Session span | Model | Mid-turn text blocks stored verbatim |
|---|---|---|
| 2026-08-23 → 09-06 (321 MB session) | fable | ~1,800 blocks, ~966k chars — including blocks >2,300 chars |
| 2026-09-06 → 09-14 (237 MB session) | fable | ~1,170 blocks, ~530k chars, present every single day |
| same session, Opus turns | opus | verbatim, zero summary artifacts |
| 2026-09-14 (session with the incident) | fable | 13 shorter mid-turn blocks stored verbatim; the one substantive block lost |

So storage of mid-turn text was verbatim and reliable for weeks — and in the incident session, *most* mid-turn text still stored fine. The loss is **selective/intermittent**, which is worse for users than a clean regime change: there is no way to know which prose survived without diffing against a memory of what was said.

## Impact

1. **Permanent loss of user-facing output.** The lost block was the substantive part of the turn (the reason the user asked "what did you actually say there?" — and the answer was recoverable only because the model's context window still held it).
2. **Transcript integrity.** The `.jsonl` now contains a paraphrase the model never wrote, typed as `thinking`. Anything downstream that consumes transcripts (export, resume/compaction, audit, user tooling) receives fabricated-looking content in place of real output.
3. **The recommended workaround is broken.** The guidance that emerged around the display-side issues — "the full text is in the transcript, check there" — no longer holds.

## Expected behavior

Summarize in the *display layer* if that's a product decision — but the stored transcript should always retain the verbatim assistant output, and content blocks should keep their true type (`text` addressed to the user must not be stored as `thinking`).

## Reproduction

Intermittent; observed with `claude-fable-5` on long multi-tool turns where a substantive (multi-paragraph) text block is emitted between tool calls. Shorter between-tool narration in the same session stored normally. Happy to provide additional sanitized structural detail from the affected transcript on request.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。