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
{{ message }}
Repository navigation
[BUG] First AI enhancement request after ~1.5–2 min idle hangs ~6.5 s, fails with -1005, then succeeds on retry #1016
With a cloud AI provider (Groq, openai/gpt-oss-20b / gpt-oss-120b), the first dictation after a short idle period sometimes takes ~7 s to appear instead of the usual 0.3–1 s. The debug log shows the first request hanging for ~6.5 s, failing with NSURLErrorNetworkConnectionLost (-1005), and the automatic retry succeeding in ~0.7 s.
It looks like LLMClient reuses a pooled keep-alive connection that the server or the network path has already closed during idle. The failure is only detected after several seconds, so the retry logic works but the user waits the full detection time.
Log excerpts
[14:52:02.510] LLMClient: Making non-streaming request to https://api.groq.com/openai/v1/chat/completions
[14:52:08.733] [WARN] LLMClient: Retry 1/3 due to -1005
[14:52:08.947] LLMClient: Making non-streaming request to https://api.groq.com/openai/v1/chat/completions
[14:52:09.615] LLMClient: Non-streaming response received (1141 bytes)
[14:56:33.089] LLMClient: Making non-streaming request to https://api.groq.com/openai/v1/chat/completions
[14:56:39.836] [WARN] LLMClient: Retry 1/3 due to -1005
[14:56:40.038] LLMClient: Making non-streaming request to https://api.groq.com/openai/v1/chat/completions
[14:56:40.734] LLMClient: Non-streaming response received (1379 bytes)
In both cases the previous request had completed about 90–120 s earlier. Requests made less than about 60 s apart consistently complete in 0.3–1.0 s (12+ samples).
Reproduction steps
Configure Groq as the AI provider and enable a Dictate prompt.
Dictate once. Processing is fast.
Wait about 1.5–2 minutes.
Dictate again. Sometimes it takes ~7 s, and the log shows Retry 1/3 due to -1005.
Expected behavior
A stale pooled connection is detected or avoided quickly, so the first request after idle is as fast as the others.
Possible directions
Retry immediately on -1005 using a fresh connection, or use a shorter timeout for the first attempt.
Avoid reusing idle connections older than N seconds for provider requests.
Send a lightweight warm-up request (e.g. HEAD/OPTIONS) when recording starts, so the connection is fresh by the time the transcript is ready.
This issue has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the keep-open or pinned label to prevent automatic closure.
This issue is still relevant. I can share more logs or test a fix if that helps. Could a maintainer add the keep-open label so it isn't auto-closed while it waits for triage? Thanks!
To compare: use Groq, dictate once, wait about 2 minutes, then dictate again. With the fix, the debug log should show LLMClient: Opening a fresh connection after N s idle and no Retry 1/3 due to -1005. A few rounds of before and after logs would help the maintainer verify it.
Activity
github-actions commentedon Sep 30, 2026
This issue has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the
keep-openorpinnedlabel to prevent automatic closure.Conte777 commentedon Sep 30, 2026
This issue is still relevant. I can share more logs or test a fix if that helps. Could a maintainer add the
keep-openlabel so it isn't auto-closed while it waits for triage? Thanks!altic-dev commentedon Oct 1, 2026
if you can help with a small fix just for this - happy to PR and merge. Make sure you review it before submitting! Thanks!
altic-dev commentedon Oct 1, 2026
Also, would like some video before and after or some logs for me to verify - I cannot test it myself as I dont use APIs. Thanks!
andrewmitchell-automations commentedon Oct 13, 2026
@Conte777 I opened #1134 for this. If no AI request has run for 45 s, the app now opens a new connection instead of reusing the old one. The stall did not happen on my network, so your logs would confirm the fix. Could you test this build: https://github.com/altic-dev/FluidVoice/actions/runs/38431278383/artifacts/11831854864 (install steps are in the comment on #1134)? The build has its own bundle ID, so it runs next to your normal install.
To compare: use Groq, dictate once, wait about 2 minutes, then dictate again. With the fix, the debug log should show
LLMClient: Opening a fresh connection after N s idleand noRetry 1/3 due to -1005. A few rounds of before and after logs would help the maintainer verify it.