Repository navigation
fix(macos): cap OpenAI upload duration and isolate slice caches - #32
Merged
Merged
Conversation
Apply the tighter size or defensive 1390-second duration ceiling, validate encoded uploads, and key cached responses by actual source boundaries. Retain source audio and completed responses when a later request fails. Adapt the tighter-ceiling approach from gsamat/amanu#18, source commit 31b8ec434224ad6ead27c37dec8db51694a1b757 (head 101b41816fe7cd359a453d3d4653a19df028e20b). The duration ceiling is protective, based on a reported 1400-second API rejection, not a documented current service limit. Closes #6 Co-Authored-By: Dmitry Tsoy <hd.deman@gmail.com> Co-Authored-By: OpenAI Codex <noreply@openai.com>
ekho
marked this pull request as ready for review
October 21, 2026 21:35
Preserve upstream attribution in docs/history, following the independent product guard convention. Runtime behavior is unchanged. Co-Authored-By: OpenAI Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a recording was below the upload byte limit, OpenAI received the whole file even when it exceeded the diarization model's observed duration ceiling. This fix cuts by the tighter size or duration estimate, checks the encoded files before upload, and keys cached responses by actual source ranges. Short valid audio remains one request; retries retain source audio and reuse completed pieces, with timestamps and speaker labels kept separate per request.
Closes #6
Limits and provenance
chunking_strategyabove 30 seconds. Neither those pages nor the model page specifies 1400 seconds. Existing byte-threshold interpretation and size margin are retained.31b8ec434224ad6ead27c37dec8db51694a1b757, reviewed head101b41816fe7cd359a453d3d4653a19df028e20b. Author credit is preserved in the commit; copyright and license files are unchanged. The unrelated MicRecorder patch is excluded.f08bf3458731ffb570b2de52b28df67e388c9e87. Current head:46b5ce646374a1f6874f4679189baebfe4c4fc0e. Runtime code and Swift tests were validated at78a64a9578f652ee57104a4e2370b0e3dde9cb08; the follow-up only relocates upstream links to provenance documentation and changes a source comment.Validation
Local Apple Silicon, Swift 6.4 / Xcode 27.1:
swift test --no-parallel --filter 'OpenAIEngineTests|FormEngineHTTPTests|TranscriptionScratchTests': 22 tests / 3 suites passed.swift test --no-parallel: final success report, 1031 tests / 145 suites, 132.521 s; 23 skipped native model/corpus, LocalVQE, private-audio, calendar and window cases.swift buildandgit diff --check: passed.python3 -m unittest discover -s Tests/scripts -p 'test_*.py': 114 tests passed after moving upstream references intodocs/history, matching the product-independence guard convention.python3 Tests/scripts/test_independent_product.py --all: passed.Acceptance limits
No real OpenAI requests, personal recordings, or API keys were used. Stub success does not establish live API acceptance or recognition quality. Packaged-app behavior and Windows were not tested; Windows is outside this issue.
Old cached responses without source boundaries are intentionally not reused, so an interrupted legacy run may upload again once. Unexpected encoded-limit overruns fail locally while retaining source audio. The documentation also marks the existing model deprecated for shutdown on February 26, 2027; migration is separate work.
Details: docs/testing/openai-duration-cap.md.