feat(webapp): time "Processing…" from the hand-off, not the last edit (#534) #640
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/534-audio-processing-started-at"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The session page's "Processing…" timer (#381) counted from
sessions.updated_at, because the pipeline recorded no start time. Any unrelated edit (a GM renaming the session mid-transcription) reset the clock to zero.Change
One nullable column,
sessions.audio_processing_started_at, stamped wherever the status becomesprocessing:routers/bot.py)routers/sessions.py)routers/admin.py)It's exposed on the session response.
SessionDetailanchors the timer on it, falling back toupdated_atonly when the column is null.Where the stamp goes, and why not in
process_audioThe #534 bullet says "set when
process_audiotakes the job". I didn't do that, deliberately.process_audiore-runs on every Celery retry (transport errors, and rate-limit re-queues viaretry_after), and the status staysprocessingthe whole time. A pickup stamp would restart the clock on each retry, which recreates the under-reporting this change is meant to remove. The GM sees one continuous "Processing…" from hand-off to result, and that's what the timer now measures. Provider queue time is included and is already explained byProcessingQueueNote.Migration
c2d3e4f5a6b7Raw DDL,
TIMESTAMPTZ NULL. It backfills= updated_atfor sessions currentlyprocessing, so an in-flight timer doesn't blank or jump on upgrade. It's never cleared: it's the start of the latest run and is only read whileprocessing.Verified locally on a scratch database:
upgrade head→downgrade -1→upgrade head. The backfill's'processing'literal is checked against the enum even on an empty table, so a bad label would have errored.Deliberately not changed
The stuck-task watchdog (
unstick_lost_tasks) still usesupdated_at < now - 8h. Moving it to this column is tempting, but its 8h cutoff would then include queue and retry-backoff time, and a busy provider could get a legitimately retrying run failed. That wants its own decision, not a ride-along.Tests
test_bot_upload_audio: hand-off sets a fresh stamp.test_retry_failed_audio,test_admin_retry_audio: a day-old stamp is replaced on retry.SessionDetail.test.jsx: "times processing from the hand-off, not the last edit". Stamp 25m ago,updated_at1m ago, expectsElapsed 25m 00s.Mutation-checked: with the three router lines reverted, all three backend tests fail. With
SessionDetail.jsxreverted, the frontend test fails.Backend suite before the head-pin update:
3471 passed, 1 failed, 13 skipped. The one failure was the stale head pin, now fixed; the affected files were rerun green. FrontendSessionDetail+ElapsedTimer: 94 passed.ruff format --check/ruff checkclean under CI's pinned 0.4.4.No bot API change:
/api/bot/sessions/{id}/audio's request and response are unchanged, so no contract bump.Refs #534 (one of five items; the issue stays open)
🤖 Generated with Claude Code