Make HTTP request timeout configurable (hardcoded 120 s breaks slow self-hosted backends)
Problem
All HTTP requests share a hardcoded 120 s timeout (connectTimeoutMillis, requestTimeoutMillis, socketTimeoutMillis) in network/src/commonMain/kotlin/com/shifthackz/aisdv1/network/client/HttpClientFactory.kt:
private const val DEFAULT_TIMEOUT_MILLIS = 120_000L
Against slow self-hosted backends (e.g. an A1111-compatible stable-diffusion.cpp sd-server with CPU offload, large FLUX-class models, or a server that cold-loads the model on the first request), a single txt2img/img2img call often takes longer than 2 minutes. SDAI then aborts the request even though the server is still generating and later returns a valid image. There is currently no setting to change this.
Proposal
Add a user setting (e.g. under the server/connection settings) for the generation request timeout, with 120 s as the default and an option for "no limit". Applied to requestTimeoutMillis and socketTimeoutMillis; connect timeout can stay short.
I'm happy to send a PR for this.
Addressed in #734, merged into develop. Thanks @wiz0floyd for reporting the issue and contributing #733.
- Configurable generation request and socket timeouts for all eight network AI providers: 2 minutes (default), 5, 10, 30 minutes, or No limit.
- Separate connection timeout with the same default and options on Android. This setting is hidden on iOS because the current networking engine does not support it independently.
- Timeout settings are hidden for local providers, with translations for all six supported languages.
This feature will be included in the next release.