Files
codex/codex-rs/state/migrations/0061_thread_read_state.sql
T
Brent Traut 0ada5d8806 Expose experimental durable thread read state in the app server (#52350)
## What changed

- Add experimental `readState` to `thread/read` and a thread-ID-keyed `readStates` map to `thread/list` for eligible durable local user threads. Each receipt contains `firstUnread` and an opaque `revision`.
- Publish new visible terminal results before `turn/completed`, after flushing the rollout. Reading snapshots leaves activity unread; replayed history does not publish new activity.
- Clear unread positions removed by a paginated thread revert while preserving explicit thread-start marks and concurrent receipt updates.

## Testing

Add an integration test covering completed-turn receipts, repeated reads without acknowledgement, matching list receipts, and revert cleanup with a changed revision.

GitOrigin-RevId: e7f6ddfbb1fc2fa95d1ef2876d7f0f7b9f99ff65
2026-10-09 01:22:30 +00:00

9 lines
350 B
SQL

-- Independent of rebuildable thread metadata: only actual thread deletion removes receipts.
-- NULL means read; the empty string means manually unread from the start, even when empty.
CREATE TABLE thread_read_receipts (
thread_id TEXT PRIMARY KEY NOT NULL,
first_unread_turn TEXT,
revision TEXT NOT NULL,
last_published_turn TEXT
);