Skip to content

fix(backend): regroup offline sync segments before ASR - #8007

Closed
waffensam wants to merge 1 commit into
BasedHardware:mainfrom
waffensam:codex/offline-sync-session-asr
Closed

waffensam wants to merge 1 commit into
BasedHardware:mainfrom
waffensam:codex/offline-sync-session-asr

Conversation

@waffensam

Copy link
Copy Markdown
Contributor

Summary

  • Regroup offline sync VAD WAVs into wider ASR windows before prerecorded transcription.
  • Preserve wall-clock gaps with inserted silence, splitting windows when the gap is over 120s or the window would exceed 10 minutes.
  • Apply the same path to v1 and v2 sync while reusing existing user transcription preferences and falling back to original VAD segments if regrouping fails.

Closes #8006

Testing

  • /private/tmp/omi-black-venv/bin/black --line-length 120 --skip-string-normalization backend/routers/sync.py
  • python3 -m py_compile backend/routers/sync.py
  • git diff --check
  • Not run: python3 -m pytest backend/tests/unit/test_sync_ordered_assignment.py -q (pytest is not installed in this environment)

@Git-on-my-level Git-on-my-level added needs-tests PR introduces logic that should be covered by tests needs-maintainer-review Needs a human maintainer to sign off before merge backend Backend Task (python) labels Jun 26, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for tackling this — regrouping offline VAD segments before prerecorded ASR is the right direction for improving offline transcription context without changing the 60s upload/retry units.

I did a static review of backend/routers/sync.py and a syntax check of the head file. The implementation is small and generally coherent, but I would not mark this ready yet because the PR is still a draft, currently has merge conflicts, and this audio-windowing behavior needs focused regression coverage before it lands.

Could you please add tests that cover at least:

  • grouping adjacent VAD segments into one ASR window while preserving timestamp gaps with inserted silence;
  • splitting when the gap is over 120s and when the projected ASR window would exceed 10 minutes;
  • fallback to the original segment paths when regrouping/export fails;
  • the v2 job path updating total_segments after regrouping and cleaning synthesized asr_window_*.wav files.

A small mocked/unit-level test around build_asr_windows_from_segments() plus one pipeline-level check should be enough. Once conflicts are resolved and those tests are in place, this should be much easier to review/land.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing as a maintainer.

This is still a draft on 545f895 (Jun 18), CONFLICTING against current main, with no tests. Git-on-my-level already said it was not ready (Jun 26): grouping/silence gaps, 120s and 10-minute splits, regroup fallback, and the v2 asr_window cleanup all need coverage. None of that landed.

#8006 is still real — per-VAD prerecorded STT is still the path on main — but the sync pipeline has moved since this patch (process_segment now lives under utils/sync/pipeline.py). Landing a June routers/sync.py windowing change here would fight that, not compose with it.

Offline sync / transcription also needs device or explicit maintainer smoke. I will not merge this branch.

#8006 stays open. A new PR on current main can take another run after those tests — not this draft.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @waffensam 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) human Human-authored pull request needs-maintainer-review Needs a human maintainer to sign off before merge needs-tests PR introduces logic that should be covered by tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline WAL uploads should reconstruct sessions before ASR and use live transcription settings

4 participants