Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] First AI enhancement request after ~1.5–2 min idle hangs ~6.5 s, fails with -1005, then succeeds on retry

Open
#1,016 5 comments 0 reactions 0 assignees View on GitHub

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

keep-open
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
  1. Configure Groq as the AI provider and enable a Dictate prompt.
  2. Dictate once. Processing is fast.
  3. Wait about 1.5–2 minutes.
  4. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from altic-dev/FluidVoice

All issues in altic-dev/FluidVoice

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.