Advanced remote usage
Reconnect and multiple observers
Retain transport.state only from your app's own connection. Restore it with the same Agent/version and reauthorize before displaying private data. Alternatively use client.attach(runId), pass the verified handle to transport.attach(handle), then resume the stream. Neither attachment submits or starts new work.
Separate authorized observers can attach to the same run. Cursor/attempt handling deduplicates retained events. Final canonical text replaces streamed text rather than creating another copy.
Approvals and cancellation
Render server approvals explicitly. approveInput() continues approved input; approveTool() uses the exact retained operation/name/hash. No client-side tool executor is needed. disconnect() affects one observer; stop() requests server cancellation. Unknown upstream costs remain visible.
Memory and retained jobs
Render response/memory/graph status separately. Use client.getEmbeddingProfile, governed recall and stage memoryReadiness rather than app-side embeddings or after-response memory writes. Fetch retained artifact/content/media state by ID and use authenticated private previews.
See artifacts, assets/media and runtime API.
Explicit server compatibility
Root model wrappers, middleware, streaming helpers and legacy memory factories remain separate advanced local administration APIs. They require explicit administrative server transport and caller-owned resource cleanup. They neither override runtime JWT/grant policy nor turn a local streamText loop into a retained backend run. Use /remote for the application integration described here.