Skip to content

Fix AI post-processing errors leaking into typed output#243

Closed
uid4oe wants to merge 3 commits intoaltic-dev:mainfrom
uid4oe:fix/ai-error-fallback
Closed

Fix AI post-processing errors leaking into typed output#243
uid4oe wants to merge 3 commits intoaltic-dev:mainfrom
uid4oe:fix/ai-error-fallback

Conversation

@uid4oe
Copy link
Copy Markdown

@uid4oe uid4oe commented Mar 31, 2026

Summary

  • When the LLM API fails during dictation post-processing, fall back to the raw transcription instead of typing error strings into the user's document
  • Fixes two paths in ContentView.processTextWithAI(): empty API response and any LLM error

Closes #242

When the LLM API fails during dictation post-processing, fall back to
the raw transcription instead of typing error strings into the user's
document. Fixes two paths in processTextWithAI(): empty API response
and any LLM error.

Closes #242
@altic-dev
Copy link
Copy Markdown
Owner

nice work! I wanted to fix this for a long time.
When it falls back - how would the user know the LLM PP did not work?

@uid4oe
Copy link
Copy Markdown
Author

uid4oe commented Apr 1, 2026

@altic-dev thanks, great work with the app! good question, I can think of two options

  1. a retry button
  2. more resilient LLM calls

I can add the second on which should reduce the frequency further. note I added some tests too but my mac is not compatible with the project, would be great if you can verify the changes

Consolidate retry logic into a single isRetryable() method that handles
both network errors (already retried) and transient HTTP errors (new).
@altic-dev
Copy link
Copy Markdown
Owner

Waitt then how are finding these issues if you cannot run them?

@uid4oe uid4oe force-pushed the fix/ai-error-fallback branch from 3ec8f5d to 018da96 Compare April 1, 2026 06:30
@uid4oe
Copy link
Copy Markdown
Author

uid4oe commented Apr 1, 2026

@altic-dev you mean how I found the bug? I just used the app, and checked the log file, the change was straight forward, you already have a similar fallback for apple intelligence case

the next two commits extends retryable errors on llm client, tests for it are straightforward assertions but they should be added to the project

I can't build on Xcode 26.4, (macOS 26) regardless of dependency versions. Multiple packages (FluidAudio, mcp-swift-sdk, swift-collections) aren't Swift 6 compatible, let me know if you have a fix

@altic-dev
Copy link
Copy Markdown
Owner

got it. that makes sense. Thanks. So I have 26+ 6.2 - it compiles well. Try it on Xcode and see if Claude can help you version it right with respect to any tool chain version mismatch etc. I need some help with making sure the the UX is good for the retry or alternatives. Error on the screen makes sense but def the fall back works but letting them know it wasn't post processed is needed for sure. Lmk what you think.

@uid4oe
Copy link
Copy Markdown
Author

uid4oe commented Apr 1, 2026

yeah I'm trying, seems like mainly related to mac os 26.

Retry or some sort of error state would be good for sure.

@altic-dev
Copy link
Copy Markdown
Owner

Yeah I have 26 too actually. works okay.

Where do you want to show the retry option or error? the overlay is supposed to go away after you click stop usually.

@uid4oe
Copy link
Copy Markdown
Author

uid4oe commented Apr 1, 2026

@altic-dev something like this maybe? Also it makes sense to allow users to skip this view if for instance they press the hotkeys again, then we can just use the fallback, wdyt?

Screenshot 2026-04-01 at 14 57 35 Screenshot 2026-04-01 at 14 57 17 Screenshot 2026-04-01 at 14 56 10

@uid4oe uid4oe closed this by deleting the head repository Apr 1, 2026
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.

[🐞 BUG] AI post-processing errors typed into user's document instead of falling back to raw transcription

2 participants