Repository navigation
fix(conversations): persist completed custom-STT captures when processing budget is exhausted (#23923) - #24095
Conversation
…sing budget is exhausted (BasedHardware#23923)
|
The core fix is correct and well tested: exhausted-budget custom-STT captures now durably persist as completed instead of being stranded in status='processing' (#23923) — one design question and a couple of small gaps below, nothing blocking on correctness. Per-file notes:
Notes:
USER IMPACT: Users on an exhausted free plan who transcribe with their own STT key will now see those recordings saved with a plain title (no AI summary) instead of being lost/stuck in processing. What I'd still want:
Leaving the merge/product call for human maintainer review (persistence behavior on a budget-gated surface). by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Follow-up implemented in 3d10ddc:
Validation on the published file contents: complete test_process_conversation_free_tier_branch.py 49 passed; complete test_process_conversation_usage_context.py 72 passed, each in its own pytest process. Python 3.11.16, isolated wheel environment (not lock-identical), Black 26.5.1, git diff --check passed. These are offline unit contracts, not live finalization evidence. Full repository preflight was attempted but blocked by missing history and sparse-checkout manifest paths; no full-preflight pass is claimed. The product decision about automatic enrichment after credit renewal versus explicit reprocessing remains unchanged and needs maintainer acceptance. Please review these concrete test/telemetry changes on the new head. Follow-up CI caught CRLF line endings introduced by the Windows checkout. These files have now been normalized to LF, committed and read back byte-for-byte. The failed earlier Hygiene run is not a pass; please use the latest head checks. |
…custom-STT completion (BasedHardware#23923)
|
Since my last review: addressed (initial-creation branch now tested — Verdict: follow-up cleanly addresses the prior review; the production change is correct and well hardened, and checks are green on this head (Backend unit suite, Backend Hermetic Merge Gate, Hygiene, Formatting). I reviewed statically against the full diff; I did not rerun the suites locally. Cost: unchanged from last review and still protective — the distinct outcome label now makes the saved paid embedding/metadata skips visible on dashboards. Blast radius: unchanged — only custom-STT conversations on exhausted accounts; managed-STT paths untouched. USER IMPACT: Users on an exhausted free plan transcribing with their own STT key get recordings saved with a plain transcript-derived title instead of them hanging at "processing"; existing enriched recordings keep their summaries on reprocess. What I'd still want: only the open maintainer decision — whether these terminal, Leaving that merge/product call for human maintainer review (enrichment-after-renewal behavior on a budget-gated persistence surface). by AI on behalf of David |
What changed and why
Fixes #23923. When a user with exhausted monthly processing credits captures a Custom-STT conversation (
uses_custom_stt=True),process_conversationpreviously mutatedstatus=completedonly in memory and reportedpersistence_observer(False), leaving live/v4/listen?custom_stt=enabledconversations stranded in Firestore atstatus='processing'with blank titles and causingfinalizer.pyto fence aslifecycle persistence lost. Persist a deterministic zero-LLM completed conversation (terminal_no_derived_effects=True,discarded=False,deferred=False) and skip Omi-paid summary-vector embedding/LLM metadata calls while preserving existing summaries on reprocess of already-completed rows.Product invariants affected
INV-MEM-4, INV-TASK-2 (touched path glob
backend/utils/conversations/process_conversation.py; zero canonical memory promotion or task-capture behavior changed because exhausted custom-STT rows remain terminal withTERMINAL_NO_DERIVED_EFFECTS).How it was verified
process_conversation, free-tier entrypoints, processing backlog, andfinalizer.py(pytest tests/unit/test_process_conversation_usage_context.py,tests/unit/test_process_conversation_free_tier_branch.py,tests/unit/test_free_tier_entrypoint_matrix.py,tests/unit/test_processing_backlog.py,tests/unit/test_listen_finalization_cloud_tasks.py— 512 passed).black --check --line-length 120andpython scripts/pr_preflight_all.py.Tests
backend/tests/unit/test_process_conversation_usage_context.py:test_custom_stt_exhausted_processing_budget_persists_live_capturetest_custom_stt_exhausted_processing_budget_reprocess_preserves_completed_summarytest_custom_stt_exhausted_processing_budget_skips_summary_vector_paid_callsbackend/tests/unit/test_process_conversation_free_tier_branch.py:test_finalizer_completes_exhausted_custom_stt_capture_without_paid_workUI evidence
UI-Evidence: none -- backend-only custom-STT post-processing persistence fix
Failure class (fixes)
Failure-Class: none
Line-Count-Exception: backend/utils/metrics.py | 1601 -> 1609 | Add CUSTOM_STT_BUDGET_EXHAUSTED_COMPLETION_TOTAL metric counter for #23923