Skip to content

Add chunk-level state tracking with retry and crash recovery#16

Open
mohi-devhub wants to merge 1 commit intoruxailab:mainfrom
mohi-devhub:chunk-state-tracking
Open

Add chunk-level state tracking with retry and crash recovery#16
mohi-devhub wants to merge 1 commit intoruxailab:mainfrom
mohi-devhub:chunk-state-tracking

Conversation

@mohi-devhub
Copy link
Copy Markdown
Collaborator

@mohi-devhub mohi-devhub commented Jan 25, 2026

Overview

This PR implements a robust chunk-level state tracking system that ensures reliable audio processing with automatic retry and crash recovery capabilities.

What's New

Core Components:

  • ChunkStateManager - Manages chunk lifecycle with three states: RECORDED → SENT → TRANSCRIBED
  • RecoveryManager - Handles bot restart recovery and resumes incomplete processing
  • Meeting state integration - Track chunks per meeting session

Features:

  • ✅ Per-chunk state tracking with JSON persistence
  • ✅ Independent retry with exponential backoff (max 5 attempts)
  • ✅ Crash recovery - state survives process/VM restarts
  • ✅ Meeting completion guarantee - all chunks must be TRANSCRIBED
  • ✅ No silent failures - comprehensive logging

Code Quality:

  • Removed decorative emojis from bot messages
  • Clear error/warning text prefixes
  • Validated state transitions
  • Proper error handling throughout

Documentation

  • README.md - Updated with setup, testing, and debugging guides
  • CONTRIBUTING.md - Developer guidelines with integration patterns
  • docs/CHUNK_STATE_GUIDE.md - Quick start integration reference

Testing

Includes comprehensive test suite and integration examples:

  • examples/test_chunk_state.py - Unit tests for all core functionality
  • examples/integration_example.py - Real-world usage with mock API

All tests pass ✓

Files Changed

New:

  • bot/chunk_state_manager.py (467 lines)
  • bot/recovery_manager.py (294 lines)
  • docs/CHUNK_STATE_GUIDE.md
  • CONTRIBUTING.md

Modified:

  • bot/main.py - Cleaned up messages
  • bot/meeting_state.py - Added chunk tracking
  • README.md - Comprehensive documentation

Integration Points

Ready for immediate integration with:

  • Transcription API - Drop-in retry handling
  • Summarization pipeline - Completion validation and transcript assembly

Fixes : #5

@mohi-devhub mohi-devhub self-assigned this Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chunk-level state tracking and retry mechanism

1 participant