Skip to content

Add durable thread read state with revision-checked updates - #52337

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/fee8c05c20903b1d7aea7e8b61c9248c7f623a72
Oct 9, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/fee8c05c20903b1d7aea7e8b61c9248c7f623a72

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Add durable thread read state with revision-checked updates

Why

A stale read acknowledgement must not clear unread results published after the client’s snapshot or overwrite another read-state edit. Read state also needs to survive thread metadata rebuilds.

What changed

  • Add thread_read_receipts and state APIs to query read state, publish thread attention, and mark threads read or unread.
  • Track the first unread turn and require matching revisions for explicit edits, returning the current state on conflicts. Allow manually marking even an empty thread unread.
  • Retain the last published turn across acknowledgements to suppress duplicate delivery. Keep receipts independent of rebuildable metadata and remove them on thread deletion.
  • Return initial read states without creating receipt rows.

Testing

Add tests covering stale edits, thread-specific initial revisions, repeated unread marks, duplicate publication, persistence across metadata rebuilds and restarts, clearing a reverted turn’s unread position, and deleted-thread handling.

## Why

A stale read acknowledgement must not clear unread results published after the client’s snapshot or overwrite another read-state edit. Read state also needs to survive thread metadata rebuilds.

## What changed

- Add `thread_read_receipts` and state APIs to query read state, publish thread attention, and mark threads read or unread.
- Track the first unread turn and require matching revisions for explicit edits, returning the current state on conflicts. Allow manually marking even an empty thread unread.
- Retain the last published turn across acknowledgements to suppress duplicate delivery. Keep receipts independent of rebuildable metadata and remove them on thread deletion.
- Return initial read states without creating receipt rows.

## Testing

Add tests covering stale edits, thread-specific initial revisions, repeated unread marks, duplicate publication, persistence across metadata rebuilds and restarts, clearing a reverted turn’s unread position, and deleted-thread handling.

GitOrigin-RevId: fee8c05c20903b1d7aea7e8b61c9248c7f623a72
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/fee8c05c20903b1d7aea7e8b61c9248c7f623a72 branch from 3c61a9d to b6e8a2e Compare October 9, 2026 00:41
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-09T00:41:38.737702Z 3c61a9d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit b6e8a2e into main Oct 9, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/fee8c05c20903b1d7aea7e8b61c9248c7f623a72 branch October 9, 2026 00:41
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
@lajward-prog
lajward-prog deployed to issue-triage October 9, 2026 00:42 — with Image GitHub Actions Active
@lajward-prog
lajward-prog deployed to issue-triage October 9, 2026 00:42 — with Image GitHub Actions Active
@lajward-prog
lajward-prog deployed to issue-triage October 9, 2026 00:42 — with Image GitHub Actions Active
@Jackchen1005
Jackchen1005 deployed to issue-triage October 9, 2026 00:44 — with Image GitHub Actions Active
@Jackchen1005
Jackchen1005 deployed to issue-triage October 9, 2026 00:44 — with Image GitHub Actions Active
@Jackchen1005
Jackchen1005 deployed to issue-triage October 9, 2026 00:44 — with Image GitHub Actions Active
@TT9898549
TT9898549 deployed to issue-triage October 9, 2026 00:52 — with Image GitHub Actions Active
@TT9898549
TT9898549 deployed to issue-triage October 9, 2026 00:52 — with Image GitHub Actions Active
@TT9898549
TT9898549 deployed to issue-triage October 9, 2026 00:52 — with Image GitHub Actions Active
@TT9898549
TT9898549 deployed to issue-triage October 9, 2026 00:53 — with Image GitHub Actions Active
@bakira99
bakira99 deployed to issue-triage October 9, 2026 01:06 — with Image GitHub Actions Active
@bakira99
bakira99 deployed to issue-triage October 9, 2026 01:06 — with Image GitHub Actions Active
@bakira99
bakira99 deployed to issue-triage October 9, 2026 01:06 — with Image GitHub Actions Active
@nokiyliao
nokiyliao deployed to issue-triage October 9, 2026 01:09 — with Image GitHub Actions Active
@nokiyliao
nokiyliao deployed to issue-triage October 9, 2026 01:09 — with Image GitHub Actions Active
@nokiyliao
nokiyliao deployed to issue-triage October 9, 2026 01:09 — with Image GitHub Actions Active
@wcwishson
wcwishson deployed to issue-triage October 9, 2026 01:11 — with Image GitHub Actions Active
@wcwishson
wcwishson deployed to issue-triage October 9, 2026 01:11 — with Image GitHub Actions Active
@wcwishson
wcwishson deployed to issue-triage October 9, 2026 01:11 — with Image GitHub Actions Active
@wcwishson
wcwishson deployed to issue-triage October 9, 2026 01:12 — with Image GitHub Actions Active
@zhangs5487
zhangs5487 deployed to issue-triage October 9, 2026 01:13 — with Image GitHub Actions Active
@zhangs5487
zhangs5487 deployed to issue-triage October 9, 2026 01:13 — with Image GitHub Actions Active
@zhangs5487
zhangs5487 deployed to issue-triage October 9, 2026 01:13 — with Image GitHub Actions Active
@wubizhi
wubizhi deployed to issue-triage October 9, 2026 01:14 — with Image GitHub Actions Active
@wubizhi
wubizhi deployed to issue-triage October 9, 2026 01:14 — with Image GitHub Actions Active
@wubizhi
wubizhi deployed to issue-triage October 9, 2026 01:14 — with Image GitHub Actions Active
@brice-ruppen
brice-ruppen deployed to issue-triage October 9, 2026 01:16 — with Image GitHub Actions Active
@brice-ruppen
brice-ruppen deployed to issue-triage October 9, 2026 01:16 — with Image GitHub Actions Active
@brice-ruppen
brice-ruppen deployed to issue-triage October 9, 2026 01:16 — with Image GitHub Actions Active
@brice-ruppen
brice-ruppen deployed to issue-triage October 9, 2026 01:17 — with Image GitHub Actions Active
@SamHuang68
SamHuang68 deployed to issue-triage October 9, 2026 01:18 — with Image GitHub Actions Active
@SamHuang68
SamHuang68 deployed to issue-triage October 9, 2026 01:18 — with Image GitHub Actions Active
@SamHuang68
SamHuang68 deployed to issue-triage October 9, 2026 01:18 — with Image GitHub Actions Active
@SamHuang68
SamHuang68 deployed to issue-triage October 9, 2026 01:19 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.