feat(vision-proxy): add configurable request timeout - #203
Conversation
Allow users to set a custom HTTP timeout (in milliseconds) for Vision Proxy API requests via the settings panel. The field accepts any value > 0; empty / invalid / ≤ 0 values fall back to the existing default of 30 seconds. No upper cap is enforced. Changes: - types.ts: add optional `timeoutMs` to `VisionProxyConfig` - endpoint/config.ts: add `normalizeTimeoutMs()` (reject ≤ 0, no cap) - protocols/client.ts: use `config.timeoutMs ?? DEFAULT_TIMEOUT_MS` - ui/html.ts: add `<input type="number">` for timeout - ui/script.ts: wire `parsePositiveNumber()`, `applyState`, `collectConfig` - i18n.ts: add `field.timeoutMs` / `hint.timeoutMs` for en + zh
|
Thanks — a configurable timeout is useful here. Before merging, could you add an explicit maximum for I suggest exactly Node's It would also be good to accept integers only ( Reference: https://nodejs.org/api/timers.html#settimeoutcallback-delay-args |
Summary
Adds an optional Request timeout (ms) field to the Vision Proxy
settings panel so users can increase the HTTP timeout for slow vision
API endpoints. Previously the timeout was hardcoded at 30 seconds.
Behavior
Files changed
src/provider/vision/types.ts— add optionaltimeoutMstoVisionProxyConfigsrc/provider/vision/sources/endpoint/config.ts— addnormalizeTimeoutMs()(validates > 0, no cap)src/provider/vision/protocols/client.ts— useconfig.timeoutMs ?? DEFAULT_TIMEOUT_MSsrc/provider/vision/ui/html.ts— add<input type="number">fieldwith label + hint
src/provider/vision/ui/script.ts— wireparsePositiveNumber(),applyState,collectConfigfor the new fieldsrc/i18n.ts— addfield.timeoutMs/hint.timeoutMsstrings forboth
enandzhdictionariesScreenshots
Translation review requested
The Chinese (
zh) translations for the new strings were written with thehelp of an AI assistant. A native speaker should review them:
Corresponding English:
🙏 Please flag anything that sounds unnatural or could be improved.