feat(client): ProxyConfig.request_timeout_seconds (default 35s, reject <=0)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 15:00:40 -05:00
parent a171d40781
commit 377adb10b2
2 changed files with 27 additions and 0 deletions

View File

@@ -7,8 +7,19 @@ extends RefCounted
const SETTING := "coc_rpg/proxy_base_url"
const DEFAULT := "http://localhost:8000"
const TIMEOUT_SETTING := "coc_rpg/proxy_request_timeout_seconds"
const TIMEOUT_DEFAULT := 35.0
static func base_url() -> String:
var v = ProjectSettings.get_setting(SETTING, DEFAULT)
var s := str(v)
return s if s != "" else DEFAULT
static func request_timeout_seconds() -> float:
# Just above the server's OLLAMA_TIMEOUT_SECONDS (30) so a slow model surfaces
# the server's own error first, while a fully-hung proxy is still bounded. A
# non-positive value would re-enable the infinite hang, so reject it.
var v := float(ProjectSettings.get_setting(TIMEOUT_SETTING, TIMEOUT_DEFAULT))
return v if v > 0.0 else TIMEOUT_DEFAULT