Add a native cloud backend to the app-server client (#59493)

## What changed

Expose `cloud_backend::connect` to adapt an authenticated `codex-cloud-client` client to `AppServerClient`. Support account reads, resuming a conversation by ID with saved settings, reading its metadata, listing the loaded thread, and unsubscribing.

Forward turn lifecycle events and agent message deltas, and track thread status from attachment notifications. Keep the previous attachment when a replacement fails, report stream disconnections, and reject turns without an active attachment. Unsupported requests and approval replies return explicit errors.

## Testing

Add tests covering failed attachment replacement, turn admission after disconnect, and thread status tracking across notifications and reattachment.

GitOrigin-RevId: 5a131e814d588cadeb9fb94513b99e92b47e3da4
This commit is contained in:
Benjamin Carlsson
2026-11-04 20:51:55 +00:00
committed by copyberry
parent 08bbbbdff3
commit 5112ce6ede
10 changed files with 554 additions and 1 deletions
@@ -67,6 +67,13 @@ pub(super) struct Envelope<T: Message + Default + std::fmt::Debug> {
pub params: Option<T>,
}
#[derive(Clone, Message)]
pub(super) struct StatusUpdate {
#[prost(message, optional, tag = "1")]
pub status: Option<crate::activation_wire::ThreadStatus>,
#[prost(string, optional, tag = "2")]
pub thread_id: Option<String>,
}
#[derive(Clone, Message)]
pub(super) struct PatchUpdate {
#[prost(message, optional, tag = "1")]
pub changes: Option<Changes>,