You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LocalAPI has a 300-second audio limit, but inline audio decoded through LocalAPIAudioDecoder.samples(fromAudioData:suggestedExtension:) could be silently truncated to the first 300 seconds because the shared decoder capped framesToRead with min(file.length, maxFrames).
This changes the shared decode path to reject over-limit audio with the same LocalAPIAudioDecoder duration-limit error instead of truncating. Under-limit inline audio still decodes normally.
The PR also centralizes the duration-limit error in durationLimitExceededError(), so file-path and inline/body uploads return the same error domain, code, and message.
Type of Change
🐞 Bug fix (non-breaking change which fixes an issue)
✨ New feature (non-breaking change which adds functionality)
💥 Breaking change (fix or feature that would cause existing functionality not to work as expected)
The tests build synthetic silent WAV fixtures/data, so they do not require downloading or running a speech model.
Notes
This is API behavior only. It does not change UI, settings, onboarding, overlay, menu bar, or visual behavior.
Full hosted test execution was not run locally because the installed FluidVoice app was open; the hosted test runner can hang in that state. build-for-testing compiled the app and test target, and CI should run the full hosted suite after the branch update.
Screenshots / Video
No UI/visual changes; screenshots/video are not applicable.
The PR changes the shared LocalAPI audio decoder to reject audio longer than 300 seconds rather than decoding only the first 300 seconds.
Centralizes the duration-limit error so file and inline request paths return consistent error details.
Adds synthetic WAV tests for over-limit inline audio, under-limit decoding, and file-path validation.
Registers the new tests with the integration-test target.
Confidence Score: 5/5
The PR appears safe to merge, with the intended duration-limit behavior consistently applied across LocalAPI audio input paths.
The changed decoder rejects over-limit audio before allocation and decoding, preserves normal under-limit decoding, and has no callers outside the intended LocalAPI scope.
Closing this as superseded. Main no longer truncates audio at 300 seconds or enforces that limit. ChunkReader reads the file in 20-minute chunks and the caller continues until EOF, so the
behaviour this PR fixed is gone and the rejection it added no longer matches main.
The tests here are tied to the removed duration limit, so there is nothing to rebase.
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
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.
Description
LocalAPI has a 300-second audio limit, but inline audio decoded through
LocalAPIAudioDecoder.samples(fromAudioData:suggestedExtension:)could be silently truncated to the first 300 seconds because the shared decoder cappedframesToReadwithmin(file.length, maxFrames).This changes the shared decode path to reject over-limit audio with the same
LocalAPIAudioDecoderduration-limit error instead of truncating. Under-limit inline audio still decodes normally.The PR also centralizes the duration-limit error in
durationLimitExceededError(), so file-path and inline/body uploads return the same error domain, code, and message.Type of Change
Related Issue or Discussion
Tracking discussion: #429.
Testing
swiftlint --strict --config .swiftlint.yml Sources Tests/FluidDictationIntegrationTests/LocalAPIAudioDecoderTests.swiftswiftformat --config .swiftformat Sourcesxcodebuild build-for-testing -project Fluid.xcodeproj -scheme Fluid -destination 'platform=macOS,arch=arm64' CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NOAdded
LocalAPIAudioDecoderTestscoverage:testInlineAudioOverLimitThrowsInsteadOfTruncatingtestInlineAudioUnderLimitDecodesNormallytestFilePathDecodeRejectsOverLimitAudioThe tests build synthetic silent WAV fixtures/data, so they do not require downloading or running a speech model.
Notes
This is API behavior only. It does not change UI, settings, onboarding, overlay, menu bar, or visual behavior.
Full hosted test execution was not run locally because the installed FluidVoice app was open; the hosted test runner can hang in that state.
build-for-testingcompiled the app and test target, and CI should run the full hosted suite after the branch update.Screenshots / Video