# Fix broad query invalidation on checkpoint/captured events · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/24c617d32ef64e4aeceedb4746ef89c3815360c0)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 24c617d32ef64e4aeceedb4746ef89c3815360c0

Requested commit: 24c617d32ef64e4aeceedb4746ef89c3815360c0

Commit: 24c617d32ef64e4aeceedb4746ef89c3815360c0

Tree: adb5a67becb92e5f55f9b6834bcf3783968c7863

Author: Cursor Agent

Committer: Julius Marminge

## Message

```
Fix broad query invalidation on checkpoint/captured events

Scope invalidation to only the checkpoint diff query for the newly
captured turn instead of invalidating all provider queries. The
checkpoint/captured event carries a turnCount in its payload, so we
use a predicate to match only the query whose toTurnCount equals the
captured turn. This prevents N unnecessary refetches of immutable
diffs for already-completed turns on each new turn completion.

```

## Parents

- [22e1a4cf92e035c11d079e7254334acb4d7e2a35](https://git.cafe/pingdotgg/t3code/commit/22e1a4cf92e035c11d079e7254334acb4d7e2a35?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/24c617d32ef64e4aeceedb4746ef89c3815360c0?format=markdown)
