# fix\(server\): drop superseded tool updates from snapshots · screen/t3code-personal

[View on GitCafe](https://git.cafe/screen/t3code-personal/commit/b7d1981b57f1c30908808d1939fd4edbc781de12)

Repository: [screen/t3code-personal](https://git.cafe/screen/t3code-personal)

Visibility: public

Requested revision: b7d1981b57f1c30908808d1939fd4edbc781de12

Requested commit: b7d1981b57f1c30908808d1939fd4edbc781de12

Commit: b7d1981b57f1c30908808d1939fd4edbc781de12

Tree: cfe3df24301be7b147f6ac9b5b3ca841859e9dbb

Author: Theo Browne

Committer: Theo Browne

## Message

```
fix(server): drop superseded tool updates from snapshots

A tool.updated row is the in-flight snapshot of a call; once the call
completes, the tool.completed row carries the final state and both
clients fold every matching update into it. Shipping the updates buys
nothing: 47k such rows exist in one real database, and a single thread
carries 3,291 of them.

Filter them out of thread snapshots, mirroring the existing
context-window dedup. Matching is per turn and only against a LATER
completion, so a revert that discards the completing turn cannot leave
a call unrepresented, and a later update under the same identity (the
next call, still in flight) survives. Live events are untouched.

Rows are matched on the same identity the clients collapse by: an
explicit data.toolCallId when the adapter emits one, otherwise the
itemType/title/detail triple. No tool lifecycle row in the real db
carries a toolCallId, so the fallback does the work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

```

## Parents

- [64a3cd6d7daab21f6bfbc00faf0104b6fd361267](https://git.cafe/screen/t3code-personal/commit/64a3cd6d7daab21f6bfbc00faf0104b6fd361267?format=markdown)

[Source at this commit](https://git.cafe/screen/t3code-personal/tree/b7d1981b57f1c30908808d1939fd4edbc781de12?format=markdown)
