Files
codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadStateChangedNotification.json
T
Brent Traut 82883da25e Notify subscribers when thread read state changes (#52384)
## What changed

Add the experimental `thread/readState/changed` notification with `threadId` and the committed `readState` receipt. Send it to existing thread subscribers when terminal activity updates read state or a revert clears a removed unread position. Emit terminal read-state updates before `turn/completed` so completion remains the last notification for that result.

Expose the notification in generated JSON schemas, TypeScript types, and Python SDK models. Document experimental capability gating, subscription lifetime, notification opt-out, and refreshing receipts when concurrent responses disagree.

## Testing

Extend the read-state integration test to assert that the notification receipt matches the receipt returned by `thread/read` after terminal activity.

GitOrigin-RevId: 28935352a881b7a5e2e7f629173c3b2061bd7941
2026-10-09 02:59:21 +00:00

83 lines
2.0 KiB
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ThreadReadState": {
"description": "The first unread position in a durable local thread. A null position means read. The opaque revision guards edits against activity or marks the caller has not seen.",
"properties": {
"firstUnread": {
"anyOf": [
{
"$ref": "#/definitions/ThreadUnreadPosition"
},
{
"type": "null"
}
]
},
"revision": {
"type": "string"
}
},
"required": [
"revision"
],
"type": "object"
},
"ThreadUnreadPosition": {
"oneOf": [
{
"description": "Explicitly marked unread, including when the thread has no turns.",
"properties": {
"type": {
"enum": [
"threadStart"
],
"title": "ThreadStartThreadUnreadPositionType",
"type": "string"
}
},
"required": [
"type"
],
"title": "ThreadStartThreadUnreadPosition",
"type": "object"
},
{
"description": "The earliest completed result needing attention.",
"properties": {
"turnId": {
"type": "string"
},
"type": {
"enum": [
"turn"
],
"title": "TurnThreadUnreadPositionType",
"type": "string"
}
},
"required": [
"turnId",
"type"
],
"title": "TurnThreadUnreadPosition",
"type": "object"
}
]
}
},
"properties": {
"readState": {
"$ref": "#/definitions/ThreadReadState"
},
"threadId": {
"type": "string"
}
},
"required": [
"readState",
"threadId"
],
"title": "ThreadReadStateChangedNotification",
"type": "object"
}