Skip to content

Order live transcription posts by timestamp#62

Merged
Gokias merged 1 commit intomainfrom
codex/update-live-posting-path-in-poopbot.py
Feb 26, 2026
Merged

Order live transcription posts by timestamp#62
Gokias merged 1 commit intomainfrom
codex/update-live-posting-path-in-poopbot.py

Conversation

@Gokias
Copy link
Copy Markdown
Owner

@Gokias Gokias commented Feb 26, 2026

Motivation

  • Live transcription lines were being posted in the order chunks finished transcribing, which caused out-of-order display when chunks complete late or concurrently.
  • Buffering structured utterances and emitting them by timestamp with a small watermark gives deterministic ordering while still keeping latency low.

Description

  • Replaced the plain-string live buffer with a structured buffer pending_live_entries: list[dict] and added pending_live_lock to coordinate access to it.
  • build_transcript_lines_for_chunk now includes chunk_id with each entry and returns structured entries { "absolute_start", "chunk_id", "line" }.
  • transcription_worker_loop enqueues structured entries into session.pending_live_entries under the lock instead of posting immediately when a chunk finishes.
  • transcription_live_loop applies a small watermark (emit_cutoff = now - session.started_at - TRANSCRIBE_EMIT_INTERVAL_SECONDS), extracts ready entries, sorts them by (absolute_start, chunk_id), and then posts them in order.
  • try_post_live_lines signature was updated to accept structured entries and sends only entry["line"], re-buffering structured entries on failure.
  • The existing final transcript generation remains unchanged and still sorts all lines by absolute_start.

Testing

  • Ran python -m py_compile poopbot.py to validate syntax and it completed successfully.

Codex Task

@Gokias Gokias merged commit a316c78 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