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

+1
View File
@@ -849,6 +849,7 @@ impl App {
let message = format!("Voice conversation failed: {err:#}");
if is_realtime_stop {
if self.chat_widget.thread_id() == realtime_stop_thread_id {
self.chat_widget.record_realtime_failure();
self.chat_widget.reset_realtime_conversation();
self.chat_widget.add_error_message(message);
}