Detach realtime sideband observers without ending the session (#57817)

## Why

Stopping a sideband observer should close its WebSocket while preserving the frontend-owned realtime session. The existing frameless session close also sends `session.close`, so observer shutdown needs a transport-only close.

## What changed

- Add `close_transport()` to send a normal WebSocket close without `session.close`.
- Close the sideband transport on cancellation or when the call becomes inactive, including an existing connection awaiting adoption by the input task. Bound the close attempt to five seconds.
- Thread an optional sideband base URL through realtime start processing and allow nested thread ID fields in request serialization scopes.

## Testing

Add WebSocket and core conversation regression tests covering observer detachment for both realtime parsers and conversation versions. Verify that explicit frameless session close still sends `session.close`.

GitOrigin-RevId: 874a8980b0fcd45058e976b00c0d968f5b4b2404
This commit is contained in:
Jiahao
2026-10-28 20:10:15 +00:00
committed by copyberry
parent c92700d299
commit ef186f812a
8 changed files with 253 additions and 14 deletions
+2 -1
View File
@@ -1723,8 +1723,9 @@ impl MessageProcessor {
.await
}
ClientRequest::ThreadRealtimeStart { params, .. } => {
let sideband_base_url = None;
self.turn_processor
.thread_realtime_start(&request_id, params)
.thread_realtime_start(&request_id, params, sideband_base_url)
.await
}
ClientRequest::ThreadRealtimeAppendAudio { params, .. } => {