[BUG] First AI enhancement request after ~1.5–2 min idle hangs ~6.5 s, fails with -1005, then succeeds on retry
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- swift
- Domain
- networking
Research direction
Start by locating LLMClient and reading how it creates requests, configures connection reuse or timeouts, and handles retries for -1005. Reproduce the reported 90–120-second idle gap with the supplied Groq setup and compare it with requests made less than 60 seconds apart. Done means the first request after idle no longer incurs the roughly 6.5-second failure delay, while normal requests and retries still work.
Written by the indexing model from the issue text.
Description
Describe the bug
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.
Environment
- FluidVoice 1.6.9
- macOS 27 (Darwin 27.0), Apple Silicon (M4)
- Provider: Groq, OpenAI-compatible endpoint
- Dominant language
- Swift
- Stars
- 11.9k
- Forks
- 863
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 28
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from altic-dev/FluidVoice
-
bug
Difficulty 4/5 1-2 days Newbie friendliness 35/100
altic-dev/FluidVoice#1138 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
altic-dev/FluidVoice#1137 ·
Maintainers usually reply within 1 day
-
[FEATURE] FluidMeet: recover excluded microphone audio after the call with offline echo cancellationOpen
Difficulty 5/5 Over a week Newbie friendliness 15/100
altic-dev/FluidVoice#1136 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
altic-dev/FluidVoice#1135 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]Openbug
Difficulty 4/5 3-5 days Newbie friendliness 15/100
altic-dev/FluidVoice#1133 ·
Maintainers usually reply within 1 day
All issues in altic-dev/FluidVoice
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
meshtastic/Meshtastic-Apple#2603 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug Windows
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
fyi-ecosystem platform-ios team-ios
Difficulty 1/5 Under an hour Newbie friendliness 70/100
flutter/flutter#194348 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
freestylefly/WeChatBridge#44 ·
Maintainers usually reply within 1 day