Skip to content

Stop failing every OpenAI call longer than 23 minutes - #60

Open
in0vik wants to merge 4 commits into
gsamat:masterfrom
in0vik:openai-duration-slicing
Open

in0vik wants to merge 4 commits into
gsamat:masterfrom
in0vik:openai-duration-slicing

Conversation

@in0vik

@in0vik in0vik commented Oct 29, 2026

Copy link
Copy Markdown

OpenAI's diarizer won't take more than 1400 seconds of audio. We only sliced at 25 MB, so anything past ~23 minutes died with a 400. I had 26 meetings in that pile. Not a great look for a meeting recorder.

The fix: cut the mix into 5-minute pieces, in pauses, and send them all at once.

  • Piece 1 goes first. The four people who talked most in it ride along with every other piece as known_speaker_*, so "A" stays "A" for the whole call.
  • Everything is streamed. A stream that dies before transcript.text.done gets retried, not cached half-done.

Why 5 minutes? The model slows down faster than the audio grows. Same 20 minutes:

wall time
1 × 20 min 7–9 min
4 × 5 min 2 min 13 s
60 × 1 min 69 s

Below 5 minutes it stops getting faster, and the diarizer has less to go on.

Before: 59-min call → audio duration 3557.82 seconds is longer than 1400 seconds
After: same call → 13 pieces, 3 min 21 s, 704 segments. 779 tests green.

OpenAI-only, easy to revert. Old OpenAI caches get new keys, so re-running a sliced session pays for it once.

Ilya Novik and others added 4 commits October 28, 2026 21:11
…s, with the first piece's voices sent along to the rest.

The diarizing model refuses more than 1400 seconds of audio per request, and
the slicer only knew about its 25 MB, so every meeting over 23 minutes failed
as permanent: thirty in a row on one machine. Pieces are now bounded by both
limits, sized at the 64k they are written at, and cut at the quietest half
second near an even split. The first piece goes alone; up to four of its
voices travel with every later piece as known_speaker_references, so its
speakers keep one label for the whole meeting. Requests stream, because an
unstreamed twenty-minute piece sent by amanu was never answered while curl's
copy of it was, and a piece that drops is sent again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t.done, and log how it ended.

One piece of an hour-long meeting came back with its segments and no closing
event, and the whole meeting was given up on. A piece is now tried three
times, an error event counts as unfinished, and the failure quotes the end of
the stream rather than its start, which looks the same in a whole one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at that needs.

An hour as twelve five-minute pieces sent together came back in about two
minutes; as three twenty-minute ones, the first alone, it took sixteen to
twenty-five. Up to thirty-six pieces are in flight at once, and sixty were
measured without a refusal. The fallback for refused voice samples, the plain
JSON reading of a streamed answer and the hand-written WAV encoder are gone:
none of them answers anything that happens, and AudioSlicer keeps its old
names with the pause search added in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cache by its voices' samples, and cut in whole-frame buckets, as three reviews found.

Gemini Argon, Codex Astra and Opus each reviewed the branch. Besides those
three, the slicer stops at its last planned end instead of trapping past it,
removes a half-made piece before retrying without a bitrate, and the request's
fields are a pure function so the tests can see the known speakers are sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant