Skip to content

feat(client): make HTTP connect/read timeouts configurable - #73

Merged
david-debest merged 1 commit into
mainfrom
71-feat/configurable-timeouts
Oct 19, 2026
Merged

david-debest merged 1 commit into
mainfrom
71-feat/configurable-timeouts

Conversation

@david-debest

Copy link
Copy Markdown
Contributor

Summary

Closes #71.

The KE client hardcoded a 5 s connect / 30 s read timeout (35 s for the long-poll request), which can be too short for slower network environments (VPNs, congested networks, KE runtimes under heavy load).

Changes

  • Client.__init__ now accepts connect_timeout (default 5.0) and read_timeout (default 30.0) parameters, used to build the underlying httpx.Timeout.
  • The long-poll request's timeout now scales with read_timeout (read_timeout + 5.0 margin) instead of being hardcoded to 35.0.
  • KnowledgeBase.__init__ accepts and forwards the same two parameters to Client.
  • KnowledgeBaseSettings gains connect_timeout/read_timeout fields (with defaults matching the previous hardcoded values), so config-driven KBs can set them via env vars / YAML / JSON.
  • KnowledgeBaseBuilder forwards the settings values to the constructed KnowledgeBase.
  • CONTEXT.md documents the new YAML settings fields.
  • Added/updated tests covering default values, custom values, and propagation through settings → builder → client.

No behavioral change for existing users who don't set these — defaults are identical to the previous hardcoded values.

The KE client previously hardcoded a 5 s connect / 30 s read timeout
(35 s for long-polling), which is too short for slower network
environments. Add connect_timeout/read_timeout parameters to Client
and KnowledgeBase, and corresponding fields on KnowledgeBaseSettings,
so applications can raise these as needed. Defaults are unchanged.

Fixes #71

Co-authored-by: Copilot <[email protected]>
@david-debest
david-debest merged commit 81beae9 into main Oct 19, 2026
3 checks passed
@david-debest
david-debest deleted the 71-feat/configurable-timeouts branch October 27, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make timeouts configurable for slower environments

1 participant