WeKnora/internal/config
tayadwx d6269994b3
refactor: 出站拨号超时默认 5s 并改为 env 可配 (WEKNORA_OUTBOUND_DIAL_TIMEOUT) (#4122)
* refactor: make outbound SSRF-safe dial timeout configurable (default 5s)

Previously SSRFSafeDialContext hardcoded a 30s dial timeout for every
outbound (SSRF-validated) endpoint (VLM/LLM/embedding/ASR/connectors).
A black-holed or unreachable endpoint therefore burned ~30s per attempt
before failing, which (a) delayed the circuit breaker trip and (b) made
the UI show a misleading "thinking" state instead of surfacing the
bad-URL error quickly.

- Move the dial timeout to WEKNORA_OUTBOUND_DIAL_TIMEOUT, default 5s.
- Apply it in config.LoadConfig via utils.SetOutboundDialTimeout; the
  default is also set in an init() so it holds even if LoadConfig is
  skipped. Concurrent reads are safe (atomic nanoseconds).
- KeepAlive stays 30s; the sandbox/cloud GuardedDialContext (10s) and
  Ollama dialer (10s) are intentionally left untouched.

* test(utils): serialize outbound dial timeout tests

---------

Co-authored-by: tayadwx <tayadwx@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-10 14:50:20 +08:00
..
agent_prompts.go feat(browser): polish connection settings, open tasks in a new window, and streamline prompts (#3193) 2026-09-11 21:28:58 +08:00
agent_prompts_test.go feat(browser): polish connection settings, open tasks in a new window, and streamline prompts (#3193) 2026-09-11 21:28:58 +08:00
auth_legacy_env_test.go feat(auth): 新增仅限邀请注册档位 (#3900) 2026-09-30 13:32:55 +08:00
config.go refactor: 出站拨号超时默认 5s 并改为 env 可配 (WEKNORA_OUTBOUND_DIAL_TIMEOUT) (#4122) 2026-10-10 14:50:20 +08:00