mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
Motivation - Today, a newly connected client has no direct way to determine the current runtime status of threads from read/list responses alone. - This forces clients to infer state from transient events, which can lead to stale or inconsistent UI when reconnecting or attaching late. Changes - Add `status` to `thread/read` responses. - Add `statuses` to `thread/list` responses. - Emit `thread/status/changed` notifications with `threadId` and the new status. - Track runtime status for all loaded threads and default unknown threads to `idle`. - Update protocol/docs/tests/schema fixtures for the revised API. Testing - Validated protocol API changes with automated protocol tests and regenerated schema/type fixtures. - Validated app-server behavior with unit and integration test suites, including status transitions and notifications.
101 lines
2.2 KiB
JSON
101 lines
2.2 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"ThreadActiveFlag": {
|
|
"enum": [
|
|
"waitingOnApproval",
|
|
"waitingOnUserInput"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"ThreadStatus": {
|
|
"oneOf": [
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"notLoaded"
|
|
],
|
|
"title": "NotLoadedThreadStatusType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "NotLoadedThreadStatus",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"idle"
|
|
],
|
|
"title": "IdleThreadStatusType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "IdleThreadStatus",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"systemError"
|
|
],
|
|
"title": "SystemErrorThreadStatusType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "SystemErrorThreadStatus",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"activeFlags": {
|
|
"items": {
|
|
"$ref": "#/definitions/ThreadActiveFlag"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"active"
|
|
],
|
|
"title": "ActiveThreadStatusType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"activeFlags",
|
|
"type"
|
|
],
|
|
"title": "ActiveThreadStatus",
|
|
"type": "object"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/ThreadStatus"
|
|
},
|
|
"threadId": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status",
|
|
"threadId"
|
|
],
|
|
"title": "ThreadStatusChangedNotification",
|
|
"type": "object"
|
|
} |