Skip to content

Add recording health monitoring and teardown safeguards#64

Merged
Gokias merged 1 commit intomainfrom
codex/implement-recording-health-monitoring
Feb 26, 2026
Merged

Add recording health monitoring and teardown safeguards#64
Gokias merged 1 commit intomainfrom
codex/implement-recording-health-monitoring

Conversation

@Gokias
Copy link
Copy Markdown
Owner

@Gokias Gokias commented Feb 26, 2026

Motivation

  • Improve robustness of live transcription by detecting when a connected VoiceClient has stopped recording and avoid silent failures.
  • Give short transient gaps a configurable grace period before escalating to session teardown.
  • Provide diagnosable logs and ensure session teardown fully cancels background tasks and removes state.

Description

  • Add TRANSCRIBE_RECORDING_FAILURE_GRACE_INTERVALS config to tolerate short blips before escalation.
  • In transcription_live_loop, when vc is connected but vc.recording is false increment session.recording_failure_count, emit a warning including guild_id, voice_state, recording_failure_count, and queue_depth, and apply the grace-period retry logic before proceeding to teardown.
  • When session.recording_failure_count exceeds TRANSCRIBE_MAX_FAILURES, call teardown_transcription_session_for_recording_failure(...) with a clear failure reason containing consecutive failure count and queue depth.
  • Reset session.recording_failure_count to 0 and log a recovery event whenever recording resumes/capture succeeds.
  • Harden teardown_transcription_session_for_recording_failure to cancel and await loop_task and worker_task (avoiding cancelling the current task), then continue disconnect/notification and remove the session via remove_transcription_session.

Testing

  • Performed static syntax check with python -m py_compile poopbot.py, which completed without errors.

Codex Task

@Gokias Gokias merged commit 1a2567f into main Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant