Repository navigation
Fix long Fluid-1 dictation fallback - #902
Conversation
Reject dictation before generation when the context window cannot preserve the full transcript, allowing the existing raw-transcript fallback and notification path to run. Fixes #899
Greptile SummaryThis PR prevents long Fluid-1 dictations from reaching generation without sufficient context headroom, routing them through the existing raw-transcript fallback instead.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15b10ba8c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
FluidVoice PR build readyDownload FluidVoice-PR-902-268fa8b9cc80 The artifact contains the ad-hoc-signed app ZIP, Xcode archive, build manifest, and installation instructions. It expires 5 days after the build. Install the app
This build has its own app identity, so its permissions are separate from the release version of FluidVoice. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7209d07c89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if byteCount > Self.privateAIDenseSegmentByteThreshold { | ||
| estimate += (byteCount + Self.privateAIDenseBytesPerToken - 1) | ||
| / Self.privateAIDenseBytesPerToken | ||
| } else { | ||
| estimate += 1 |
There was a problem hiding this comment.
Account for token-dense short segments
When a long transcript contains many token-dense segments of 12 bytes or fewer—for example, space-separated short IDs, hashes, or codes—this branch charges every segment as exactly one token even though each may tokenize into several tokens. The newly added threshold is fresh evidence that the earlier overflow case remains for segmented identifiers: at a 4K context, hundreds of such segments can pass hasSufficientHeadroom while the real prompt exceeds the window, again risking truncated output. Apply the conservative byte/token estimate to every segment (or use the model tokenizer) rather than exempting short ones.
Useful? React with 👍 / 👎.
Description
Prevents long Fluid-1 dictations from silently returning truncated model output when the transcript cannot fit alongside a complete response.
The private-AI path now checks context headroom before generation. When the full transcript cannot be preserved, it throws into FluidVoice's existing raw-transcript fallback, notification, and history-error path.
Type of Change
Related Issue or Discussion
Closes #899
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat SourcesAdditional validation:
Screenshots / Video
Notes
The budget check is intentionally conservative near the context boundary: preserving the complete raw transcript is preferred over risking silently truncated output.