# fix\(server\): bound orchestration replay payloads \(\#8992\) · gitcafe/t3code

[View on GitCafe](https://git.cafe/gitcafe/t3code/commit/7e460f429b740180cd72730418262a2df971ba54)

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

Visibility: public

Requested revision: 7e460f429b740180cd72730418262a2df971ba54

Requested commit: 7e460f429b740180cd72730418262a2df971ba54

Commit: 7e460f429b740180cd72730418262a2df971ba54

Tree: 1a36f8e34c227eeafd33d2f7671212bb0da66e8a

Author: Ross Cawston

Committer: GitHub

## Message

```
fix(server): bound orchestration replay payloads (#8992)

WebSocket reconnect catch-up only checked the number of missing events, then loaded and decoded the whole replay range before sending it. A handful of events with large tool payloads could allocate gigabytes and OOM the server.

Before replaying, run a SQL preflight that counts the events in the range and sums their serialized payload bytes with octet_length(). If the range is over the existing row limit or an 8 MiB byte budget, fall back to the fresh snapshot path. Applies to both thread and shell subscriptions.

Authored by @rcawston. Review, octet_length fix, and merge by Claude Fable 5.1 in Claude Code on behalf of @t3dotgg.
```

## Parents

- [c2283ce14628127ef1758974ddab4f5b1f89d47a](https://git.cafe/gitcafe/t3code/commit/c2283ce14628127ef1758974ddab4f5b1f89d47a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/t3code/tree/7e460f429b740180cd72730418262a2df971ba54?format=markdown)
