Track voice session lifecycle metrics in the TUI (#43934)

## What changed

- Record voice session starts, connections, failures, endings, and active duration under `codex.voice.session.*`.
- Deduplicate failure accounting and distinguish errors during startup retry cleanup from errors during a requested stop.
- Record failures on rejected voice operations and disconnects, and clear the owned session when a stop request is rejected.

## Testing

Add regression tests for failure accounting during retry cleanup and session cleanup after rejected stop requests, including replay-only threads.

GitOrigin-RevId: d67cab5ff1e8fc85ce7a3d61a1763d38a5d537f0
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-08 22:21:01 +00:00
1 parent 5e3f0ee94b
commit fba22e9a2a
7 files changed
+140 -7

No files matched your search

+6 -2
View File
@@ -482,9 +482,11 @@ impl App {
self.chat_widget
.restore_undelivered_realtime_speech(*delivery_id);
}
if let AppCommand::RealtimeConversationStart { thread_id, .. } = &op
if let AppCommand::RealtimeConversationStart { thread_id, .. }
| AppCommand::RealtimeConversationStop { thread_id } = &op
&& self.chat_widget.thread_id() == Some(*thread_id)
{
self.chat_widget.record_realtime_failure();
self.chat_widget.reset_realtime_conversation();
}
self.chat_widget
@@ -506,9 +508,11 @@ impl App {
self.chat_widget
.restore_undelivered_realtime_speech(*delivery_id);
}
if let AppCommand::RealtimeConversationStart { thread_id, .. } = &op
if let AppCommand::RealtimeConversationStart { thread_id, .. }
| AppCommand::RealtimeConversationStop { thread_id } = &op
&& self.chat_widget.thread_id() == Some(*thread_id)
{
self.chat_widget.record_realtime_failure();
self.chat_widget.reset_realtime_conversation();
}
self.chat_widget.add_error_message(