Add experimental thread queue APIs to app server (#38456)

## What changed

- Add experimental `thread/queue/add`, `list`, `update`, `delete`, `reorder`, and `start` requests for persistent queued user submissions.
- Automatically dispatch queued submissions in FIFO order after completed or failed turns, while leaving the queue paused after interruption.
- Emit `thread/queue/changed` notifications and expose paginated queue contents with stable submission and client message IDs.
- Export the new protocol types through the generated JSON Schema and TypeScript bindings.

## Testing

- Add app-server integration coverage for capability gating, CRUD, pagination, capacity limits, notifications, automatic dispatch, cold-thread resume, interruption, and explicit queue starts.

GitOrigin-RevId: 89caf5577192199bda77cf6c372a59d26cdd910e
This commit is contained in:
efrazer-oai authored and copyberry committed 2026-08-13 23:38:02 +00:00
1 parent 4d9f3021c8
commit 9341b38310
35 files changed
+1952 -105

No files matched your search

@@ -574,6 +574,42 @@ client_request_definitions! {
serialization: thread_id(params.thread_id),
response: v2::ThreadGoalClearResponse,
},
#[experimental("thread/queue/add")]
ThreadQueueAdd => "thread/queue/add" {
params: v2::ThreadQueueAddParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueAddResponse,
},
#[experimental("thread/queue/list")]
ThreadQueueList => "thread/queue/list" {
params: v2::ThreadQueueListParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueListResponse,
},
#[experimental("thread/queue/update")]
ThreadQueueUpdate => "thread/queue/update" {
params: v2::ThreadQueueUpdateParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueUpdateResponse,
},
#[experimental("thread/queue/delete")]
ThreadQueueDelete => "thread/queue/delete" {
params: v2::ThreadQueueDeleteParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueDeleteResponse,
},
#[experimental("thread/queue/reorder")]
ThreadQueueReorder => "thread/queue/reorder" {
params: v2::ThreadQueueReorderParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueReorderResponse,
},
#[experimental("thread/queue/start")]
ThreadQueueStart => "thread/queue/start" {
params: v2::ThreadQueueStartParams,
serialization: thread_id(params.thread_id),
response: v2::ThreadQueueStartResponse,
},
ThreadMetadataUpdate => "thread/metadata/update" {
params: v2::ThreadMetadataUpdateParams,
serialization: thread_id(params.thread_id),
@@ -1723,6 +1759,8 @@ server_notification_definitions! {
ThreadNameUpdated => "thread/name/updated" (v2::ThreadNameUpdatedNotification),
ThreadGoalUpdated => "thread/goal/updated" (v2::ThreadGoalUpdatedNotification),
ThreadGoalCleared => "thread/goal/cleared" (v2::ThreadGoalClearedNotification),
#[experimental("thread/queue/changed")]
ThreadQueueChanged => "thread/queue/changed" (v2::ThreadQueueChangedNotification),
#[experimental("thread/environment/connected")]
EnvironmentConnected => "thread/environment/connected" (v2::EnvironmentConnectionNotification),
#[experimental("thread/environment/disconnected")]